periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2017 Freie Universität Berlin
3  * 2017 HAW Hamburg
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 
38 #define CLOCK_CORECLOCK (64000000U) /* fixed for all nRF52832 */
45 static const uart_conf_t uart_config[] = {
46  {
47  .dev = NRF_UARTE0,
48  .rx_pin = GPIO_PIN(0, 30),
49  .tx_pin = GPIO_PIN(0, 31),
50 #ifdef MODULE_PERIPH_UART_HW_FC
51  .rts_pin = GPIO_UNDEF,
52  .cts_pin = GPIO_UNDEF,
53 #endif
54  .irqn = UARTE0_UART0_IRQn,
55  },
56 };
57 
58 #define UART_NUMOF ARRAY_SIZE(uart_config)
59 #define UART_0_ISR (isr_uart0)
66 static const spi_conf_t spi_config[] = {
67  {
68  .dev = NRF_SPIM0,
69  .sclk = 4,
70  .mosi = 3,
71  .miso = 13,
72  .ppi = 0
73  }
74 };
75 
76 #define SPI_NUMOF ARRAY_SIZE(spi_config)
83 static const i2c_conf_t i2c_config[] = {
84  {
85  .dev = NRF_TWIM1,
86  .scl = 28,
87  .sda = 29,
88  .speed = I2C_SPEED_NORMAL
89  }
90 };
91 
92 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
95 #ifdef __cplusplus
96 }
97 #endif
98 
#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
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