10#include "stm32f439xx.h"
16#define LORA_REG_FIFO 0x00
17#define LORA_REG_FIFO_ADDR_PTR 0x0D
18#define LORA_REG_FIFO_TX_BASE_ADDR 0x0E
19#define LORA_REG_FIFO_RX_BASE_ADDR 0x0F
20#define LORA_REG_FIFO_RX_CURR_ADDR 0x10
21#define LORA_REG_IRQ_FLAGS_MASK 0x11
22#define LORA_REG_IRQ_FLAGS 0x12
24#define LORA_REG_OP_MODE 0x01
25#define LORA_REG_OP_MODE_LONG_RANGE_Pos 0x07
26#define LORA_REG_OP_MODE_MODE_Pos 0x00
28#define LORA_REG_MODEM_CONFIG1 0x1D
29#define LORA_REG_MODEM_CONFIG1_BW_Pos 0x06
30#define LORA_REG_MODEM_CONFIG1_CR_Pos 0x03
31#define LORA_REG_MODEM_CONFIG1_CRC_Pos 0x01
33#define LORA_REG_MODEM_CONFIG2 0x1E
34#define LORA_REG_MODEM_CONFIG2_SF_Pos 0x04
36#define LORA_REG_PAYLOAD_LENGTH 0x22
37#define LORA_REG_MAX_PAYLOAD_LENGTH 0x23
39#define RegSymbTimeoutLsb 0x1F
40#define RegPreambleMsb 0x20
41#define RegPreambleLsb 0x21
42#define RegHopPeriod 0x24
43#define RegFifoRxByteAddr 0x25
44#define RegDioMapping1 0x40
45#define RegDioMapping2 0x41
47#define LORA_MSG_LENGTH 0x20
48#define LORA_MSG_PAYLOAD_LENGTH (LORA_MSG_LENGTH - 1)
91 uint8_t
data[LORA_MSG_PAYLOAD_LENGTH];
102void LoRa_writeRegister(
LoRa *, uint8_t, uint8_t);
103uint8_t LoRa_readRegister(
LoRa *, uint8_t);
117LoRa_Packet LoRa_PayloadData(uint8_t, uint8_t, uint8_t *, uint8_t);
uint8_t id
Packet header ID.
uint8_t data[LORA_MSG_PAYLOAD_LENGTH]
Packet payload.
DeviceHandle_t LoRa_init(LoRa *, char[DEVICE_NAME_LENGTH], GPIO_TypeDef *, unsigned long, Bandwidth, SpreadingFactor, CodingRate)
Initializes the LoRa module with specified configuration parameters.
LoRa_Packet LoRa_GPSData(uint8_t, char *, char *, uint8_t)
void _LoRa_setMode(LoRa *, Mode)
Sets the operational mode of the LoRa module.
LoRa_Packet LoRa_AVData(uint8_t, uint8_t, uint8_t *, uint8_t *, uint8_t, uint8_t *, uint8_t, float, float)
Constructs a LoRa packet with accelerometer and gyroscope data, altitude, and velocity for transmissi...
void LoRa_transmit(LoRa *, uint8_t *)
Transmits data using the LoRa module.
void(* transmit)(struct LoRa *, uint8_t *)
LoRa transmit method.
SPI base
Parent SPI interface.
Struct definition for SPI interface. Provides the interface for API consumers to interact with the SP...