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_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  /* dev, channels, width */
49  { NRF_TIMER0, 3, TIMER_BITMODE_BITMODE_24Bit, TIMER0_IRQn }
50 };
51 
52 #define TIMER_0_ISR isr_timer0
53 
54 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
55 
61 #define UART_NUMOF (1U)
62 /* UART pin configuration */
63 #define UART_PIN_RX 1
64 #define UART_PIN_TX 2
65 
71 #define RTT_NUMOF (1U)
72 #define RTT_DEV (1) /* NRF_RTC1 */
73 #define RTT_MAX_VALUE (0x00ffffff)
74 #define RTT_FREQUENCY (1024)
75 
81 static const spi_conf_t spi_config[] = {
82  {
83  .dev = NRF_SPI0,
84  .sclk = 19,
85  .mosi = 17,
86  .miso = 18
87  },
88  {
89  .dev = NRF_SPI1,
90  .sclk = 22,
91  .mosi = 20,
92  .miso = 21
93  }
94 };
95 
96 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
97 
103 static const i2c_conf_t i2c_config[] = {
104  {
105  .dev = NRF_TWI0,
106  .pin_scl = 23,
107  .pin_sda = 24,
108  .ppi = 0
109  }
110 };
111 
112 #define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
113 
121 #define ADC_CONFIG {4, 5, 6, 7}
122 #define ADC_NUMOF (4)
123 
132 #define RADIO_IRQ_PRIO 1
133 
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #endif /* PERIPH_CONF_H */
I2C configuration options.
NRF_TWI_Type * dev
hardware device
SPI module configuration options.
Timer configuration.
cc2538_ssi_t * dev
SSI device.