Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Benjamin Valentin
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 "periph_cpu.h"
24#include "cfg_rtt_default.h"
25#include "cfg_timer_default.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
36#define CLOCK_HFCLK (1) /* external crystal */
37
38/* LFCLK Source clock selection:*/
39/* - CLOCK_LFCLKSRC_SRC_RC: internal RC oscillator
40 * - CLOCK_LFCLKSRC_SRC_Xtal: 32.768 kHz crystal
41 * - CLOCK_LFCLKSRC_SRC_Synth: derived from HFCLK */
42#define CLOCK_LFCLK (CLOCK_LFCLKSRC_SRC_RC)
49static const spi_conf_t spi_config[] = {
50 {
51 .dev = NRF_SPIM0,
52 .sclk = GPIO_PIN(0, 26),
53 .mosi = GPIO_PIN(0, 27),
54 .miso = GPIO_PIN(0, 28),
55 },
56};
57#define SPI_NUMOF ARRAY_SIZE(spi_config)
64static const i2c_conf_t i2c_config[] = {
65 {
66 .dev = NRF_TWIM0,
67 .scl = GPIO_PIN(0, 6),
68 .sda = GPIO_PIN(0, 7),
69 .speed = I2C_SPEED_NORMAL
70 }
71};
72#define I2C_NUMOF ARRAY_SIZE(i2c_config)
79static const uart_conf_t uart_config[] = {
80 { /* Mapped to USB virtual COM port */
81 .dev = NRF_UARTE0,
82 .rx_pin = GPIO_PIN(0, 14),
83 .tx_pin = GPIO_PIN(0, 18),
84#ifdef MODULE_PERIPH_UART_HW_FC
85 .rts_pin = GPIO_UNDEF,
86 .cts_pin = GPIO_UNDEF,
87#endif
88 .irqn = UARTE0_UART0_IRQn,
89 },
90};
91
92#define UART_0_ISR (isr_uart0)
93
94#define UART_NUMOF ARRAY_SIZE(uart_config)
97#ifdef __cplusplus
98}
99#endif
100
101#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.
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:278
I2C configuration structure.
Definition periph_cpu.h:299
TWI_t * dev
Pointer to hardware module registers.
Definition periph_cpu.h:300
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