Loading...
Searching...
No Matches
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
19
20#include "kernel_defines.h"
21#include "macros/units.h"
22#include "periph_cpu.h"
23#include "clk_conf.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
34#define TIMER_NUMOF (1)
36
41static 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)
58
64static 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)
75
81#define PWM_NUMOF (3)
83
88static 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)
99
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
@ 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
SPI device configuration.
Definition periph_cpu.h:333
UART device configuration.
Definition periph_cpu.h:214
Unit helper macros.