Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Baptiste Le Duc <baptiste.leduc@etik.com>
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "periph_cpu.h"
19#include "cfg_clock_32_1.h"
20#include "cfg_rtt_default.h"
21#include "cfg_timer_default.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
34static const uart_conf_t uart_config[] = {
35 {
36 .dev = NRF_UARTE0,
37 .rx_pin = GPIO_PIN(0, 14),
38 .tx_pin = GPIO_PIN(0, 13),
39#ifdef MODULE_PERIPH_UART_HW_FC
40 .rts_pin = GPIO_UNDEF,
41 .cts_pin = GPIO_UNDEF,
42#endif
43 .irqn = UARTE0_UART0_IRQn,
44 },
45 {
46 .dev = NRF_UARTE1,
47 .rx_pin = GPIO_PIN(0, 17),
48 .tx_pin = GPIO_PIN(0, 16),
49#ifdef MODULE_PERIPH_UART_HW_FC
50 .rts_pin = GPIO_UNDEF,
51 .cts_pin = GPIO_UNDEF,
52#endif
53 .irqn = UARTE1_IRQn,
54 },
55};
56
57#define UART_0_ISR (isr_uart0)
58#define UART_1_ISR (isr_uarte1)
59
60#define UART_NUMOF ARRAY_SIZE(uart_config)
62
69static const spi_conf_t spi_config[] = {
70 {
71 .dev = NRF_SPIM2,
72 .sclk = GPIO_PIN(0, 11),
73 .mosi = GPIO_PIN(1, 9),
74 .miso = GPIO_PIN(1, 8),
75 },
76};
77
78#define SPI_NUMOF ARRAY_SIZE(spi_config)
80
87static const i2c_conf_t i2c_config[] = {
88 {
89 .dev = NRF_TWIM0,
90 .scl = GPIO_PIN(0, 27),
91 .sda = GPIO_PIN(0, 26),
92 .speed = I2C_SPEED_FAST,
93 },
94};
95
96#define I2C_NUMOF ARRAY_SIZE(i2c_config)
98
107static const pwm_conf_t pwm_config[] = {
108 {
109 .dev = NRF_PWM0,
110 .pin = {
111 GPIO_PIN(0, 25),
115 },
116 },
117};
118
119#define PWM_NUMOF ARRAY_SIZE(pwm_config)
121
132/* ADC_NUMOF defined in cpu/nrf52/include/periph_cpu.h */
134
135#ifdef __cplusplus
136}
137#endif
138
#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_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:275
Common clock configuration for the nRF52 based boards.
I2C configuration structure.
Definition periph_cpu.h:295
PWM device configuration.
SPI device configuration.
Definition periph_cpu.h:333
UART device configuration.
Definition periph_cpu.h:214