Loading...
Searching...
No Matches
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
20#ifndef PERIPH_CONF_H
21#define PERIPH_CONF_H
22
23#include "cc2538_gpio.h"
24#include "periph_cpu.h"
25
26#include "cfg_clk_default.h"
27#include "cfg_timer_default.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
37#define SOC_ADC_ADCCON3_EREF SOC_ADC_ADCCON3_EREF_AVDD5
38
39static const adc_conf_t adc_config[] = {
40 GPIO_PIN(PORT_A, 5),
41 GPIO_PIN(PORT_A, 4),
42 GPIO_PIN(PORT_A, 2),
43 GPIO_PIN(PORT_A, 6),
44 GPIO_PIN(PORT_A, 7),
45};
46
47#define ADC_NUMOF ARRAY_SIZE(adc_config)
53#define I2C_IRQ_PRIO 1
54
55static const i2c_conf_t i2c_config[] = {
56 {
58 .scl_pin = GPIO_PIN(PORT_C, 3),
59 .sda_pin = GPIO_PIN(PORT_C, 2)
60 },
61};
62
63#define I2C_NUMOF ARRAY_SIZE(i2c_config)
69static const spi_conf_t spi_config[] = {
70 {
71 .num = 0,
72 .mosi_pin = GPIO_PIN(PORT_C, 5),
73 .miso_pin = GPIO_PIN(PORT_C, 6),
74 .sck_pin = GPIO_PIN(PORT_C, 4),
75 .cs_pin = GPIO_PIN(PORT_A, 7)
76 }
77};
78
79#define SPI_NUMOF ARRAY_SIZE(spi_config)
85static const uart_conf_t uart_config[] = {
86 /* UART0 is mapped to debug usb */
87 {
89 .rx_pin = GPIO_PIN(PORT_A, 0),
90 .tx_pin = GPIO_PIN(PORT_A, 1),
91#ifdef MODULE_PERIPH_UART_HW_FC
92 .cts_pin = GPIO_UNDEF,
93 .rts_pin = GPIO_UNDEF
94#endif
95 },
96 {
97 .dev = UART1_BASEADDR,
98 .rx_pin = GPIO_PIN(PORT_C, 1),
99 .tx_pin = GPIO_PIN(PORT_C, 0),
100#ifdef MODULE_PERIPH_UART_HW_FC
101 .cts_pin = GPIO_UNDEF,
102 .rts_pin = GPIO_UNDEF
103#endif
104 }
105};
106/* interrupt function name mapping */
107#define UART_0_ISR isr_uart0
108#define UART_1_ISR isr_uart1
109
110/* macros common across all UARTs */
111#define UART_NUMOF ARRAY_SIZE(uart_config)
114#ifdef __cplusplus
115} /* end extern "C" */
116#endif
117
118#endif /* PERIPH_CONF_H */
@ PORT_C
port C
Definition periph_cpu.h:49
@ PORT_A
port A
Definition periph_cpu.h:47
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:279
Driver for the cc2538 GPIO controller.
Default clock configuration for cc2538 based boards.
#define UART1_BASEADDR
UART1 Instance.
#define UART0_BASEADDR
UART0 Instance.
ADC device configuration.
Definition periph_cpu.h:379
I2C configuration structure.
Definition periph_cpu.h:299
i2c_speed_t speed
Configured bus speed, actual speed may be lower but never higher.
Definition periph_cpu.h:304
SPI device configuration.
Definition periph_cpu.h:337
uint8_t num
number of SSI device, i.e.
Definition periph_cpu.h:296
UART device configuration.
Definition periph_cpu.h:218
USART_t * dev
pointer to the used UART device
Definition periph_cpu.h:219