Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Christian Amsüss <chrysn@fsfe.org>
3 * 2021 Freie Universität Berlin
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
22#ifndef PERIPH_CONF_H
23#define PERIPH_CONF_H
24
25#include "periph_cpu.h"
26#include "cfg_clock_32_1.h"
27#include "cfg_rtt_default.h"
28#include "cfg_timer_default.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
43static const uart_conf_t uart_config[] = {
44 {
45 .dev = NRF_UARTE0,
46 .rx_pin = GPIO_PIN(0, 13),
47 .tx_pin = GPIO_PIN(0, 15),
48#ifdef MODULE_PERIPH_UART_HW_FC
49 .rts_pin = GPIO_UNDEF,
50 .cts_pin = GPIO_UNDEF,
51#endif
52 .irqn = UARTE0_UART0_IRQn,
53 },
54};
55
56#define UART_0_ISR (isr_uart0)
57
58#define UART_NUMOF ARRAY_SIZE(uart_config)
70static const pwm_conf_t pwm_config[] = {
71 {
72 NRF_PWM0,
73 {
74 GPIO_PIN(0, 6),
75 GPIO_PIN(0, 8),
76 GPIO_PIN(1, 9),
77 GPIO_PIN(0, 12),
78 },
79 },
80};
81#define PWM_NUMOF ARRAY_SIZE(pwm_config)
88static const spi_conf_t spi_config[] = {
89 {
90 .dev = NRF_SPIM0,
91 .sclk = GPIO_PIN(0, 20),
92 .mosi = GPIO_PIN(0, 22),
93 .miso = GPIO_PIN(0, 24),
94 }
95};
96
97#define SPI_NUMOF ARRAY_SIZE(spi_config)
104static const i2c_conf_t i2c_config[] = {
105 {
106 .dev = NRF_TWIM1,
107 .scl = GPIO_PIN(0, 29),
108 .sda = GPIO_PIN(0, 31),
109 .speed = I2C_SPEED_NORMAL
110 }
111};
112#define I2C_NUMOF ARRAY_SIZE(i2c_config)
115#ifdef __cplusplus
116}
117#endif
118
119#endif /* PERIPH_CONF_H */
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:278
Common clock configuration for the nRF52 based boards.
I2C configuration structure.
Definition periph_cpu.h:299
TWI_t * dev
Pointer to hardware module registers.
Definition periph_cpu.h:300
PWM device configuration.
SPI device configuration.
Definition periph_cpu.h:337
SPI_t * dev
pointer to the used SPI device
Definition periph_cpu.h:338
UART device configuration.
Definition periph_cpu.h:218
USART_t * dev
pointer to the used UART device
Definition periph_cpu.h:219