boards/cc2538dk/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Loci Controls Inc.
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 "cpu.h"
23 #include "periph_cpu.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
37 static const timer_conf_t timer_config[] = {
38  {
39  .chn = 2,
40  .cfg = GPTMCFG_16_BIT_TIMER, /* required for XTIMER */
41  },
42  {
43  .chn = 1,
44  .cfg = GPTMCFG_32_BIT_TIMER,
45  },
46  {
47  .chn = 2,
48  .cfg = GPTMCFG_16_BIT_TIMER,
49  },
50  {
51  .chn = 1,
52  .cfg = GPTMCFG_32_BIT_TIMER,
53  },
54 };
55 
56 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
57 
58 #define TIMER_IRQ_PRIO 1
59 
65 static const uart_conf_t uart_config[] = {
66  {
68  .rx_pin = GPIO_PIN(0, 0),
69  .tx_pin = GPIO_PIN(0, 1),
70  .cts_pin = GPIO_UNDEF,
71  .rts_pin = GPIO_UNDEF
72  }
73 };
74 
75 /* interrupt function name mapping */
76 #define UART_0_ISR isr_uart0
77 
78 /* macros common across all UARTs */
79 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
80 
87 #define I2C_NUMOF 1
88 #define I2C_0_EN 1
89 #define I2C_IRQ_PRIO 1
90 
91 /* I2C 0 device configuration */
92 #define I2C_0_DEV 0
93 #define I2C_0_IRQ I2C_IRQn
94 #define I2C_0_IRQ_HANDLER isr_i2c
95 #define I2C_0_SCL_PIN GPIO_PA2 /* SPI_SCK on the SmartRF06 baseboard */
96 #define I2C_0_SDA_PIN GPIO_PA4 /* SPI_MOSI on the SmartRF06 baseboard */
97 
98 static const i2c_conf_t i2c_config[I2C_NUMOF] = {
99  {
100  .scl_pin = GPIO_PA2, /* SPI_SCK on the SmartRF06 baseboard */
101  .sda_pin = GPIO_PA4, /* SPI_MOSI on the SmartRF06 baseboard */
102  },
103 };
113 static const spi_clk_conf_t spi_clk_config[] = {
114  { .cpsr = 10, .scr = 31 }, /* 100khz */
115  { .cpsr = 2, .scr = 39 }, /* 400khz */
116  { .cpsr = 2, .scr = 15 }, /* 1MHz */
117  { .cpsr = 2, .scr = 2 }, /* ~4.5MHz */
118  { .cpsr = 2, .scr = 1 } /* ~10.7MHz */
119 };
120 
125 static const spi_conf_t spi_config[] = {
126  {
127  .dev = SSI0,
128  .mosi_pin = GPIO_PA4,
129  .miso_pin = GPIO_PA5,
130  .sck_pin = GPIO_PA2,
131  .cs_pin = GPIO_PD0
132  }
133 };
134 
135 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
136 
142 #define SOC_ADC_ADCCON_REF SOC_ADC_ADCCON_REF_AVDD5
143 
144 static const adc_conf_t adc_config[] = {
145  GPIO_PIN(0, 6),
146 };
147 
148 #define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
149 
155 #define RADIO_IRQ_PRIO 1
156 
158 #ifdef __cplusplus
159 } /* end extern "C" */
160 #endif
161 
162 #endif /* PERIPH_CONF_H */
163 
PA4.
Definition: cc2538_gpio.h:150
cc2538_uart_t * dev
pointer to the used UART device
I2C configuration options.
gpio_t scl_pin
pin used for SCL
16-bit timer configuration
PA2.
Definition: cc2538_gpio.h:148
#define UART0_BASEADDR
UART0 Instance.
Definition: cc2538_uart.h:183
Datafields for static SPI clock configuration values.
uint_fast8_t chn
number of channels
32-bit timer configuration
static const spi_clk_conf_t spi_clk_config[]
Pre-calculated clock divider values based on a CLOCK_CORECLOCK (32MHz)
UART device configuration.
PD0.
Definition: cc2538_gpio.h:170
SPI module configuration options.
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
uint8_t cpsr
CPSR clock divider.
ADC device configuration.
Timer configuration.
#define SSI0
SSI0 Instance.
Definition: cc2538_ssi.h:77
PA5.
Definition: cc2538_gpio.h:151
cc2538_ssi_t * dev
SSI device.