The friendly Operating System for the Internet of Things
boards/calliope-mini/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_CORECLOCK (16000000U) /* fixed for all NRF51822 */
36 #define CLOCK_CRYSTAL (16U) /* set to 0: internal RC oscillator
37  16: 16MHz crystal
38  32: 32MHz crystal */
39 
45 static const timer_conf_t timer_config[] = {
46  {
47  .dev = NRF_TIMER0,
48  .channels = 3,
49  .bitmode = TIMER_BITMODE_BITMODE_24Bit,
50  .irqn = TIMER0_IRQn
51  },
52  {
53  .dev = NRF_TIMER1,
54  .channels = 3,
55  .bitmode = TIMER_BITMODE_BITMODE_16Bit,
56  .irqn = TIMER1_IRQn
57  },
58  {
59  .dev = NRF_TIMER2,
60  .channels = 3,
61  .bitmode = TIMER_BITMODE_BITMODE_16Bit,
62  .irqn = TIMER2_IRQn
63  }
64 };
65 
66 #define TIMER_0_ISR isr_timer0
67 #define TIMER_1_ISR isr_timer1
68 #define TIMER_2_ISR isr_timer2
69 
70 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
71 
77 #define RTT_NUMOF (1U)
78 #define RTT_IRQ_PRIO 1
79 
80 #define RTT_DEV NRF_RTC1
81 #define RTT_IRQ RTC1_IRQn
82 #define RTT_ISR isr_rtc1
83 #define RTT_MAX_VALUE (0xffffff)
84 #define RTT_FREQUENCY (10) /* in Hz */
85 #define RTT_PRESCALER (3275U) /* run with 10 Hz */
86 
92 #define UART_NUMOF (1U)
93 /* UART pin configuration */
94 #define UART_HWFLOWCTRL 0
95 #define UART_PIN_RX 25
96 #define UART_PIN_TX 24
97 
103 static const i2c_conf_t i2c_config[] = {
104  {
105  .dev = NRF_TWI0,
106  .pin_scl = 0,
107  .pin_sda = 30,
108  .ppi = 0
109  }
110 };
111 
112 #define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
113 
121 #define ADC_NUMOF (0)
122 
131 #define RADIO_IRQ_PRIO 1
132 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif /* PERIPH_CONF_H */
139 
I2C configuration options.
NRF_TWI_Type * dev
hardware device
cc2538_gptimer_t * dev
timer device
Timer configuration data.