Loading...
Searching...
No Matches
cfg_spi_default.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Kees Bakker, SODAQ
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
19#ifndef CFG_SPI_DEFAULT_H
20#define CFG_SPI_DEFAULT_H
21
22#include <stdint.h>
23
24#include "cpu.h"
25#include "periph_cpu.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
35static const spi_conf_t spi_config[] = {
36 {
37 .dev = &SERCOM3->SPI,
38 .miso_pin = GPIO_PIN(PA, 22),
39 .mosi_pin = GPIO_PIN(PA, 20),
40 .clk_pin = GPIO_PIN(PA, 21),
41 .miso_mux = GPIO_MUX_C,
42 .mosi_mux = GPIO_MUX_D,
43 .clk_mux = GPIO_MUX_D,
44 .miso_pad = SPI_PAD_MISO_0,
45 .mosi_pad = SPI_PAD_MOSI_2_SCK_3,
46 .gclk_src = SAM0_GCLK_MAIN,
47#ifdef MODULE_PERIPH_DMA
48 .tx_trigger = SERCOM3_DMAC_ID_TX,
49 .rx_trigger = SERCOM3_DMAC_ID_RX,
50#endif
51 },
52};
53
54#define SPI_NUMOF ARRAY_SIZE(spi_config)
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* CFG_SPI_DEFAULT_H */
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
static const spi_conf_t spi_config[]
Default SPI device configuration.
@ PA
port A
@ SPI_PAD_MISO_0
use pad 0 for MISO line
@ GPIO_MUX_D
select peripheral function D
@ GPIO_MUX_C
select peripheral function C
@ SPI_PAD_MOSI_2_SCK_3
use pad 2 for MOSI, pad 3 for SCK
#define SAM0_GCLK_MAIN
120 MHz main clock
Definition periph_cpu.h:74
SPI device configuration.
Definition periph_cpu.h:337
SPI_t * dev
pointer to the used SPI device
Definition periph_cpu.h:338