periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2016-2017 Freie Universität Berlin
3  * SPDX-FileCopyrightText: 2017 HAW Hamburg
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
21 #include "periph_cpu.h"
22 #include "cfg_clock_32_1.h"
23 #include "cfg_rtt_default.h"
24 #include "cfg_timer_default.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
35 #define CLOCK_CORECLOCK (64000000U) /* fixed for all nRF52832 */
42 static const uart_conf_t uart_config[] = {
43  {
44  .dev = NRF_UARTE0,
45  .rx_pin = GPIO_PIN(0, 30),
46  .tx_pin = GPIO_PIN(0, 31),
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_NUMOF ARRAY_SIZE(uart_config)
56 #define UART_0_ISR (isr_uart0)
63 static const spi_conf_t spi_config[] = {
64  {
65  .dev = NRF_SPIM0,
66  .sclk = 4,
67  .mosi = 3,
68  .miso = 13,
69  .ppi = 0
70  }
71 };
72 
73 #define SPI_NUMOF ARRAY_SIZE(spi_config)
80 static const i2c_conf_t i2c_config[] = {
81  {
82  .dev = NRF_TWIM1,
83  .scl = 28,
84  .sda = 29,
85  .speed = I2C_SPEED_NORMAL
86  }
87 };
88 
89 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
92 #ifdef __cplusplus
93 }
94 #endif
95 
#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:35
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:93
static const i2c_conf_t i2c_config[]
I2C configuration.
Definition: periph_conf.h:65
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
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