periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Beuth Hochschule für Technik 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 #include "kernel_defines.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #define XTAL_HZ (12000000U) /* the board provides a 12 MHz XTAL */
34 
35 #define CLOCK_CORECLOCK (72000000U) /* the lpc2388 runs with 72MHz */
36 
37 #define CLOCK_PCLK (CLOCK_CORECLOCK)
38 
44 #define TIMER_NUMOF (4U)
45 
51 static const uart_conf_t uart_config[] = {
52  {
53  .dev = UART0,
54  .irq_prio_rx = 6,
55  .pinsel_rx = 0,
56  .pinsel_tx = 0,
57  .pinsel_msk_rx = BIT4,
58  .pinsel_msk_tx = BIT6,
59  },
60  {
61  .dev = UART1,
62  .irq_prio_rx = 6,
63  .pinsel_rx = 1,
64  .pinsel_tx = 0,
65  .pinsel_msk_rx = BIT0,
66  .pinsel_msk_tx = BIT30,
67  }
68 };
69 
70 #define UART_NUMOF (2)
71 
77 static const spi_conf_t spi_config[] = {
78  {
79  .dev = SPI0,
80  .pinsel_mosi = 3,
81  .pinsel_miso = 3,
82  .pinsel_clk = 3,
83  .pinsel_msk_mosi = (BIT16 | BIT17), /* P1.24 */
84  .pinsel_msk_miso = (BIT14 | BIT15), /* P1.23 */
85  .pinsel_msk_clk = (BIT8 | BIT9), /* P1.20 */
86  },
87  {
88  .dev = SPI1,
89  .pinsel_mosi = 0,
90  .pinsel_miso = 0,
91  .pinsel_clk = 0,
92  .pinsel_msk_mosi = (BIT19), /* P0.9 */
93  .pinsel_msk_miso = (BIT17), /* P0.8 */
94  .pinsel_msk_clk = (BIT15), /* P0.7 */
95  },
96 };
97 
98 #define SPI_NUMOF ARRAY_SIZE(spi_config)
99 
105 static const adc_conf_t adc_config[] = {
106  {
107  .chan = 0,
108  .pinsel = 1,
109  .pinsel_msk = BIT14,
110  },
111 };
112 
113 #define ADC_NUMOF (1)
114 
119 static const i2c_conf_t i2c_config[] = {
120  {
121  .dev = I2C0,
122  .speed = I2C_SPEED_NORMAL,
123  .irq_prio = 5,
124  .pinsel_sda = 1,
125  .pinsel_scl = 1,
126  .pinsel_msk_sda = BIT22, /* P0.27 */
127  .pinsel_msk_scl = BIT24, /* P0.28 */
128  },
129  {
130  .dev = I2C1,
131  .speed = I2C_SPEED_NORMAL,
132  .irq_prio = 5,
133  .pinsel_sda = 1,
134  .pinsel_scl = 1,
135  .pinsel_msk_sda = BIT6 | BIT7, /* P0.19 */
136  .pinsel_msk_scl = BIT8 | BIT9, /* P0.20 */
137  },
138 };
139 
140 #define I2C_NUMOF (2)
141 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* PERIPH_CONF_H */
148 
kernel_defines.h
Common macros and compiler attributes/pragmas configuration.
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