Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 TU Dresden
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
20
21#include "board.h"
22#include "periph_cpu.h"
23#include "cfg_clock_32_1.h"
24#include "cfg_rtt_default.h"
25#include "cfg_timer_default.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
35static const uart_conf_t uart_config[] = {
36 {
37 .dev = NRF_UARTE0,
38 .rx_pin = GPIO_PIN(1, 12),
39 .tx_pin = GPIO_PIN(1, 11),
40#ifdef MODULE_PERIPH_UART_HW_FC
41 .rts_pin = GPIO_UNDEF,
42 .cts_pin = GPIO_UNDEF,
43#endif
44 .irqn = UARTE0_UART0_IRQn,
45 },
46};
47
48#define UART_0_ISR (isr_uart0)
49
50#define UART_NUMOF ARRAY_SIZE(uart_config)
52
57static const spi_conf_t spi_config[] = {
58 {
59 .dev = NRF_SPIM0,
60 .sclk = GPIO_PIN(1, 13),
61 .mosi = GPIO_PIN(1, 15),
62 .miso = GPIO_PIN(1, 14),
63 },
64 {
65 .dev = NRF_SPIM1,
66 .sclk = GPIO_PIN(0, 21),
67 .mosi = GPIO_PIN(0, 20),
68 .miso = GPIO_PIN(0, 24),
69 }
70};
71
72#define SPI_NUMOF ARRAY_SIZE(spi_config)
74
79static const i2c_conf_t i2c_config[] = {
80 {
81 .dev = NRF_TWIM1,
82 .scl = GPIO_PIN(0, 5),
83 .sda = GPIO_PIN(0, 4),
84 .speed = I2C_SPEED_NORMAL
85 },
86#ifdef BOARD_SEEEDSTUDIO_XIAO_NRF52840_SENSE
87 { /* internal I2C bus for the IMU */
88 .dev = NRF_TWIM0,
89 .scl = GPIO_PIN(0, 27),
90 .sda = GPIO_PIN(0, 7),
91 .speed = I2C_SPEED_NORMAL
92 }
93#endif
94};
95
96#define I2C_NUMOF ARRAY_SIZE(i2c_config)
98
99#if defined(BOARD_SEEEDSTUDIO_XIAO_NRF52840_SENSE) || defined(DOXYGEN)
107static const pdm_conf_t pdm_config = {
108 .din_pin = PDM_DIN_PIN,
109 .clk_pin = PDM_CLK_PIN,
110};
111
112#endif /* defined(BOARD_SEEEDSTUDIO_XIAO_NRF52840_SENSE) || defined(DOXYGEN) */
113
114#ifdef __cplusplus
115}
116#endif
117
#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.
Board specific configuration for the Seeed Studio XIAO nRF52840 and Seeed Studio XIAO nRF52840 Sense.
#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