boards/openmote-cc2538/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 
20 #ifndef PERIPH_CONF_H
21 #define PERIPH_CONF_H
22 
23 #include "cc2538_gpio.h"
24 #include "periph_cpu.h"
25 
26 #ifdef __cplusplus
27  extern "C" {
28 #endif
29 
34 #define CLOCK_CORECLOCK (32000000U) /* desired core clock frequency, 32MHz */
35 
45 static const timer_conf_t timer_config[] = {
46  {
47  .chn = 2,
48  .cfg = GPTMCFG_16_BIT_TIMER, /* required for XTIMER */
49  },
50  {
51  .chn = 1,
52  .cfg = GPTMCFG_32_BIT_TIMER,
53  },
54  {
55  .chn = 2,
56  .cfg = GPTMCFG_16_BIT_TIMER,
57  },
58  {
59  .chn = 1,
60  .cfg = GPTMCFG_32_BIT_TIMER,
61  },
62 };
63 
64 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
65 #define TIMER_IRQ_PRIO 1
66 
72 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
73 
74 static const adc_conf_t adc_config[] = {
75  GPIO_PIN(0, 2),
76  GPIO_PIN(0, 3),
77  GPIO_PIN(0, 4),
78  GPIO_PIN(0, 5),
79  GPIO_PIN(0, 6),
80 };
81 
82 #define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
83 
89 static const uart_conf_t uart_config[] = {
90  {
92  .rx_pin = GPIO_PIN(0, 0),
93  .tx_pin = GPIO_PIN(0, 1),
94  .cts_pin = GPIO_UNDEF,
95  .rts_pin = GPIO_UNDEF
96  }
97 };
98 
99 /* interrupt function name mapping */
100 #define UART_0_ISR isr_uart0
101 
102 /* macros common across all UARTs */
103 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
104 
110 #define I2C_IRQ_PRIO 1
111 
112 static const i2c_conf_t i2c_config[] = {
113  {
114  .speed = I2C_SPEED_FAST,
115  .scl_pin = GPIO_PIN(1, 3),
116  .sda_pin = GPIO_PIN(1, 4)
117  },
118 };
119 
120 #define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
121 
127 static const spi_conf_t spi_config[] = {
128  {
129  .num = 0,
130  .mosi_pin = GPIO_PIN(0, 5),
131  .miso_pin = GPIO_PIN(0, 4),
132  .sck_pin = GPIO_PIN(0, 2),
133  .cs_pin = GPIO_PIN(0, 3)
134  },
135 };
136 
137 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
138 
144 #define RADIO_IRQ_PRIO 1
145 
147 #ifdef __cplusplus
148 } /* end extern "C" */
149 #endif
150 
151 #endif /* PERIPH_CONF_H */
152 
fast mode: ~400kbit/s
cc2538_uart_t * dev
pointer to the used UART device
I2C configuration options.
uint8_t num
number of SSI device, i.e.
16-bit timer configuration
#define UART0_BASEADDR
UART0 Instance.
Definition: cc2538_uart.h:183
uint_fast8_t chn
number of channels
i2c_speed_t speed
baudrate used for the bus
32-bit timer configuration
UART device configuration.
Driver for the cc2538 GPIO controller.
SPI module configuration options.
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
ADC device configuration.
Timer configuration.