Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Mesotic SAS
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "periph_cpu.h"
20
21#include "board.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
31static const timer_conf_t timer_config[] = {
32 {
33 .dev = NRF_TIMER0_S,
34 .channels = 5,
35 .bitmode = TIMER_BITMODE_BITMODE_32Bit,
36 .irqn = TIMER0_IRQn
37 },
38 {
39 .dev = NRF_TIMER1_S,
40 .channels = 5,
41 .bitmode = TIMER_BITMODE_BITMODE_32Bit,
42 .irqn = TIMER1_IRQn
43 },
44};
45
46#define TIMER_0_ISR isr_timer0
47#define TIMER_1_ISR isr_timer1
48
49#define TIMER_NUMOF ARRAY_SIZE(timer_config)
51
56static const uart_conf_t uart_config[] = {
57 {
58 .dev = NRF_UARTE0_S,
59 .rx_pin = GPIO_PIN(1, 0),
60 .tx_pin = GPIO_PIN(1, 1),
61#ifdef MODULE_PERIPH_UART_HW_FC
62 .rts_pin = GPIO_UNDEF,
63 .cts_pin = GPIO_UNDEF,
64#endif
65 .irqn = SERIAL0_IRQn,
66 },
67};
68
69#define UART_NUMOF ARRAY_SIZE(uart_config)
71
76#ifndef RTT_DEV
77#define RTT_DEV (0)
78#endif
79
80#define RTT_MAX_VALUE (0x00ffffff)
81#define RTT_MAX_FREQUENCY (32768U)
82#define RTT_MIN_FREQUENCY (8U)
83#define RTT_CLOCK_FREQUENCY (32768U)
84
85#ifndef RTT_FREQUENCY
86#define RTT_FREQUENCY (1024U)
87#endif
89
94static const pwm_conf_t pwm_config[] = {
95 {
96 .dev = NRF_PWM0_S,
97 .pin = {
98 LED0_PIN,
99 LED1_PIN,
100 LED2_PIN,
101 LED3_PIN
102 }
103 },
104};
105
106#define PWM_NUMOF ARRAY_SIZE(pwm_config)
108
113static const spi_conf_t spi_config[] = {
114 {
115 .dev = NRF_SPIM1_S,
116 .sclk = GPIO_PIN(0, 17),
117 .mosi = GPIO_PIN(0, 13),
118 .miso = GPIO_PIN(0, 14),
119 }
120};
121
122#define SPI_NUMOF ARRAY_SIZE(spi_config)
124
129static const i2c_conf_t i2c_config[] = {
130 {
131 .dev = NRF_TWIM2_S,
132 .scl = GPIO_PIN(1, 3),
133 .sda = GPIO_PIN(1, 2),
134 .speed = I2C_SPEED_NORMAL
135 }
136};
137#define I2C_NUMOF ARRAY_SIZE(i2c_config)
139
140#ifdef __cplusplus
141}
142#endif
143
#define LED2_PIN
RX LED yellow.
Definition board.h:32
#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
Board configuration for the nRF5340DK-app board.
I2C configuration structure.
Definition periph_cpu.h:298
PWM device configuration.
SPI device configuration.
Definition periph_cpu.h:336
Timer device configuration.
Definition periph_cpu.h:263
UART device configuration.
Definition periph_cpu.h:217