The friendly Operating System for the Internet of Things
boards/airfy-beacon/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Christian Mehlis <mehlis@inf.fu-berlin.de>
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_CORECLOCK (16000000U) /* fixed for all NRF51822 */
37 #define CLOCK_CRYSTAL (16U) /* set to 0: internal RC oscillator
38  16: 16MHz crystal
39  32: 32MHz crystal */
40 
46 static const timer_conf_t timer_config[] = {
47  /* dev, channels, width */
48  { NRF_TIMER0, 3, TIMER_BITMODE_BITMODE_24Bit, TIMER0_IRQn }
49 };
50 
51 #define TIMER_0_ISR isr_timer0
52 
53 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
54 
62 #define UART_NUMOF (1U)
63 #define UART_PIN_RX 17
64 #define UART_PIN_TX 18
65 
71 #define RTT_NUMOF (1U)
72 #define RTT_IRQ_PRIO 1
73 
74 #define RTT_DEV NRF_RTC1
75 #define RTT_IRQ RTC1_IRQn
76 #define RTT_ISR isr_rtc1
77 #define RTT_MAX_VALUE (0xffffff)
78 #define RTT_FREQUENCY (10) /* in Hz */
79 #define RTT_PRESCALER (3275U) /* run with 10 Hz */
80 
86 static const spi_conf_t spi_config[] = {
87  {
88  .dev = NRF_SPI0,
89  .sclk = 15,
90  .mosi = 13,
91  .miso = 14
92  }
93 };
94 
95 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
96 
102 static const i2c_conf_t i2c_config[] = {
103  {
104  .dev = NRF_TWI0,
105  .pin_scl = 7,
106  .pin_sda = 8,
107  .ppi = 0
108  },
109  {
110  .dev = NRF_TWI1,
111  .pin_scl = 9,
112  .pin_sda = 10,
113  .ppi = 1
114  }
115 };
116 
117 #define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
118 
126 #define ADC_CONFIG {3, 4, 5, 6}
127 #define ADC_NUMOF (4)
128 
137 #define RADIO_IRQ_PRIO 1
138 
140 #ifdef __cplusplus
141 } /* end extern "C" */
142 #endif
143 
144 #endif /* PERIPH_CONF_H */
I2C configuration options.
NRF_TWI_Type * dev
hardware device
SPI configuration data structure.
Timer configuration data.
cc2538_ssi_t * dev
SSI device.