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 
10 #pragma once
11 
24 #include "cc2538_gpio.h"
25 #include "periph_cpu.h"
26 
27 #include "cfg_clk_default.h"
28 #include "cfg_timer_default.h"
29 
30 #ifdef __cplusplus
31  extern "C" {
32 #endif
33 
38 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
39 
40 static const adc_conf_t adc_config[] = {
41  GPIO_PIN(1, 0),
42  GPIO_PIN(1, 1),
43  GPIO_PIN(1, 2),
44  GPIO_PIN(1, 3),
45  GPIO_PIN(2, 3),
46  GPIO_PIN(0, 7),
48 };
49 
50 #define ADC_NUMOF ARRAY_SIZE(adc_config)
57 static const uart_conf_t uart_config[] = {
58  {
60  .rx_pin = GPIO_PIN(0, 0),
61  .tx_pin = GPIO_PIN(0, 1),
62 #ifdef MODULE_PERIPH_UART_HW_FC
63  .cts_pin = GPIO_UNDEF,
64  .rts_pin = GPIO_UNDEF
65 #endif
66  }
67 };
68 
69 /* interrupt function name mapping */
70 #define UART_0_ISR isr_uart0
71 
72 /* macros common across all UARTs */
73 #define UART_NUMOF ARRAY_SIZE(uart_config)
80 #define I2C_IRQ_PRIO 1
81 
82 static const i2c_conf_t i2c_config[] = {
83  {
85  .scl_pin = GPIO_PIN(1, 5), /* SI7006 Temp/RH sensor */
86  .sda_pin = GPIO_PIN(1, 4) /* SI7006 Temp/RH sensor */
87  },
88 };
89 
90 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
97 static const spi_conf_t spi_config[] = {
98  {
99  .num = 0,
100  .mosi_pin = GPIO_PIN(0, 5),
101  .miso_pin = GPIO_PIN(0, 4),
102  .sck_pin = GPIO_PIN(0, 2),
103  .cs_pin = GPIO_PIN(0, 3)
104  },
105 };
106 
107 #define SPI_NUMOF ARRAY_SIZE(spi_config)
110 #ifdef __cplusplus
111 } /* end extern "C" */
112 #endif
113 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:45
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:38
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:96
static const i2c_conf_t i2c_config[]
I2C configuration.
Definition: periph_conf.h:68
static const adc_conf_t adc_config[]
ADC configuration.
Definition: periph_conf.h:250
Driver for the cc2538 GPIO controller.
Default clock configuration for cc2538 based boards.
#define UART0_BASEADDR
UART0 Instance.
Definition: cc2538_uart.h:182
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition: periph_cpu.h:278
ADC device configuration.
Definition: periph_cpu.h:377
I2C configuration structure.
Definition: periph_cpu.h:298
i2c_speed_t speed
Configured bus speed, actual speed may be lower but never higher.
Definition: periph_cpu.h:303
SPI device configuration.
Definition: periph_cpu.h:336
uint8_t num
number of SSI device, i.e.
Definition: periph_cpu.h:295
UART device configuration.
Definition: periph_cpu.h:217
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:218