Loading...
Searching...
No Matches
sx1280_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 Inria
3 * Copyright (C) 2020-2022 Université Grenoble Alpes
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
21#ifndef SX1280_PARAMS_H
22#define SX1280_PARAMS_H
23
24#include "board.h"
25#include "sx1280.h"
26#include "sx1280_constants.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
47#ifndef USE_RX_CONTINUOUS_MODE
48#define USE_RX_CONTINUOUS_MODE
49#endif
50
51#ifdef USE_RX_CONTINUOUS_MODE
52#define SX1280_RX_MODE SX1280_RX_CONTINUOUS_MODE
53#else
54#define SX1280_RX_MODE SX1280_RX_SINGLE_MODE
55#endif
56
57#ifndef SX1280_PARAM_SPI
58#define SX1280_PARAM_SPI SPI_DEV(0)
59#endif
60
61#ifndef SX1280_PARAM_SPI_CLK
62#define SX1280_PARAM_SPI_CLK SPI_CLK_5MHZ
63#endif
64
65#ifndef SX1280_PARAM_SPI_MODE
66#define SX1280_PARAM_SPI_MODE SPI_MODE_0
67#endif
68
69#ifndef SX1280_PARAM_SPI_NSS
70#define SX1280_PARAM_SPI_NSS GPIO_PIN(1, 6)
71#endif
72
73#ifndef SX1280_PARAM_RESET
74#define SX1280_PARAM_RESET GPIO_PIN(0, 8)
75#endif
76
77#ifndef SX1280_PARAM_DIO0
78#define SX1280_PARAM_DIO0 GPIO_PIN(1, 10)
79#endif
80
81#ifndef SX1280_PARAM_DIO1
82#define SX1280_PARAM_DIO1 GPIO_PIN(2, 7)
83#endif
84
85
89#define SX1280_PARAMS { .spi = SX1280_PARAM_SPI, \
90 .spi_mode = SX1280_PARAM_SPI_MODE, \
91 .spi_clk = SX1280_PARAM_SPI_CLK, \
92 .nss_pin = SX1280_PARAM_SPI_NSS, \
93 .reset_pin = SX1280_PARAM_RESET, \
94 .dio0_pin = SX1280_PARAM_DIO0, \
95 .dio1_pin = SX1280_PARAM_DIO1, \
96}
97
104{
106};
107
108#ifdef __cplusplus
109}
110#endif
111
112#endif /* SX1280_PARAMS_H */
Device initialization parameters.
Definition sx1280.h:59
Internal addresses, registers and constants.
#define SX1280_PARAMS
Default sx1280 parameters.
static const sx1280_params_t sx1280_params[]
Configuration struct.