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
10#pragma once
11
22
23#include "board.h"
24#include "sx1280.h"
25#include "sx1280_constants.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
45
46#ifndef USE_RX_CONTINUOUS_MODE
47#define USE_RX_CONTINUOUS_MODE
48#endif
49
50#ifdef USE_RX_CONTINUOUS_MODE
51#define SX1280_RX_MODE SX1280_RX_CONTINUOUS_MODE
52#else
53#define SX1280_RX_MODE SX1280_RX_SINGLE_MODE
54#endif
55
56#ifndef SX1280_PARAM_SPI
57#define SX1280_PARAM_SPI SPI_DEV(0)
58#endif
59
60#ifndef SX1280_PARAM_SPI_CLK
61#define SX1280_PARAM_SPI_CLK SPI_CLK_5MHZ
62#endif
63
64#ifndef SX1280_PARAM_SPI_MODE
65#define SX1280_PARAM_SPI_MODE SPI_MODE_0
66#endif
67
68#ifndef SX1280_PARAM_SPI_NSS
69#define SX1280_PARAM_SPI_NSS GPIO_PIN(1, 6)
70#endif
71
72#ifndef SX1280_PARAM_RESET
73#define SX1280_PARAM_RESET GPIO_PIN(0, 8)
74#endif
75
76#ifndef SX1280_PARAM_DIO0
77#define SX1280_PARAM_DIO0 GPIO_PIN(1, 10)
78#endif
79
80#ifndef SX1280_PARAM_DIO1
81#define SX1280_PARAM_DIO1 GPIO_PIN(2, 7)
82#endif
83
87#define SX1280_PARAMS { .spi = SX1280_PARAM_SPI, \
88 .spi_mode = SX1280_PARAM_SPI_MODE, \
89 .spi_clk = SX1280_PARAM_SPI_CLK, \
90 .nss_pin = SX1280_PARAM_SPI_NSS, \
91 .reset_pin = SX1280_PARAM_RESET, \
92 .dio0_pin = SX1280_PARAM_DIO0, \
93 .dio1_pin = SX1280_PARAM_DIO1, \
94}
95
97
102{
104};
105
106#ifdef __cplusplus
107}
108#endif
109
Device initialization parameters.
Definition sx1280.h:58
Internal addresses, registers and constants.
#define SX1280_PARAMS
Default sx1280 parameters.
static const sx1280_params_t sx1280_params[]
Configuration struct.