periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  * Copyright (C) 2018 HAW Hamburg
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
22 #ifndef PERIPH_CONF_H
23 #define PERIPH_CONF_H
24 
25 #include "cc2538_gpio.h"
26 #include "periph_cpu.h"
27 
28 #include "cfg_clk_default.h"
29 #include "cfg_timer_default.h"
30 
31 #ifdef __cplusplus
32  extern "C" {
33 #endif
34 
39 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
40 
41 static const adc_conf_t adc_config[] = {
42  GPIO_PIN(1, 0),
43  GPIO_PIN(1, 1),
44  GPIO_PIN(1, 2),
45  GPIO_PIN(1, 3),
46  GPIO_PIN(2, 3),
47  GPIO_PIN(0, 7),
49 };
50 
51 #define ADC_NUMOF ARRAY_SIZE(adc_config)
52 
58 static const uart_conf_t uart_config[] = {
59  {
61  .rx_pin = GPIO_PIN(0, 0),
62  .tx_pin = GPIO_PIN(0, 1),
63 #ifdef MODULE_PERIPH_UART_HW_FC
64  .cts_pin = GPIO_UNDEF,
65  .rts_pin = GPIO_UNDEF
66 #endif
67  }
68 };
69 
70 /* interrupt function name mapping */
71 #define UART_0_ISR isr_uart0
72 
73 /* macros common across all UARTs */
74 #define UART_NUMOF ARRAY_SIZE(uart_config)
75 
81 #define I2C_IRQ_PRIO 1
82 
83 static const i2c_conf_t i2c_config[] = {
84  {
86  .scl_pin = GPIO_PIN(1, 5), /* SI7006 Temp/RH sensor */
87  .sda_pin = GPIO_PIN(1, 4) /* SI7006 Temp/RH sensor */
88  },
89 };
90 
91 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
92 
98 static const spi_conf_t spi_config[] = {
99  {
100  .num = 0,
101  .mosi_pin = GPIO_PIN(0, 5),
102  .miso_pin = GPIO_PIN(0, 4),
103  .sck_pin = GPIO_PIN(0, 2),
104  .cs_pin = GPIO_PIN(0, 3)
105  },
106 };
107 
108 #define SPI_NUMOF ARRAY_SIZE(spi_config)
109 
111 #ifdef __cplusplus
112 } /* end extern "C" */
113 #endif
114 
115 #endif /* PERIPH_CONF_H */
116 
cc2538_gpio.h
Driver for the cc2538 GPIO controller.
UART0_BASEADDR
#define UART0_BASEADDR
UART0 Instance.
Definition: cc2538_uart.h:183
GPIO_UNDEF
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
Definition: periph_cpu_common.h:52
uart_conf_t
UART device configuration.
Definition: periph_cpu.h:166
spi_conf_t::num
uint8_t num
number of SSI device, i.e.
Definition: periph_cpu.h:274
uart_conf_t::dev
cc2538_uart_t * dev
pointer to the used UART device
Definition: periph_cpu.h:167
adc_conf_t
ADC device configuration.
Definition: periph_cpu.h:74
GPIO_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
i2c_conf_t::speed
i2c_speed_t speed
baudrate used for the bus
Definition: periph_cpu.h:129
cfg_clk_default.h
Default clock configuration for cc2538 based boards.
i2c_conf_t
I2C configuration options.
Definition: periph_cpu.h:128
I2C_SPEED_FAST
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: i2c.h:178
spi_conf_t
SPI configuration structure type.
Definition: periph_cpu.h:273