periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
19 #ifndef PERIPH_CONF_H
20 #define PERIPH_CONF_H
21 
22 #include "periph_cpu.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define XTAL_HZ (16000000U) /* the board provides a 16 MHz XTAL */
33 
34 #define CLOCK_CORECLOCK (72000000U) /* the msba2 runs with 72MHz */
35 
36 #define CLOCK_PCLK (CLOCK_CORECLOCK)
37 
43 #define TIMER_NUMOF (1U)
44 
53 #define PWM_NUMOF (1U)
54 
55 /* PWM_0 device configuration */
56 #define PWM_CHANNELS (3)
57 #define PWM_CH0 (3)
58 #define PWM_CH0_MR PWM1MR3
59 #define PWM_CH1 (4)
60 #define PWM_CH1_MR PWM1MR4
61 #define PWM_CH2 (5)
62 #define PWM_CH2_MR PWM1MR5
63 /* PWM_0 pin configuration */
64 #define PWM_PORT PINSEL4
65 #define PWM_CH0_PIN (2)
66 #define PWM_CH1_PIN (3)
67 #define PWM_CH2_PIN (4)
68 #define PWM_FUNC (1)
69 
76 static const uart_conf_t uart_config[] = {
77  {
78  .dev = UART0,
79  .irq_prio_rx = 6,
80  .pinsel_rx = 0,
81  .pinsel_tx = 0,
82  .pinsel_msk_rx = BIT4,
83  .pinsel_msk_tx = BIT6,
84  },
85  {
86  .dev = UART1,
87  .irq_prio_rx = 6,
88  .pinsel_rx = 4,
89  .pinsel_tx = 4,
90  .pinsel_msk_rx = BIT3,
91  .pinsel_msk_tx = BIT1,
92  },
93  {
94  .dev = UART2,
95  .irq_prio_rx = 6,
96  .pinsel_rx = 0,
97  .pinsel_tx = 0,
98  .pinsel_msk_rx = BIT22,
99  .pinsel_msk_tx = BIT20,
100  },
101  {
102  .dev = UART3,
103  .irq_prio_rx = 6,
104  .pinsel_rx = 9,
105  .pinsel_tx = 9,
106  .pinsel_msk_rx = BIT26 | BIT27,
107  .pinsel_msk_tx = BIT24 | BIT25,
108  },
109 };
110 
111 #define UART_NUMOF (4)
112 
118 static const spi_conf_t spi_config[] = {
119  {
120  .dev = SPI0,
121  .pinsel_mosi = 3,
122  .pinsel_miso = 3,
123  .pinsel_clk = 3,
124  .pinsel_msk_mosi = (BIT16 | BIT17),
125  .pinsel_msk_miso = (BIT14 | BIT15),
126  .pinsel_msk_clk = (BIT8 | BIT9),
127  },
128 };
129 
130 #define SPI_NUMOF (1)
131 
137 static const adc_conf_t adc_config[] = {
138  { /* P0.23 */
139  .chan = 0,
140  .pinsel = 1,
141  .pinsel_msk = BIT14,
142  },
143  { /* P0.24 */
144  .chan = 1,
145  .pinsel = 1,
146  .pinsel_msk = BIT16,
147  },
148  { /* P0.25 */
149  .chan = 2,
150  .pinsel = 1,
151  .pinsel_msk = BIT18,
152  },
153 };
154 
155 #define ADC_NUMOF ARRAY_SIZE(adc_config)
156 
162 static const i2c_conf_t i2c_config[] = {
163  { /* JP3 */
164  .dev = I2C2,
165  .speed = I2C_SPEED_NORMAL,
166  .irq_prio = 5,
167  .pinsel_sda = 0,
168  .pinsel_scl = 0,
169  .pinsel_msk_sda = BIT21, /* P0.10 */
170  .pinsel_msk_scl = BIT23, /* P0.11 */
171  },
172 };
173 
174 /* used in arithmetic preprocessor expression, so no ARRAY_SIZE() */
175 #define I2C_NUMOF (1)
176 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif /* PERIPH_CONF_H */
183 
I2C_SPEED_NORMAL
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition: i2c.h:177
UART0
#define UART0
UART0 register bank.
Definition: cc26xx_cc13xx_uart.h:134
uart_conf_t
UART device configuration.
Definition: periph_cpu.h:166
uart_conf_t::dev
cc2538_uart_t * dev
pointer to the used UART device
Definition: periph_cpu.h:167
adc_conf_t
ADC device configuration.
Definition: periph_cpu.h:74
i2c_conf_t
I2C configuration options.
Definition: periph_cpu.h:128
spi_conf_t::dev
SPI_Type * dev
SPI device to use.
Definition: periph_cpu.h:465
UART1
#define UART1
UART1 register bank.
Definition: cc26xx_cc13xx_uart.h:138
adc_conf_t::chan
uint8_t chan
ADC channel.
Definition: periph_cpu.h:350
spi_conf_t
SPI configuration structure type.
Definition: periph_cpu.h:273
i2c_conf_t::dev
I2C_TypeDef * dev
USART device used.
Definition: periph_cpu.h:247