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 
10 #pragma once
11 
24 #include "periph_cpu.h"
25 #include "cfg_clock_32_1.h"
26 #include "cfg_rtt_default.h"
27 #include "cfg_timer_default.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
42 static const uart_conf_t uart_config[] = {
43  {
44  .dev = NRF_UARTE0,
45  .rx_pin = GPIO_PIN(0, 13),
46  .tx_pin = GPIO_PIN(0, 15),
47 #ifdef MODULE_PERIPH_UART_HW_FC
48  .rts_pin = GPIO_UNDEF,
49  .cts_pin = GPIO_UNDEF,
50 #endif
51  .irqn = UARTE0_UART0_IRQn,
52  },
53 };
54 
55 #define UART_0_ISR (isr_uart0)
56 
57 #define UART_NUMOF ARRAY_SIZE(uart_config)
69 static const pwm_conf_t pwm_config[] = {
70  {
71  NRF_PWM0,
72  {
73  GPIO_PIN(0, 6),
74  GPIO_PIN(0, 8),
75  GPIO_PIN(1, 9),
76  GPIO_PIN(0, 12),
77  },
78  },
79 };
80 #define PWM_NUMOF ARRAY_SIZE(pwm_config)
87 static const spi_conf_t spi_config[] = {
88  {
89  .dev = NRF_SPIM0,
90  .sclk = GPIO_PIN(0, 20),
91  .mosi = GPIO_PIN(0, 22),
92  .miso = GPIO_PIN(0, 24),
93  }
94 };
95 
96 #define SPI_NUMOF ARRAY_SIZE(spi_config)
103 static const i2c_conf_t i2c_config[] = {
104  {
105  .dev = NRF_TWIM1,
106  .scl = GPIO_PIN(0, 29),
107  .sda = GPIO_PIN(0, 31),
108  .speed = I2C_SPEED_NORMAL
109  }
110 };
111 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
114 #ifdef __cplusplus
115 }
116 #endif
117 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:45
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:38
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:96
static const i2c_conf_t i2c_config[]
I2C configuration.
Definition: periph_conf.h:68
static const pwm_conf_t pwm_config[]
Actual PWM configuration.
Definition: periph_conf.h:221
Common clock configuration for the nRF52 based boards.
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition: periph_cpu.h:277
I2C configuration structure.
Definition: periph_cpu.h:298
TWI_t * dev
Pointer to hardware module registers.
Definition: periph_cpu.h:299
PWM device configuration.
SPI device configuration.
Definition: periph_cpu.h:336
SPI_t * dev
pointer to the used SPI device
Definition: periph_cpu.h:337
UART device configuration.
Definition: periph_cpu.h:217
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:218