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 
9 #pragma once
10 
22 #include "cc2538_gpio.h"
23 #include "periph_cpu.h"
24 
25 #include "cfg_clk_default.h"
26 #include "cfg_timer_default.h"
27 
28 #ifdef __cplusplus
29  extern "C" {
30 #endif
31 
36 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
37 
38 static const adc_conf_t adc_config[] = {
39  GPIO_PIN(0, 2),
40  GPIO_PIN(0, 3),
41  GPIO_PIN(0, 4),
42  GPIO_PIN(0, 5),
43  GPIO_PIN(0, 6),
44 };
45 
46 #define ADC_NUMOF ARRAY_SIZE(adc_config)
53 static const uart_conf_t uart_config[] = {
54  {
56  .rx_pin = GPIO_PIN(0, 0),
57  .tx_pin = GPIO_PIN(0, 1),
58 #ifdef MODULE_PERIPH_UART_HW_FC
59  .cts_pin = GPIO_UNDEF,
60  .rts_pin = GPIO_UNDEF
61 #endif
62  }
63 };
64 
65 /* interrupt function name mapping */
66 #define UART_0_ISR isr_uart0
67 
68 /* macros common across all UARTs */
69 #define UART_NUMOF ARRAY_SIZE(uart_config)
76 #define I2C_IRQ_PRIO 1
77 
78 static const i2c_conf_t i2c_config[] = {
79  {
81  .scl_pin = GPIO_PIN(1, 3),
82  .sda_pin = GPIO_PIN(1, 4)
83  },
84 };
85 
86 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
93 static const spi_conf_t spi_config[] = {
94  {
95  .num = 0,
96  .mosi_pin = GPIO_PIN(0, 5),
97  .miso_pin = GPIO_PIN(0, 4),
98  .sck_pin = GPIO_PIN(0, 2),
99  .cs_pin = GPIO_PIN(0, 3)
100  },
101 };
102 
103 #define SPI_NUMOF ARRAY_SIZE(spi_config)
106 #ifdef __cplusplus
107 } /* end extern "C" */
108 #endif
109 
#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