boards/remote-revb/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  * Copyright (C) 2015 Zolertia SL
4  * 2017 HAW Hamburg
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 
23 #ifndef PERIPH_CONF_H
24 #define PERIPH_CONF_H
25 
26 #include "cc2538_gpio.h"
27 #include "periph_cpu.h"
28 #include "periph_common.h"
29 
30 #ifdef __cplusplus
31  extern "C" {
32 #endif
33 
38 #define UART_NUMOF (1U)
39 #define UART_0_EN 1
40 #define UART_IRQ_PRIO 1
41 
42 /* UART 0 device configuration */
43 #define UART_0_DEV UART0
44 #define UART_0_IRQ UART0_IRQn
45 #define UART_0_ISR isr_uart0
46 /* UART 0 pin configuration */
47 #define UART_0_TX_PIN GPIO_PA1
48 #define UART_0_RX_PIN GPIO_PA0
49 
56 #define I2C_NUMOF 1
57 #define I2C_0_EN 1
58 #define I2C_IRQ_PRIO 1
59 
60 /* I2C 0 device configuration */
61 #define I2C_0_DEV 0
62 #define I2C_0_IRQ I2C_IRQn
63 #define I2C_0_IRQ_HANDLER isr_i2c
64 #define I2C_0_SCL_PIN GPIO_PC3
65 #define I2C_0_SDA_PIN GPIO_PC2
66 
67 static const i2c_conf_t i2c_config[I2C_NUMOF] = {
68  {
69  .scl_pin = I2C_0_SCL_PIN,
70  .sda_pin = I2C_0_SDA_PIN,
71  },
72 };
82 static const spi_clk_conf_t spi_clk_config[] = {
83  { .cpsr = 10, .scr = 31 }, /* 100khz */
84  { .cpsr = 2, .scr = 39 }, /* 400khz */
85  { .cpsr = 2, .scr = 15 }, /* 1MHz */
86  { .cpsr = 2, .scr = 2 }, /* ~4.5MHz */
87  { .cpsr = 2, .scr = 1 } /* ~10.7MHz */
88 };
89 
94 static const spi_conf_t spi_config[] = {
95  {
96  .dev = SSI0,
97  .mosi_pin = GPIO_PB1,
98  .miso_pin = GPIO_PB3,
99  .sck_pin = GPIO_PB2,
100  .cs_pin = GPIO_PB5
101  },
102  {
103  .dev = SSI1,
104  .mosi_pin = GPIO_PC5,
105  .miso_pin = GPIO_PC6,
106  .sck_pin = GPIO_PC4,
107  .cs_pin = GPIO_PA7
108  }
109 };
110 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
111 
117 #define SOC_ADC_ADCCON_REF SOC_ADC_ADCCON_REF_AVDD5
118 
119 static const adc_conf_t adc_config[] = {
120  GPIO_PIN(0, 5),
121  GPIO_PIN(0, 4),
122  /* voltage divider with 5/3 relationship to allow 5V sensors */
123  GPIO_PIN(0, 2),
124 };
125 
126 #define ADC_NUMOF (sizeof(adc_config) / sizeof(adc_config[0]))
127 
129 #ifdef __cplusplus
130 } /* end extern "C" */
131 #endif
132 
133 #endif /* PERIPH_CONF_H */
134 
PB1.
Definition: cc2538_gpio.h:155
PB3.
Definition: cc2538_gpio.h:157
I2C configuration options.
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
PC4.
Definition: cc2538_gpio.h:166
gpio_t scl_pin
pin used for SCL
PC6.
Definition: cc2538_gpio.h:168
#define SSI1
SSI1 Instance.
Definition: cc2538_ssi.h:78
PA7.
Definition: cc2538_gpio.h:153
PB5.
Definition: cc2538_gpio.h:159
Datafields for static SPI clock configuration values.
static const spi_clk_conf_t spi_clk_config[]
Pre-calculated clock divider values based on a CLOCK_CORECLOCK (32MHz)
PB2.
Definition: cc2538_gpio.h:156
Peripheral MCU configuration for the Re-Mote boards.
Driver for the cc2538 GPIO controller.
SPI module configuration options.
uint8_t cpsr
CPSR clock divider.
ADC device configuration.
#define SSI0
SSI0 Instance.
Definition: cc2538_ssi.h:77
PC5.
Definition: cc2538_gpio.h:167
cc2538_ssi_t * dev
SSI device.