Loading...
Searching...
No Matches
mfrc522_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 Freie Universität Berlin
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
18#ifndef MFRC522_PARAMS_H
19#define MFRC522_PARAMS_H
20
21#include <stdbool.h>
22
23#include "periph/spi.h"
24
25#include "mfrc522_regs.h"
26
27#ifdef __cplusplus
28extern "C"
29{
30#endif
31
36#ifndef MFRC522_PARAM_SPI_DEV
37#define MFRC522_PARAM_SPI_DEV SPI_DEV(0)
38#endif
39#ifndef MFRC522_PARAM_SPI_CLK
40#define MFRC522_PARAM_SPI_CLK SPI_CLK_5MHZ
41#endif
42#ifndef MFRC522_PARAM_SCK_PIN
43#define MFRC522_PARAM_SCK_PIN GPIO_PIN(0, 18)
44#endif
45#ifndef MFRC522_PARAM_MISO_PIN
46#define MFRC522_PARAM_MISO_PIN GPIO_PIN(0, 19)
47#endif
48#ifndef MFRC522_PARAM_MOSI_PIN
49#define MFRC522_PARAM_MOSI_PIN GPIO_PIN(0, 23)
50#endif
51#ifndef MFRC522_PARAM_CS_PIN
52#define MFRC522_PARAM_CS_PIN GPIO_PIN(0, 5)
53#endif
54#ifndef MFRC522_PARAM_RST_PIN
55#define MFRC522_PARAM_RST_PIN GPIO_PIN(0, 17)
56#endif
57
58#ifndef MFRC522_PARAMS
59#define MFRC522_PARAMS \
60 { \
61 .spi_dev = MFRC522_PARAM_SPI_DEV, \
62 .spi_clk = MFRC522_PARAM_SPI_CLK, \
63 .sck_pin = MFRC522_PARAM_SCK_PIN, \
64 .miso_pin = MFRC522_PARAM_MISO_PIN, \
65 .mosi_pin = MFRC522_PARAM_MOSI_PIN, \
66 .cs_pin = MFRC522_PARAM_CS_PIN, \
67 .rst_pin = MFRC522_PARAM_RST_PIN, \
68 }
69#endif /* MFRC522_PARAMS */
76{
78};
79
80#ifdef __cplusplus
81}
82#endif
83
84#endif /* MFRC522_PARAMS_H */
static const mfrc522_params_t mfrc522_params[]
Allocate some memory to store the actual configuration.
#define MFRC522_PARAMS
Struct with default configuration parameters.
Register definitions for the MFRC522 controller.
Low-level SPI peripheral driver interface definition.
MFRC522 device initialization parameters.
Definition mfrc522.h:70