Loading...
Searching...
No Matches
SX1272

SX1272 LoRa device driver. More...

Data Structures

struct  SX1272_Packet
 
struct  SX1272_t
 Struct definition for SX1272. Provides the interface for API consumers to interact with the SX1272 LoRa transceiver. More...
 

Enumerations

enum  SX1272_Bandwidth
 SX1272 bandwidth enum. More...
 
enum  SX1272_CodingRate
 SX1272 coding rate enum. More...
 
enum  SX1272_SpreadingFactor
 SX1272 spreading factor enum. More...
 
enum  SX1272_Mode
 SX1272 operating mode enum. More...
 

Functions

SX1272_t SX1272_init (SX1272_t *, SPI_t *, GPIOpin_t, SX1272_Bandwidth, SX1272_SpreadingFactor, SX1272_CodingRate)
 Initializes the LoRa module with specified configuration parameters.
 
void SX1272_enableBoost (SX1272_t *, bool)
 Enables/disables power amplifier boost.
 
void SX1272_standby (SX1272_t *)
 Sets the operational mode of the LoRa module to standby.
 
void SX1272_transmit (SX1272_t *, uint8_t *)
 Transmits data using the SX1272.
 
void SX1272_startReceive (SX1272_t *)
 Begins continuous receive on the SX1272.
 
bool SX1272_readReceive (SX1272_t *, uint8_t *, uint8_t)
 Reads contents of received packet to local buffer from the SX1272.
 
void SX1272_clearIRQ (SX1272_t *, uint8_t)
 Sets the value of RegIrqFlags in the SX1272 to the provided argument value. Writing a 1 to a bit in the register will clear the associated flag.
 
void _SX1272_setMode (SX1272_t *, SX1272_Mode)
 Sets the operational mode of the LoRa module.
 

Detailed Description

SX1272 LoRa device driver.


Data Structure Documentation

◆ SX1272_Packet

struct SX1272_Packet

Definition at line 124 of file sx1272.h.

Data Fields
uint8_t id Packet header ID.
uint8_t data[LORA_MSG_PAYLOAD_LENGTH] Packet payload.

◆ SX1272_t

struct SX1272_t

Struct definition for SX1272. Provides the interface for API consumers to interact with the SX1272 LoRa transceiver.

Definition at line 133 of file sx1272.h.

Data Fields
SPI_t * base Parent SPI interface.
GPIOpin_t cs Chip select GPIO.
SX1272_Mode currentMode Current operating mode.
void(*)(struct SX1272 *, bool) enableBoost Power amp boost toggle method.
See also
SX1272_enableBoost
void(*)(struct SX1272 *) standby SX1272 standby method.
See also
SX1272_standby
void(*)(struct SX1272 *, uint8_t *) transmit SX1272 LoRa transmit method.
See also
SX1272_transmit
void(*)(struct SX1272 *) startReceive SX1272 LoRa continuous receive method.
See also
SX1272_startReceive
bool(*)(struct SX1272 *, uint8_t *, uint8_t) readReceive SX1272 LoRa receive buffer read method.
See also
SX1272_readReceiveBuffer
void(*)(struct SX1272 *, uint8_t) clearIRQ SX1272 LoRa IRQ flag clear method.
See also
SX1272_clearIRQ

Enumeration Type Documentation

◆ SX1272_Bandwidth

SX1272 bandwidth enum.

Describes the occupied signal bandwidth

Definition at line 76 of file sx1272.h.

◆ SX1272_CodingRate

SX1272 coding rate enum.

Describes the LoRa coding rate TODO: describe what coding rate actually does

Definition at line 87 of file sx1272.h.

◆ SX1272_SpreadingFactor

SX1272 spreading factor enum.

Describes the LoRa spreading factor TODO: describe what spreading factor actually does

Definition at line 99 of file sx1272.h.

◆ SX1272_Mode

SX1272 operating mode enum.

Describes the available operating modes on the transceiver

Definition at line 113 of file sx1272.h.

Function Documentation

◆ SX1272_init()

Initializes the LoRa module with specified configuration parameters.

Parameters
*loraPointer to LoRa struct to be initialised.
*spiPointer to SPI peripheral struct.
csDevice chip select GPIO.
bwBandwidth setting for the LoRa module.
sfSpreading factor for the LoRa module.
crCoding rate for the LoRa module.
Returns
Ininitialised SX1272 device struct.

Definition at line 27 of file sx1272.c.

◆ SX1272_enableBoost()

void SX1272_enableBoost ( SX1272_t * lora,
bool enable )

Enables/disables power amplifier boost.

Parameters
*loraPointer to LoRa struct.
enableBoolean value for the enable toggle.
Returns
NULL.

Definition at line 114 of file sx1272.c.

◆ SX1272_standby()

void SX1272_standby ( SX1272_t * lora)

Sets the operational mode of the LoRa module to standby.

Parameters
*loraPointer to LoRa struct.
Returns
NULL.

Definition at line 129 of file sx1272.c.

◆ SX1272_transmit()

void SX1272_transmit ( SX1272_t * lora,
uint8_t * pointerdata )

Transmits data using the SX1272.

Parameters
loraPointer to SX1272 struct.
pointerdataPointer to the data to be transmitted.

Definition at line 141 of file sx1272.c.

◆ SX1272_startReceive()

void SX1272_startReceive ( SX1272_t * lora)

Begins continuous receive on the SX1272.

Parameters
loraPointer to SX1272 struct.

Definition at line 181 of file sx1272.c.

◆ SX1272_readReceive()

bool SX1272_readReceive ( SX1272_t * lora,
uint8_t * buffer,
uint8_t buffSize )

Reads contents of received packet to local buffer from the SX1272.

Parameters
loraPointer to SX1272 struct.
bufferPointer to the buffer to store received data.
buffSizeInteger representing the size of the buffer to to fill.
Returns
Boolean value indicating if a packet was successfully received and returned in buffer.

Definition at line 221 of file sx1272.c.

◆ SX1272_clearIRQ()

void SX1272_clearIRQ ( SX1272_t * lora,
uint8_t flags )

Sets the value of RegIrqFlags in the SX1272 to the provided argument value. Writing a 1 to a bit in the register will clear the associated flag.

Parameters
loraPointer to SX1272 struct.
flags8-bit value representing flag bits to be set.
Returns
NULL

Definition at line 261 of file sx1272.c.

◆ _SX1272_setMode()

void _SX1272_setMode ( SX1272_t * lora,
SX1272_Mode mode )

Sets the operational mode of the LoRa module.

Parameters
*loraPointer to LoRa struct.
modeDesired operational mode to be set.
Returns
NULL.

Definition at line 93 of file sx1272.c.