periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Ken Rabold
3  * 2019 Inria
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
21 #ifndef PERIPH_CONF_H
22 #define PERIPH_CONF_H
23 
24 #include "kernel_defines.h"
25 #include "macros/units.h"
26 #include "periph_cpu.h"
27 #include "clk_conf.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
38 #define TIMER_NUMOF (1)
45 static const uart_conf_t uart_config[] = {
46  {
47  .addr = UART0_CTRL_ADDR,
48  .rx = GPIO_PIN(0, 16),
49  .tx = GPIO_PIN(0, 17),
50  .isr_num = INT_UART0_BASE,
51  },
52  {
53  .addr = UART1_CTRL_ADDR,
54  .rx = GPIO_PIN(0, 23),
55  .tx = GPIO_PIN(0, 18),
56  .isr_num = INT_UART1_BASE,
57  },
58 };
59 
60 #define UART_NUMOF ARRAY_SIZE(uart_config)
68 static const spi_conf_t spi_config[] = {
69  {
70  .addr = SPI1_CTRL_ADDR,
71  .mosi = GPIO_PIN(0, 3), /* D11 */
72  .miso = GPIO_PIN(0, 4), /* D12 */
73  .sclk = GPIO_PIN(0, 5), /* D13 */
74  },
75 };
76 
77 #define SPI_NUMOF ARRAY_SIZE(spi_config)
85 #define PWM_NUMOF (3)
92 static const i2c_conf_t i2c_config[] = {
93  {
94  .addr = I2C0_CTRL_ADDR,
95  .scl = GPIO_PIN(0, 13),
96  .sda = GPIO_PIN(0, 12),
97  .speed = I2C_SPEED_NORMAL,
98  },
99 };
100 
101 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif /* PERIPH_CONF_H */
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:46
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:39
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:97
static const i2c_conf_t i2c_config[]
I2C configuration.
Definition: periph_conf.h:69
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition: periph_cpu.h:278
Common macros and compiler attributes/pragmas configuration.
I2C configuration structure.
Definition: periph_cpu.h:299
uint32_t addr
device base address
Definition: periph_cpu.h:129
SPI device configuration.
Definition: periph_cpu.h:337
uint32_t addr
SPI control register address.
Definition: periph_cpu.h:87
UART device configuration.
Definition: periph_cpu.h:218
uint32_t addr
UART control register address.
Definition: periph_cpu.h:63
Unit helper macros.