Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Freie Universität Berlin
3 * SPDX-FileCopyrightText: 2023 HAW Hamburg
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
21
22#include "periph_cpu.h"
23#include "cfg_clock_32_0.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(0, 24),
39 .tx_pin = GPIO_PIN(0, 25),
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(0, 14),
61 .mosi = GPIO_PIN(0, 13),
62 .miso = GPIO_PIN(0, 15),
63 },
64 {
65 .dev = NRF_SPIM1,
66 .sclk = GPIO_PIN(0, 19),
67 .mosi = GPIO_PIN(0, 17),
68 .miso = GPIO_PIN(0, 22),
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 = 11,
83 .sda = 12,
84 .speed = I2C_SPEED_NORMAL
85 }
86};
87#define I2C_NUMOF ARRAY_SIZE(i2c_config)
89
90#ifdef __cplusplus
91}
92#endif
93
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:45
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:277
Common clock configuration for the nRF52 based boards.
I2C configuration structure.
Definition periph_cpu.h:298
SPI device configuration.
Definition periph_cpu.h:336
UART device configuration.
Definition periph_cpu.h:217