Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "board.h"
20#include "periph_cpu.h"
21#include "cfg_clock_32_0.h"
22#include "cfg_rtt_default.h"
23#include "cfg_timer_default.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
36static const uart_conf_t uart_config[] = {
37 {
38 .dev = NRF_UARTE0,
39 .rx_pin = GPIO_PIN(0, 4),
40 .tx_pin = GPIO_PIN(0, 5),
41#ifdef MODULE_PERIPH_UART_HW_FC
42 .rts_pin = GPIO_UNDEF,
43 .cts_pin = GPIO_UNDEF,
44#endif
45 .irqn = UARTE0_UART0_IRQn,
46 },
47};
48
52#define UART_0_ISR (isr_uart0)
56#define UART_NUMOF ARRAY_SIZE(uart_config)
58
66static const i2c_conf_t i2c_config[] = {
67 { /* External connectors */
68 .dev = NRF_TWIM0,
69 .scl = GPIO_PIN(0, 0), /* D19 */
70 .sda = GPIO_PIN(0, 30), /* D20 */
71 .speed = I2C_SPEED_NORMAL
72 },
73 { /* On board sensors */
74 .dev = NRF_TWIM1,
75 .scl = GPIO_PIN(0, 25),
76 .sda = GPIO_PIN(0, 24),
77 .speed = I2C_SPEED_NORMAL
78 },
79};
80
84#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
86
94static const spi_conf_t spi_config[] = {
95 { /* External connectors */
96 .dev = NRF_SPIM0,
97 .sclk = GPIO_PIN(0, 23), /* D13 */
98 .mosi = GPIO_PIN(0, 21), /* D15 */
99 .miso = GPIO_PIN(0, 22), /* D14 */
100 },
101 { /* TFT LCD screen */
102 .dev = NRF_SPIM1,
103 .sclk = GPIO_PIN(0, 14),
104 .mosi = GPIO_PIN(0, 15),
105 .miso = GPIO_PIN(0, 0),
106 },
107};
108
112#define SPI_NUMOF ARRAY_SIZE(spi_config)
114
122static const pdm_conf_t pdm_config = {
123 .din_pin = PDM_DIN_PIN,
124 .clk_pin = PDM_CLK_PIN,
125};
126
127
128#ifdef __cplusplus
129}
130#endif
131
Board specific configuration for the Adafruit Clue board.
#define PDM_DIN_PIN
GPIO pin for the data line.
Definition board.h:124
#define PDM_CLK_PIN
GPIO pin for the clock.
Definition board.h:131
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:42
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:274
static const pdm_conf_t pdm_config
PDM configuration.
Common clock configuration for the nRF52 based boards.
#define NRF_UARTE0
UART 0.
Definition periph_cpu.h:54
I2C configuration structure.
Definition periph_cpu.h:295
Structure for PDM configuration data.
Definition periph_cpu.h:94
SPI device configuration.
Definition periph_cpu.h:333
UART device configuration.
Definition periph_cpu.h:214