periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Ken Rabold
3  * SPDX-FileCopyrightText: 2019 Inria
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
20 #include "kernel_defines.h"
21 #include "macros/units.h"
22 #include "periph_cpu.h"
23 #include "clk_conf.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
34 #define TIMER_NUMOF (1)
41 static const uart_conf_t uart_config[] = {
42  {
43  .addr = UART0_CTRL_ADDR,
44  .rx = GPIO_PIN(0, 16),
45  .tx = GPIO_PIN(0, 17),
46  .isr_num = INT_UART0_BASE,
47  },
48  {
49  .addr = UART1_CTRL_ADDR,
50  .rx = GPIO_PIN(0, 23),
51  .tx = GPIO_PIN(0, 18),
52  .isr_num = INT_UART1_BASE,
53  },
54 };
55 
56 #define UART_NUMOF ARRAY_SIZE(uart_config)
64 static const spi_conf_t spi_config[] = {
65  {
66  .addr = SPI1_CTRL_ADDR,
67  .mosi = GPIO_PIN(0, 3), /* D11 */
68  .miso = GPIO_PIN(0, 4), /* D12 */
69  .sclk = GPIO_PIN(0, 5), /* D13 */
70  },
71 };
72 
73 #define SPI_NUMOF ARRAY_SIZE(spi_config)
81 #define PWM_NUMOF (3)
88 static const i2c_conf_t i2c_config[] = {
89  {
90  .addr = I2C0_CTRL_ADDR,
91  .scl = GPIO_PIN(0, 13),
92  .sda = GPIO_PIN(0, 12),
93  .speed = I2C_SPEED_NORMAL,
94  },
95 };
96 
97 #define I2C_NUMOF ARRAY_SIZE(i2c_config)
100 #ifdef __cplusplus
101 }
102 #endif
103 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:42
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:35
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:93
static const i2c_conf_t i2c_config[]
I2C configuration.
Definition: periph_conf.h:65
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition: periph_cpu.h:274
Common macros and compiler attributes/pragmas configuration.
I2C configuration structure.
Definition: periph_cpu.h:295
uint32_t addr
device base address
Definition: periph_cpu.h:128
SPI device configuration.
Definition: periph_cpu.h:333
uint32_t addr
SPI control register address.
Definition: periph_cpu.h:86
UART device configuration.
Definition: periph_cpu.h:214
uint32_t addr
UART control register address.
Definition: periph_cpu.h:62
Unit helper macros.