The friendly Operating System for the Internet of Things
boards/yunjia-nrf51822/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * 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  /* dev, channels, width */
47  { NRF_TIMER0, 3, TIMER_BITMODE_BITMODE_24Bit, TIMER0_IRQn }
48 };
49 
50 #define TIMER_0_ISR isr_timer0
51 
52 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
53 
59 #define UART_NUMOF (1U)
60 /* UART pin configuration */
61 #define UART_PIN_RX 1
62 #define UART_PIN_TX 2
63 
69 #define RTT_NUMOF (1U)
70 #define RTT_IRQ_PRIO 1
71 
72 #define RTT_DEV NRF_RTC1
73 #define RTT_IRQ RTC1_IRQn
74 #define RTT_ISR isr_rtc1
75 #define RTT_MAX_VALUE (0xffffff)
76 #define RTT_FREQUENCY (10) /* in Hz */
77 #define RTT_PRESCALER (3275U) /* run with 10 Hz */
78 
84 static const spi_conf_t spi_config[] = {
85  {
86  .dev = NRF_SPI0,
87  .sclk = 19,
88  .mosi = 17,
89  .miso = 18
90  },
91  {
92  .dev = NRF_SPI1,
93  .sclk = 22,
94  .mosi = 20,
95  .miso = 21
96  }
97 };
98 
99 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
100 
106 static const i2c_conf_t i2c_config[] = {
107  {
108  .dev = NRF_TWI0,
109  .pin_scl = 23,
110  .pin_sda = 24,
111  .ppi = 0
112  }
113 };
114 
115 #define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
116 
124 #define ADC_CONFIG {4, 5, 6, 7}
125 #define ADC_NUMOF (4)
126 
135 #define RADIO_IRQ_PRIO 1
136 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #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.