Loading...
Searching...
No Matches
cfg_spi_default.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014-2016 Freie Universität Berlin
3 * 2015 Zolertia SL
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
10#pragma once
11
23
24#include "periph_cpu.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
34static const spi_conf_t spi_config[] = {
35 {
36 .num = 0,
37 .mosi_pin = GPIO_PIN(PORT_B, 1),
38 .miso_pin = GPIO_PIN(PORT_B, 3),
39 .sck_pin = GPIO_PIN(PORT_B, 2),
40 .cs_pin = GPIO_PIN(PORT_B, 5)
41 },
42 {
43 .num = 1,
44 .mosi_pin = GPIO_PIN(PORT_C, 5),
45 .miso_pin = GPIO_PIN(PORT_C, 6),
46 .sck_pin = GPIO_PIN(PORT_C, 4),
47 .cs_pin = GPIO_PIN(PORT_A, 7)
48 }
49};
50
51#define SPI_NUMOF ARRAY_SIZE(spi_config)
53
54#ifdef __cplusplus
55} /* end extern "C" */
56#endif
57
@ PORT_B
port B
Definition periph_cpu.h:47
@ PORT_C
port C
Definition periph_cpu.h:48
@ PORT_A
port A
Definition periph_cpu.h:46
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:45
SPI device configuration.
Definition periph_cpu.h:336