Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "cc2538_gpio.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#define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
34
35static const adc_conf_t adc_config[] = {
36 GPIO_PIN(0, 2),
37 GPIO_PIN(0, 3),
38 GPIO_PIN(0, 4),
39 GPIO_PIN(0, 5),
40 GPIO_PIN(0, 6),
41};
42
43#define ADC_NUMOF ARRAY_SIZE(adc_config)
45
50static const uart_conf_t uart_config[] = {
51 {
52 .dev = UART0_BASEADDR,
53 .rx_pin = GPIO_PIN(0, 0),
54 .tx_pin = GPIO_PIN(0, 1),
55#ifdef MODULE_PERIPH_UART_HW_FC
56 .cts_pin = GPIO_UNDEF,
57 .rts_pin = GPIO_UNDEF
58#endif
59 }
60};
61
62/* interrupt function name mapping */
63#define UART_0_ISR isr_uart0
64
65/* macros common across all UARTs */
66#define UART_NUMOF ARRAY_SIZE(uart_config)
68
73#define I2C_IRQ_PRIO 1
74
75static const i2c_conf_t i2c_config[] = {
76 {
77 .speed = I2C_SPEED_FAST,
78 .scl_pin = GPIO_PIN(1, 3),
79 .sda_pin = GPIO_PIN(1, 4)
80 },
81};
82
83#define I2C_NUMOF ARRAY_SIZE(i2c_config)
85
90static const spi_conf_t spi_config[] = {
91 {
92 .num = 0,
93 .mosi_pin = GPIO_PIN(0, 5),
94 .miso_pin = GPIO_PIN(0, 4),
95 .sck_pin = GPIO_PIN(0, 2),
96 .cs_pin = GPIO_PIN(0, 3)
97 },
98};
99
100#define SPI_NUMOF ARRAY_SIZE(spi_config)
102
103#ifdef __cplusplus
104} /* end extern "C" */
105#endif
106
#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.
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:278
Driver for the cc2538 GPIO controller.
Default clock configuration for cc2538 based boards.
#define UART0_BASEADDR
UART0 Instance.
ADC device configuration.
Definition periph_cpu.h:377
I2C configuration structure.
Definition periph_cpu.h:298
SPI device configuration.
Definition periph_cpu.h:336
UART device configuration.
Definition periph_cpu.h:217