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 
20 #ifndef PERIPH_CONF_H
21 #define PERIPH_CONF_H
22 
23 #include "kernel_defines.h"
24 #include "periph_conf_common.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 static const spi_conf_t spi_config[] = {
35  {
36  .dev = NRF_SPIM0,
37  .sclk = GPIO_PIN(1, 15),
38  .mosi = GPIO_PIN(1, 13),
39  .miso = GPIO_PIN(1, 14),
40  },
41  {
42  .dev = NRF_SPIM2,
43  .sclk = GPIO_PIN(0, 19),
44  .mosi = GPIO_PIN(0, 20),
45  .miso = GPIO_PIN(0, 21),
46  }
47 };
48 #define SPI_NUMOF ARRAY_SIZE(spi_config)
55 static const uart_conf_t uart_config[] = {
56  { /* Mapped to USB virtual COM port */
57  .dev = NRF_UARTE0,
58  .rx_pin = GPIO_PIN(0, 8),
59  .tx_pin = GPIO_PIN(0, 6),
60 #ifdef MODULE_PERIPH_UART_HW_FC
61  .rts_pin = GPIO_UNDEF,
62  .cts_pin = GPIO_UNDEF,
63 #endif
64  .irqn = UARTE0_UART0_IRQn,
65  },
66  { /* Mapped to Arduino D0/D1 pins */
67  .dev = NRF_UARTE1,
68  .rx_pin = GPIO_PIN(1, 1),
69  .tx_pin = GPIO_PIN(1, 2),
70 #ifdef MODULE_PERIPH_UART_HW_FC
71  .rts_pin = GPIO_UNDEF,
72  .cts_pin = GPIO_UNDEF,
73 #endif
74  .irqn = UARTE1_IRQn,
75  },
76 };
77 
78 #define UART_0_ISR (isr_uart0)
79 #define UART_1_ISR (isr_uarte1)
80 
81 #define UART_NUMOF ARRAY_SIZE(uart_config)
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* PERIPH_CONF_H */
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:46
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:39
static const spi_conf_t spi_config[]
SPI configuration.
Definition: periph_conf.h:97
Common macros and compiler attributes/pragmas configuration.
SPI device configuration.
Definition: periph_cpu.h:337
SPI_t * dev
pointer to the used SPI device
Definition: periph_cpu.h:338
UART device configuration.
Definition: periph_cpu.h:218
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:219