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-FileCopyrightText: 2017 HAW Hamburg
4 * SPDX-FileCopyrightText: 2020 Oppila Microsystems - http://www.oppila.in
5 * SPDX-License-Identifier: LGPL-2.1-only
6 */
7
8#pragma once
9
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
26extern "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(PORT_A, 5),
37 GPIO_PIN(PORT_A, 4),
38 GPIO_PIN(PORT_A, 2),
39 GPIO_PIN(PORT_A, 6),
40 GPIO_PIN(PORT_A, 7),
41};
42
43#define ADC_NUMOF ARRAY_SIZE(adc_config)
49#define I2C_IRQ_PRIO 1
50
51static const i2c_conf_t i2c_config[] = {
52 {
53 .speed = I2C_SPEED_FAST,
54 .scl_pin = GPIO_PIN(PORT_C, 3),
55 .sda_pin = GPIO_PIN(PORT_C, 2)
56 },
57};
58
59#define I2C_NUMOF ARRAY_SIZE(i2c_config)
65static const spi_conf_t spi_config[] = {
66 {
67 .num = 0,
68 .mosi_pin = GPIO_PIN(PORT_C, 5),
69 .miso_pin = GPIO_PIN(PORT_C, 6),
70 .sck_pin = GPIO_PIN(PORT_C, 4),
71 .cs_pin = GPIO_PIN(PORT_A, 7)
72 }
73};
74
75#define SPI_NUMOF ARRAY_SIZE(spi_config)
81static const uart_conf_t uart_config[] = {
82 /* UART0 is mapped to debug usb */
83 {
84 .dev = UART0_BASEADDR,
85 .rx_pin = GPIO_PIN(PORT_A, 0),
86 .tx_pin = GPIO_PIN(PORT_A, 1),
87#ifdef MODULE_PERIPH_UART_HW_FC
88 .cts_pin = GPIO_UNDEF,
89 .rts_pin = GPIO_UNDEF
90#endif
91 },
92 {
93 .dev = UART1_BASEADDR,
94 .rx_pin = GPIO_PIN(PORT_C, 1),
95 .tx_pin = GPIO_PIN(PORT_C, 0),
96#ifdef MODULE_PERIPH_UART_HW_FC
97 .cts_pin = GPIO_UNDEF,
98 .rts_pin = GPIO_UNDEF
99#endif
100 }
101};
102/* interrupt function name mapping */
103#define UART_0_ISR isr_uart0
104#define UART_1_ISR isr_uart1
105
106/* macros common across all UARTs */
107#define UART_NUMOF ARRAY_SIZE(uart_config)
109
110#ifdef __cplusplus
111} /* end extern "C" */
112#endif
113
@ PORT_C
port C
Definition periph_cpu.h:45
@ PORT_A
port A
Definition periph_cpu.h:43
#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.
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:275
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:374
I2C configuration structure.
Definition periph_cpu.h:295
SPI device configuration.
Definition periph_cpu.h:333
UART device configuration.
Definition periph_cpu.h:214