The friendly Operating System for the Internet of Things
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 
33 static const timer_conf_t timer_config[] = {
34  {
35  .dev = GPTIMER0,
36  .channels = 2,
37  .cfg = GPTMCFG_16_BIT_TIMER, /* required for XTIMER */
38  },
39  {
40  .dev = GPTIMER1,
41  .channels = 1,
42  .cfg = GPTMCFG_32_BIT_TIMER,
43  },
44  {
45  .dev = GPTIMER2,
46  .channels = 1,
47  .cfg = GPTMCFG_32_BIT_TIMER,
48  },
49  {
50  .dev = GPTIMER3,
51  .channels = 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 #define UART_NUMOF 1
66 
67 #define UART_0_EN 1
68 #define UART_1_EN 0
69 #define UART_2_EN 0
70 #define UART_3_EN 0
71 
72 #define UART_IRQ_PRIO 1
73 
74 /* UART 0 device configuration */
75 #define UART_0_DEV UART0
76 #define UART_0_IRQ UART0_IRQn
77 #define UART_0_ISR isr_uart0
78 /* UART 0 pin configuration */
79 #define UART_0_TX_PIN GPIO_PA1
80 #define UART_0_RX_PIN GPIO_PA0
81 #define UART_0_RTS_PIN GPIO_PD3
82 #define UART_0_CTS_PIN GPIO_PB0
83 
84 /* UART 1 device configuration */
85 #define UART_1_DEV UART1
86 #define UART_1_IRQ UART1_IRQn
87 #define UART_1_ISR isr_uart1
88 /* UART 1 pin configuration */
95 #define I2C_NUMOF 1
96 #define I2C_0_EN 1
97 #define I2C_IRQ_PRIO 1
98 
99 /* I2C 0 device configuration */
100 #define I2C_0_DEV 0
101 #define I2C_0_IRQ I2C_IRQn
102 #define I2C_0_IRQ_HANDLER isr_i2c
103 #define I2C_0_SCL_PIN GPIO_PA2 /* SPI_SCK on the SmartRF06 baseboard */
104 #define I2C_0_SDA_PIN GPIO_PA4 /* SPI_MOSI on the SmartRF06 baseboard */
105 
106 static const i2c_conf_t i2c_config[I2C_NUMOF] = {
107  {
108  .scl_pin = GPIO_PA2, /* SPI_SCK on the SmartRF06 baseboard */
109  .sda_pin = GPIO_PA4, /* SPI_MOSI on the SmartRF06 baseboard */
110  },
111 };
121 static const spi_clk_conf_t spi_clk_config[] = {
122  { .cpsr = 10, .scr = 31 }, /* 100khz */
123  { .cpsr = 2, .scr = 39 }, /* 400khz */
124  { .cpsr = 2, .scr = 15 }, /* 1MHz */
125  { .cpsr = 2, .scr = 2 }, /* ~4.5MHz */
126  { .cpsr = 2, .scr = 1 } /* ~10.7MHz */
127 };
128 
133 static const spi_conf_t spi_config[] = {
134  {
135  .dev = SSI0,
136  .mosi_pin = GPIO_PA4,
137  .miso_pin = GPIO_PA5,
138  .sck_pin = GPIO_PA2,
139  .cs_pin = GPIO_PD0
140  }
141 };
142 
143 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
144 
150 #define RADIO_IRQ_PRIO 1
151 
153 #ifdef __cplusplus
154 } /* end extern "C" */
155 #endif
156 
157 #endif /* PERIPH_CONF_H */
158 
#define GPTIMER2
GPTIMER2 Instance.
I2C configuration options.
PD0.
Definition: cc2538_gpio.h:181
gpio_t scl_pin
pin used for SCL
#define GPTIMER1
GPTIMER1 Instance.
PA5.
Definition: cc2538_gpio.h:162
#define GPTIMER0
GPTIMER0 Instance.
Datafields for static SPI clock configuration values.
static const spi_clk_conf_t spi_clk_config[]
Pre-calculated clock divider values based on a CLOCK_CORECLOCK (32MHz)
PA4.
Definition: cc2538_gpio.h:161
16-bit timer configuration
32-bit timer configuration
#define GPTIMER3
GPTIMER3 Instance.
PA2.
Definition: cc2538_gpio.h:159
SPI configuration data structure.
cc2538_gptimer_t * dev
timer device
uint8_t cpsr
CPSR clock divider.
Timer configuration data.
#define SSI0
SSI0 Instance.
Definition: cc2538_ssi.h:77
cc2538_ssi_t * dev
SSI device.