Loading...
Searching...
No Matches
sx127x_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Inria
3 * 2017 Inria Chile
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
20#ifndef SX127X_PARAMS_H
21#define SX127X_PARAMS_H
22
23#include "board.h"
24#include "sx127x.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
35#ifndef SX127X_PARAM_SPI
36#define SX127X_PARAM_SPI (SPI_DEV(0))
37#endif
38
39#ifndef SX127X_PARAM_SPI_NSS
40#define SX127X_PARAM_SPI_NSS GPIO_PIN(1, 6) /* D10 */
41#endif
42
43#ifndef SX127X_PARAM_RESET
44#define SX127X_PARAM_RESET GPIO_PIN(0, 0) /* A0 */
45#endif
46
47#ifndef SX127X_PARAM_DIO0
48#define SX127X_PARAM_DIO0 GPIO_PIN(0, 10) /* D2 */
49#endif
50
51#ifndef SX127X_PARAM_DIO1
52#define SX127X_PARAM_DIO1 GPIO_PIN(1, 3) /* D3 */
53#endif
54
55#ifndef SX127X_PARAM_DIO2
56#define SX127X_PARAM_DIO2 GPIO_PIN(1, 5) /* D4 */
57#endif
58
59#ifndef SX127X_PARAM_DIO3
60#define SX127X_PARAM_DIO3 GPIO_PIN(1, 4) /* D5 */
61#endif
62
63#ifndef SX127X_PARAM_PASELECT
64#define SX127X_PARAM_PASELECT (SX127X_PA_RFO)
65#endif
66
67#ifndef SX127X_PARAM_TX_SWITCH
68#define SX127X_PARAM_TX_SWITCH GPIO_UNDEF
69#endif
70
71#ifndef SX127X_PARAM_RX_SWITCH
72#define SX127X_PARAM_RX_SWITCH GPIO_UNDEF
73#endif
74
75#ifndef SX127X_PARAMS
76#if defined(SX127X_USE_TX_SWITCH) || defined(SX127X_USE_RX_SWITCH)
77#define SX127X_PARAMS { .spi = SX127X_PARAM_SPI, \
78 .nss_pin = SX127X_PARAM_SPI_NSS, \
79 .reset_pin = SX127X_PARAM_RESET, \
80 .dio0_pin = SX127X_PARAM_DIO0, \
81 .dio1_pin = SX127X_PARAM_DIO1, \
82 .dio2_pin = SX127X_PARAM_DIO2, \
83 .dio3_pin = SX127X_PARAM_DIO3, \
84 .rx_switch_pin = SX127X_PARAM_RX_SWITCH, \
85 .tx_switch_pin = SX127X_PARAM_TX_SWITCH, \
86 .paselect = SX127X_PARAM_PASELECT }
87#else
88#define SX127X_PARAMS { .spi = SX127X_PARAM_SPI, \
89 .nss_pin = SX127X_PARAM_SPI_NSS, \
90 .reset_pin = SX127X_PARAM_RESET, \
91 .dio0_pin = SX127X_PARAM_DIO0, \
92 .dio1_pin = SX127X_PARAM_DIO1, \
93 .dio2_pin = SX127X_PARAM_DIO2, \
94 .dio3_pin = SX127X_PARAM_DIO3, \
95 .paselect = SX127X_PARAM_PASELECT }
96#endif
97#endif
104{
105 SX127X_PARAMS
106};
107
108#ifdef __cplusplus
109}
110#endif
111
112#endif /* SX127X_PARAMS_H */
static const sx127x_params_t sx127x_params[]
Board specific SX127X configuration.
SX127X hardware and global parameters.
Definition sx127x.h:214
Public interface for SX127X driver.