periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  * Copyright (C) 2017 HAW Hamburg
4  * 2020 Oppila Microsystems - http://www.oppila.in
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser General
7  * Public License v2.1. See the file LICENSE in the top level directory for more
8  * details.
9  */
10 
11 #pragma once
12 
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(PORT_A, 5),
40  GPIO_PIN(PORT_A, 4),
41  GPIO_PIN(PORT_A, 2),
42  GPIO_PIN(PORT_A, 6),
43  GPIO_PIN(PORT_A, 7),
44 };
45 
46 #define ADC_NUMOF ARRAY_SIZE(adc_config)
52 #define I2C_IRQ_PRIO 1
53 
54 static const i2c_conf_t i2c_config[] = {
55  {
57  .scl_pin = GPIO_PIN(PORT_C, 3),
58  .sda_pin = GPIO_PIN(PORT_C, 2)
59  },
60 };
61 
62 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
68 static const spi_conf_t spi_config[] = {
69  {
70  .num = 0,
71  .mosi_pin = GPIO_PIN(PORT_C, 5),
72  .miso_pin = GPIO_PIN(PORT_C, 6),
73  .sck_pin = GPIO_PIN(PORT_C, 4),
74  .cs_pin = GPIO_PIN(PORT_A, 7)
75  }
76 };
77 
78 #define SPI_NUMOF ARRAY_SIZE(spi_config)
84 static const uart_conf_t uart_config[] = {
85  /* UART0 is mapped to debug usb */
86  {
88  .rx_pin = GPIO_PIN(PORT_A, 0),
89  .tx_pin = GPIO_PIN(PORT_A, 1),
90 #ifdef MODULE_PERIPH_UART_HW_FC
91  .cts_pin = GPIO_UNDEF,
92  .rts_pin = GPIO_UNDEF
93 #endif
94  },
95  {
96  .dev = UART1_BASEADDR,
97  .rx_pin = GPIO_PIN(PORT_C, 1),
98  .tx_pin = GPIO_PIN(PORT_C, 0),
99 #ifdef MODULE_PERIPH_UART_HW_FC
100  .cts_pin = GPIO_UNDEF,
101  .rts_pin = GPIO_UNDEF
102 #endif
103  }
104 };
105 /* interrupt function name mapping */
106 #define UART_0_ISR isr_uart0
107 #define UART_1_ISR isr_uart1
108 
109 /* macros common across all UARTs */
110 #define UART_NUMOF ARRAY_SIZE(uart_config)
113 #ifdef __cplusplus
114 } /* end extern "C" */
115 #endif
116 
@ PORT_C
port C
Definition: periph_cpu.h:48
@ PORT_A
port A
Definition: periph_cpu.h:46
#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 UART1_BASEADDR
UART1 Instance.
Definition: cc2538_uart.h:183
#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