boards/common/nrf52xxxdk/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2018 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef PERIPH_CONF_H
21 #define PERIPH_CONF_H
22 
23 #include "periph_cpu.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
36 #define CLOCK_HFCLK (32U) /* set to 0: internal RC oscillator
37  * 32: 32MHz crystal */
38 #define CLOCK_LFCLK (1) /* set to 0: internal RC oscillator
39  * 1: 32.768 kHz crystal
40  * 2: derived from HFCLK */
41 
47 static const timer_conf_t timer_config[] = {
48  {
49  .dev = NRF_TIMER1,
50  .channels = 3,
51  .bitmode = TIMER_BITMODE_BITMODE_32Bit,
52  .irqn = TIMER1_IRQn
53  }
54 };
55 
56 #define TIMER_0_ISR isr_timer1
57 
58 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
59 
65 #define RTT_NUMOF (1U)
66 #define RTT_DEV (1) /* NRF_RTC1 */
67 #define RTT_MAX_VALUE (0x00ffffff)
68 #define RTT_FREQUENCY (1024)
69 
75 #define UART_NUMOF (1U)
76 #define UART_PIN_RX GPIO_PIN(0,8)
77 #define UART_PIN_TX GPIO_PIN(0,6)
78 
84 static const spi_conf_t spi_config[] = {
85  {
86  .dev = NRF_SPI0,
87  .sclk = 15,
88  .mosi = 13,
89  .miso = 14
90  }
91 };
92 
93 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
94 
100 static const i2c_conf_t i2c_config[] = {
101  {
102  .dev = NRF_TWIM1,
103  .scl = 27,
104  .sda = 26,
105  .speed = I2C_SPEED_NORMAL
106  }
107 };
108 #define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
109 
111 #if defined(BOARD_NRF52DK) || defined(BOARD_NRF52840DK)
112 
116 static const pwm_conf_t pwm_config[] = {
117  { NRF_PWM0, { 28, 29, 30, 31 } }
118 };
119 #define PWM_NUMOF (sizeof(pwm_config) / sizeof(pwm_config[0]))
120 
122 #endif
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif /* PERIPH_CONF_H */
I2C configuration options.
SPI_Type * dev
SPI device to use.
NRF_TIMER_Type * dev
timer device
I2C_TypeDef * dev
USART device used.
SPI module configuration options.
normal mode: ~100kbit/s
Timer configuration.