boards/microbit/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 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 
19 #ifndef PERIPH_CONF_H
20 #define PERIPH_CONF_H
21 
22 #include "periph_cpu.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
35 #define CLOCK_HFCLK (16U) /* set to 0: internal RC oscillator
36  16: 16MHz crystal
37  32: 32MHz crystal */
38 #define CLOCK_LFCLK (0) /* 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_TIMER0,
50  .channels = 3,
51  .bitmode = TIMER_BITMODE_BITMODE_24Bit,
52  .irqn = TIMER0_IRQn
53  },
54  {
55  .dev = NRF_TIMER1,
56  .channels = 3,
57  .bitmode = TIMER_BITMODE_BITMODE_16Bit,
58  .irqn = TIMER1_IRQn
59  },
60  {
61  .dev = NRF_TIMER2,
62  .channels = 3,
63  .bitmode = TIMER_BITMODE_BITMODE_16Bit,
64  .irqn = TIMER2_IRQn
65  }
66 };
67 
68 #define TIMER_0_ISR isr_timer0
69 #define TIMER_1_ISR isr_timer1
70 #define TIMER_2_ISR isr_timer2
71 
72 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
73 
79 #define RTT_NUMOF (1U)
80 #define RTT_DEV (1) /* NRF_RTC1 */
81 #define RTT_MAX_VALUE (0x00ffffff)
82 #define RTT_FREQUENCY (1024)
83 
89 #define UART_NUMOF (1U)
90 /* UART pin configuration */
91 #define UART_HWFLOWCTRL 0
92 #define UART_PIN_RX 25
93 #define UART_PIN_TX 24
94 
100 static const i2c_conf_t i2c_config[] = {
101  {
102  .dev = NRF_TWI0,
103  .pin_scl = 0,
104  .pin_sda = 30,
105  .ppi = 0
106  }
107 };
108 
109 #define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
110 
118 #define ADC_NUMOF (0)
119 
128 #define RADIO_IRQ_PRIO 1
129 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* PERIPH_CONF_H */
136 
I2C configuration options.
NRF_TIMER_Type * dev
timer device
NRF_TWI_Type * dev
hardware device
Timer configuration.