periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2014 Freie Universität Berlin
3  * SPDX-FileCopyrightText: 2018 HAW Hamburg
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
21 #include "cc2538_gpio.h"
22 #include "periph_cpu.h"
23 
24 #include "cfg_clk_default.h"
25 #include "cfg_timer_default.h"
26 
27 #ifdef __cplusplus
28  extern "C" {
29 #endif
30 
35 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
36 
37 static const adc_conf_t adc_config[] = {
38  GPIO_PIN(1, 0),
39  GPIO_PIN(1, 1),
40  GPIO_PIN(1, 2),
41  GPIO_PIN(1, 3),
42  GPIO_PIN(2, 3),
43  GPIO_PIN(0, 7),
45 };
46 
47 #define ADC_NUMOF ARRAY_SIZE(adc_config)
54 static const uart_conf_t uart_config[] = {
55  {
57  .rx_pin = GPIO_PIN(0, 0),
58  .tx_pin = GPIO_PIN(0, 1),
59 #ifdef MODULE_PERIPH_UART_HW_FC
60  .cts_pin = GPIO_UNDEF,
61  .rts_pin = GPIO_UNDEF
62 #endif
63  }
64 };
65 
66 /* interrupt function name mapping */
67 #define UART_0_ISR isr_uart0
68 
69 /* macros common across all UARTs */
70 #define UART_NUMOF ARRAY_SIZE(uart_config)
77 #define I2C_IRQ_PRIO 1
78 
79 static const i2c_conf_t i2c_config[] = {
80  {
82  .scl_pin = GPIO_PIN(1, 5), /* SI7006 Temp/RH sensor */
83  .sda_pin = GPIO_PIN(1, 4) /* SI7006 Temp/RH sensor */
84  },
85 };
86 
87 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
94 static const spi_conf_t spi_config[] = {
95  {
96  .num = 0,
97  .mosi_pin = GPIO_PIN(0, 5),
98  .miso_pin = GPIO_PIN(0, 4),
99  .sck_pin = GPIO_PIN(0, 2),
100  .cs_pin = GPIO_PIN(0, 3)
101  },
102 };
103 
104 #define SPI_NUMOF ARRAY_SIZE(spi_config)
107 #ifdef __cplusplus
108 } /* end extern "C" */
109 #endif
110 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:42
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:35
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:93
static const i2c_conf_t i2c_config[]
I2C configuration.
Definition: periph_conf.h:65
static const adc_conf_t adc_config[]
ADC configuration.
Definition: periph_conf.h:247
Driver for the cc2538 GPIO controller.
Default clock configuration for cc2538 based boards.
#define UART0_BASEADDR
UART0 Instance.
Definition: cc2538_uart.h:179
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: periph_cpu.h:275
ADC device configuration.
Definition: periph_cpu.h:374
I2C configuration structure.
Definition: periph_cpu.h:295
i2c_speed_t speed
Configured bus speed, actual speed may be lower but never higher.
Definition: periph_cpu.h:300
SPI device configuration.
Definition: periph_cpu.h:333
uint8_t num
number of SSI device, i.e.
Definition: periph_cpu.h:292
UART device configuration.
Definition: periph_cpu.h:214
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:215