periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
22 #include "kernel_defines.h"
23 #include "periph_conf_common.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 static const spi_conf_t spi_config[] = {
34  {
35  .dev = NRF_SPIM0,
36  .sclk = GPIO_PIN(1, 15),
37  .mosi = GPIO_PIN(1, 13),
38  .miso = GPIO_PIN(1, 14),
39  },
40  {
41  .dev = NRF_SPIM2,
42  .sclk = GPIO_PIN(0, 19),
43  .mosi = GPIO_PIN(0, 20),
44  .miso = GPIO_PIN(0, 21),
45  }
46 };
47 #define SPI_NUMOF ARRAY_SIZE(spi_config)
54 static const uart_conf_t uart_config[] = {
55  { /* Mapped to USB virtual COM port */
56  .dev = NRF_UARTE0,
57  .rx_pin = GPIO_PIN(0, 8),
58  .tx_pin = GPIO_PIN(0, 6),
59 #ifdef MODULE_PERIPH_UART_HW_FC
60  .rts_pin = GPIO_UNDEF,
61  .cts_pin = GPIO_UNDEF,
62 #endif
63  .irqn = UARTE0_UART0_IRQn,
64  },
65  { /* Mapped to Arduino D0/D1 pins */
66  .dev = NRF_UARTE1,
67  .rx_pin = GPIO_PIN(1, 1),
68  .tx_pin = GPIO_PIN(1, 2),
69 #ifdef MODULE_PERIPH_UART_HW_FC
70  .rts_pin = GPIO_UNDEF,
71  .cts_pin = GPIO_UNDEF,
72 #endif
73  .irqn = UARTE1_IRQn,
74  },
75 };
76 
77 #define UART_0_ISR (isr_uart0)
78 #define UART_1_ISR (isr_uarte1)
79 
80 #define UART_NUMOF ARRAY_SIZE(uart_config)
83 #ifdef __cplusplus
84 }
85 #endif
86 
#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.
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:38
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:96
Common macros and compiler attributes/pragmas configuration.
SPI device configuration.
Definition: periph_cpu.h:336
SPI_t * dev
pointer to the used SPI device
Definition: periph_cpu.h:337
UART device configuration.
Definition: periph_cpu.h:217
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:218