periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2024 Marian Buschsieweke
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #include "cpu.h"
20 #include "periph_cpu.h"
21 
22 #include "cfg_clk_default.h"
23 #include "cfg_timer_default.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 static const uart_conf_t uart_config[] = {
34  {
36  .rx_pin = GPIO_PIN(PORT_A, 0),
37  .tx_pin = GPIO_PIN(PORT_A, 1),
38 #ifdef MODULE_PERIPH_UART_HW_FC
39  .cts_pin = GPIO_UNDEF,
40  .rts_pin = GPIO_UNDEF
41 #endif
42  }
43 };
44 
45 #define UART_0_ISR isr_uart0
47 #define UART_NUMOF ARRAY_SIZE(uart_config)
55 #define I2C_IRQ_PRIO 1
56 
57 static const i2c_conf_t i2c_config[] = {
58  {
60  .scl_pin = GPIO_PIN(PORT_A, 2),
61  .sda_pin = GPIO_PIN(PORT_A, 4)
62  },
63 };
64 
65 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
72 static const spi_conf_t spi_config[] = {
73  {
74  .num = 0,
75  .mosi_pin = GPIO_PIN(PORT_A, 4),
76  .miso_pin = GPIO_PIN(PORT_A, 5),
77  .sck_pin = GPIO_PIN(PORT_A, 2),
78  .cs_pin = GPIO_PIN(PORT_D, 0)
79  }
80 };
81 
82 #define SPI_NUMOF ARRAY_SIZE(spi_config)
89 #define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
90 
91 static const adc_conf_t adc_config[] = {
92  GPIO_PIN(PORT_A, 6),
93 };
94 
95 #define ADC_NUMOF ARRAY_SIZE(adc_config)
98 #ifdef __cplusplus
99 } /* end extern "C" */
100 #endif
101 
@ PORT_A
port A
Definition: periph_cpu.h:43
@ PORT_D
port D
Definition: periph_cpu.h:46
#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
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