Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Inria
3 * 2019 Freie Universität Berlin
4 * 2019 Kaspar Schleiser <kaspar@schleiser.de>
5 *
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License v2.1. See the file LICENSE in the top level
8 * directory for more details.
9 */
10
22#ifndef PERIPH_CONF_H
23#define PERIPH_CONF_H
24
25#include "periph_cpu.h"
26#include "cfg_clock_32_1.h"
27#include "cfg_rtt_default.h"
28#include "cfg_timer_default.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
38static const spi_conf_t spi_config[] = {
39 {
40 .dev = NRF_SPIM0,
41 .sclk = GPIO_PIN(0, 2),
42 .mosi = GPIO_PIN(0, 3),
43 .miso = GPIO_PIN(0, 4),
44 .ppi = 0,
45 }
46};
47
48#define SPI_NUMOF ARRAY_SIZE(spi_config)
55static const i2c_conf_t i2c_config[] = {
56 {
57 .dev = NRF_TWIM1,
58 .scl = GPIO_PIN(0, 7),
59 .sda = GPIO_PIN(0, 6),
60 .speed = I2C_SPEED_FAST
61 }
62};
63
64#define I2C_NUMOF ARRAY_SIZE(i2c_config)
67#ifdef __cplusplus
68}
69#endif
70
71#endif /* PERIPH_CONF_H */
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
@ I2C_SPEED_FAST
fast mode: ~400 kbit/s
Definition periph_cpu.h:279
Common clock configuration for the nRF52 based boards.
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