Loading...
Searching...
No Matches
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
10#pragma once
11
22
23#include "kernel_defines.h"
24#include "macros/units.h"
25#include "periph_cpu.h"
26#include "clk_conf.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
37#define TIMER_NUMOF (1)
39
44static const uart_conf_t uart_config[] = {
45 {
46 .addr = UART0_CTRL_ADDR,
47 .rx = GPIO_PIN(0, 16),
48 .tx = GPIO_PIN(0, 17),
49 .isr_num = INT_UART0_BASE,
50 },
51 {
52 .addr = UART1_CTRL_ADDR,
53 .rx = GPIO_PIN(0, 23),
54 .tx = GPIO_PIN(0, 18),
55 .isr_num = INT_UART1_BASE,
56 },
57};
58
59#define UART_NUMOF ARRAY_SIZE(uart_config)
61
67static const spi_conf_t spi_config[] = {
68 {
69 .addr = SPI1_CTRL_ADDR,
70 .mosi = GPIO_PIN(0, 3), /* D11 */
71 .miso = GPIO_PIN(0, 4), /* D12 */
72 .sclk = GPIO_PIN(0, 5), /* D13 */
73 },
74};
75
76#define SPI_NUMOF ARRAY_SIZE(spi_config)
78
84#define PWM_NUMOF (3)
86
91static const i2c_conf_t i2c_config[] = {
92 {
93 .addr = I2C0_CTRL_ADDR,
94 .scl = GPIO_PIN(0, 13),
95 .sda = GPIO_PIN(0, 12),
96 .speed = I2C_SPEED_NORMAL,
97 },
98};
99
100#define I2C_NUMOF ARRAY_SIZE(i2c_config)
102
103#ifdef __cplusplus
104}
105#endif
106
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:45
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:277
Common macros and compiler attributes/pragmas configuration.
I2C configuration structure.
Definition periph_cpu.h:298
SPI device configuration.
Definition periph_cpu.h:336
UART device configuration.
Definition periph_cpu.h:217
Unit helper macros.