6#include "../../hal/spi_module.h"
31#define RFM69_FXOSC 32000000.0
32#define RFM69_FSTEP (RFM69_FXOSC / 524288)
35#define SX1231_VERSION 0x23
36#define RFM69_VERSION 0x24
40 RFM69_REG_OP_MODE = 0x01,
41 RFM69_REG_DATA_MODUL = 0x02,
42 RFM69_REG_BITRATE_MSB = 0x03,
43 RFM69_REG_BITRATE_LSB = 0x04,
44 RFM69_REG_FRF_MSB = 0x07,
45 RFM69_REG_FRF_MID = 0x08,
46 RFM69_REG_FRF_LSB = 0x09,
47 RFM69_REG_VERSION = 0x10,
48 RFM69_REG_PA_LEVEL = 0x11,
50 RFM69_REG_RX_BW = 0x19,
51 RFM69_REG_OOK_PEAK = 0x1B,
52 RFM69_REG_OOK_FIX = 0x1D,
53 RFM69_REG_IRQ_FLAGS_1 = 0x27,
54 RFM69_REG_TEST_PA_1 = 0x5A,
55 RFM69_REG_TEST_PA_2 = 0x5C,
61 RFM69_MODE_SLEEP = 0x00,
62 RFM69_MODE_STDBY = 0x04,
70 RFM69_DATA_MODE = 0x60,
71 RFM69_DATA_MODE_PACKET = 0x00,
72 RFM69_DATA_MODE_CONTINUOUS_SYNC = 0x40,
73 RFM69_DATA_MODE_CONTINUOUS = 0x60,
74 RFM69_MODULATION_TYPE = 0x08,
75 RFM69_MODULATION_TYPE_FSK = 0x00,
76 RFM69_MODULATION_TYPE_OOK = 0x08,
77 RFM69_MODULATION_SHAPING = 0x03,
78 RFM69_MODULATION_SHAPING_NONE = 0x00,
89 RFM69_OUTPUT_POWER = 0x1F,
100 RFM69_RX_BW_MANT = 0x18,
101 RFM69_RX_BW_MANT_16 = 0x00,
102 RFM69_RX_BW_MANT_20 = 0x08,
103 RFM69_RX_BW_MANT_24 = 0x10,
104 RFM69_RX_BW_EXP = 0x07,
109 RFM69_RXBW_1_3 = 0x17,
110 RFM69_RXBW_1_6 = 0x0F,
111 RFM69_RXBW_2_0 = 0x07,
112 RFM69_RXBW_2_6 = 0x16,
113 RFM69_RXBW_3_1 = 0x0E,
114 RFM69_RXBW_3_9 = 0x06,
115 RFM69_RXBW_5_2 = 0x15,
116 RFM69_RXBW_6_3 = 0x0D,
117 RFM69_RXBW_7_8 = 0x05,
118 RFM69_RXBW_10_4 = 0x14,
119 RFM69_RXBW_12_5 = 0x0C,
120 RFM69_RXBW_15_6 = 0x04,
121 RFM69_RXBW_20_8 = 0x13,
122 RFM69_RXBW_25 = 0x0B,
123 RFM69_RXBW_31_3 = 0x03,
124 RFM69_RXBW_41_7 = 0x12,
125 RFM69_RXBW_50 = 0x0A,
126 RFM69_RXBW_62_5 = 0x02,
127 RFM69_RXBW_83_3 = 0x11,
128 RFM69_RXBW_100 = 0x09,
129 RFM69_RXBW_125 = 0x01,
130 RFM69_RXBW_166_7 = 0x10,
131 RFM69_RXBW_200 = 0x08,
132 RFM69_RXBW_250 = 0x00,
137 RFM69_OOK_THRESH_TYPE = 0xC0,
138 RFM69_OOK_THRESH_TYPE_FIXED = 0x00,
139 RFM69_OOK_THRESH_TYPE_PEAK = 0x40,
140 RFM69_OOK_THRESH_TYPE_AVERAGE = 0x80,
145 RFM69_MODE_READY = 0x80,
150 RFM69_TEST_PA_1_NORMAL = 0x55,
151 RFM69_TEST_PA_1_BOOST = 0x5D,
156 RFM69_TEST_PA_2_NORMAL = 0x70,
157 RFM69_TEST_PA_2_BOOST = 0x7C,
172void rfm69_set_data_mode(
struct rfm69 *radio, uint8_t
mode);
173void rfm69_set_modulation_type(
struct rfm69 *radio, uint8_t modulation);
174void rfm69_set_frequency(
struct rfm69 *radio,
unsigned long freq);
175void rfm69_set_bitrate(
struct rfm69 *radio, uint16_t bitrate);
176void rfm69_set_rx_bandwidth(
struct rfm69 *radio, uint32_t bw);
177void rfm69_set_transmit_power(
struct rfm69 *radio, int8_t power,
bool high_power);
178void rfm69_set_mode(
struct rfm69 *radio, uint8_t
mode);
An SPI-attached SX1231 or RFM69 radio module.
Definition rfm69.h:24
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