6#include "../../hal/spi_module.h"
31#define SX1278_FXOSC 32000000.0
32#define SX1278_FSTEP (SX1278_FXOSC / 524288)
36 SX1278_REG_OP_MODE = 0x01,
37 SX1278_REG_BITRATE_MSB = 0x02,
38 SX1278_REG_BITRATE_LSB = 0x03,
39 SX1278_REG_FRF_MSB = 0x06,
40 SX1278_REG_FRF_MID = 0x07,
41 SX1278_REG_FRF_LSB = 0x08,
42 SX1278_REG_PA_CONFIG = 0x09,
43 SX1278_REG_PA_RAMP = 0x0A,
44 SX1278_REG_OCP = 0x0B,
45 SX1278_REG_RX_BW = 0x12,
46 SX1278_REG_OOK_PEAK = 0x14,
47 SX1278_REG_OOK_FIX = 0x15,
48 SX1278_REG_PACKET_CONFIG_2 = 0x31,
49 SX1278_REG_IRQ_FLAGS_1 = 0x3E,
50 SX1278_REG_DIO_MAPPING_1 = 0x40,
51 SX1278_REG_VERSION = 0x42,
52 SX1278_REG_PA_DAC = 0x4D,
57 SX1278_LONG_RANGE_MODE = 0x80,
58 SX1278_LONG_RANGE_MODE_OFF = 0x00,
59 SX1278_LONG_RANGE_MODE_ON = 0x80,
60 SX1278_MODULATION_TYPE = 0x60,
61 SX1278_MODULATION_TYPE_FSK = 0x00,
62 SX1278_MODULATION_TYPE_OOK = 0x20,
63 SX1278_LOW_FREQUENCY_MODE = 0x08,
64 SX1278_LOW_FREQUENCY_MODE_OFF = 0x00,
65 SX1278_LOW_FREQUENCY_MODE_ON = 0x08,
67 SX1278_MODE_SLEEP = 0x00,
68 SX1278_MODE_STDBY = 0x01,
69 SX1278_MODE_FSTX = 0x02,
70 SX1278_MODE_TX = 0x03,
71 SX1278_MODE_FSRX = 0x04,
72 SX1278_MODE_RX = 0x05,
77 SX1278_PA_SELECT = 0x80,
78 SX1278_PA_SELECT_RFO = 0x00,
79 SX1278_PA_SELECT_PA_BOOST = 0x80,
80 SX1278_MAX_POWER = 0x70,
81 SX1278_MAX_POWER_MAX = 0x70,
82 SX1278_MAX_POWER_LOW = 0x20,
83 SX1278_OUTPUT_POWER = 0x0F,
88 SX1278_RX_BW_MANT = 0x18,
89 SX1278_RX_BW_MANT_16 = 0x00,
90 SX1278_RX_BW_MANT_20 = 0x08,
91 SX1278_RX_BW_MANT_24 = 0x10,
92 SX1278_RX_BW_EXP = 0x07,
97 SX1278_BIT_SYNC = 0x20,
98 SX1278_BIT_SYNC_ON = 0x20,
99 SX1278_BIT_SYNC_OFF = 0x00,
100 SX1278_OOK_THRESH_TYPE = 0x18,
101 SX1278_OOK_THRESH_TYPE_FIXED = 0x00,
102 SX1278_OOK_THRESH_TYPE_PEAK = 0x08,
103 SX1278_OOK_THRESH_TYPE_AVERAGE = 0x10,
108 SX1278_DATA_MODE = 0x40,
109 SX1278_DATA_MODE_CONTINUOUS = 0x00,
110 SX1278_DATA_MODE_PACKET = 0x40,
115 SX1278_MODE_READY = 0x80,
120 SX1278_PA_DAC = 0x07,
121 SX1278_PA_DAC_ENABLED = 0x07,
122 SX1278_PA_DAC_DISABLED = 0x04,
137void sx1278_set_long_range_mode(
struct sx1278 *radio,
bool long_range_mode);
138void sx1278_set_data_mode(
struct sx1278 *radio,
int mode);
139void sx1278_set_modulation_type(
struct sx1278 *radio,
int modulation);
140void sx1278_set_bit_sync_on(
struct sx1278 *radio,
bool bit_sync_on);
141void sx1278_set_frequency(
struct sx1278 *radio,
int freq);
142void sx1278_set_bitrate(
struct sx1278 *radio,
int bitrate);
143void sx1278_set_rx_bandwidth(
struct sx1278 *radio,
int bw);
144void sx1278_set_transmit_power(
struct sx1278 *radio,
int power,
bool use_pa_boost);
145void sx1278_set_mode(
struct sx1278 *radio,
int mode);
Hardware abstraction layer for userland SPI drivers.
Definition spi_module.h:22
uint8_t mode
The SPI mode to use for transfers.
Definition spi_module.h:36
An SPI-attached SX1278 or RFM96 radio module.
Definition sx1278.h:24