Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "kernel_defines.h"
20#include "periph_conf_common.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
30static const spi_conf_t spi_config[] = {
31 {
32 .dev = NRF_SPIM0,
33 .sclk = GPIO_PIN(1, 15),
34 .mosi = GPIO_PIN(1, 13),
35 .miso = GPIO_PIN(1, 14),
36 },
37 {
38 .dev = NRF_SPIM2,
39 .sclk = GPIO_PIN(0, 19),
40 .mosi = GPIO_PIN(0, 20),
41 .miso = GPIO_PIN(0, 21),
42 }
43};
44#define SPI_NUMOF ARRAY_SIZE(spi_config)
46
51static const uart_conf_t uart_config[] = {
52 { /* Mapped to USB virtual COM port */
53 .dev = NRF_UARTE0,
54 .rx_pin = GPIO_PIN(0, 8),
55 .tx_pin = GPIO_PIN(0, 6),
56#ifdef MODULE_PERIPH_UART_HW_FC
57 .rts_pin = GPIO_UNDEF,
58 .cts_pin = GPIO_UNDEF,
59#endif
60 .irqn = UARTE0_UART0_IRQn,
61 },
62 { /* Mapped to Arduino D0/D1 pins */
63 .dev = NRF_UARTE1,
64 .rx_pin = GPIO_PIN(1, 1),
65 .tx_pin = GPIO_PIN(1, 2),
66#ifdef MODULE_PERIPH_UART_HW_FC
67 .rts_pin = GPIO_UNDEF,
68 .cts_pin = GPIO_UNDEF,
69#endif
70 .irqn = UARTE1_IRQn,
71 },
72};
73
74#define UART_0_ISR (isr_uart0)
75#define UART_1_ISR (isr_uarte1)
76
77#define UART_NUMOF ARRAY_SIZE(uart_config)
79
80#ifdef __cplusplus
81}
82#endif
83
#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.
Common macros and compiler attributes/pragmas configuration.
SPI device configuration.
Definition periph_cpu.h:333
UART device configuration.
Definition periph_cpu.h:214