Adafruit Tiny LoRa Library
Public Member Functions | Public Attributes | List of all members
TinyLoRa Class Reference

TinyLoRa Class. More...

#include <TinyLoRa.h>

Public Member Functions

void setChannel (rfm_channels_t channel)
 Sets the RFM channel. More...
 
void setDatarate (rfm_datarates_t datarate)
 Sets the RFM datarate. More...
 
void setPower (int8_t Tx_Power=17)
 Sets the TX power. More...
 
 TinyLoRa (int8_t rfm_dio0, int8_t rfm_nss, int8_t rfm_rst)
 Instanciates a new TinyLoRa class, including assigning irq and cs pins to the RFM breakout. More...
 
bool begin (void)
 Initializes the RFM, including configuring SPI, configuring the frameCounter and txrandomNum. More...
 
void sendData (unsigned char *Data, unsigned char Data_Length, unsigned int Frame_Counter_Tx, uint8_t Frame_Port=1)
 Function to assemble and send a LoRaWAN package. More...
 

Public Attributes

uint8_t txrandomNum
 random number for AES
 
uint16_t frameCounter
 frame counter
 

Detailed Description

TinyLoRa Class.

Constructor & Destructor Documentation

◆ TinyLoRa()

TinyLoRa::TinyLoRa ( int8_t  rfm_irq,
int8_t  rfm_nss,
int8_t  rfm_rst 
)

Instanciates a new TinyLoRa class, including assigning irq and cs pins to the RFM breakout.

Parameters
rfm_irqThe RFM module's interrupt pin (rfm_nss).
rfm_nssThe RFM module's slave select pin (rfm_nss).
rfm_rstThe RFM module's reset pin (rfm_rst).

Member Function Documentation

◆ setChannel()

void TinyLoRa::setChannel ( rfm_channels_t  channel)

Sets the RFM channel.

Parameters
channelWhich channel to send data

◆ setDatarate()

void TinyLoRa::setDatarate ( rfm_datarates_t  datarate)

Sets the RFM datarate.

Parameters
datarateBandwidth and Frequency plan.

◆ setPower()

void TinyLoRa::setPower ( int8_t  Tx_Power = 17)

Sets the TX power.

Parameters
Tx_PowerHow much TX power in dBm

◆ begin()

bool TinyLoRa::begin ( void  )

Initializes the RFM, including configuring SPI, configuring the frameCounter and txrandomNum.

Returns
True if the RFM has been initialized

◆ sendData()

void TinyLoRa::sendData ( unsigned char *  Data,
unsigned char  Data_Length,
unsigned int  Frame_Counter_Tx,
uint8_t  Frame_Port = 1 
)

Function to assemble and send a LoRaWAN package.

Parameters
*DataPointer to the array of data to be transmitted.
Frame_Counter_TxFrame counter for transfer frames.
Data_LengthLength of data to be sent.
Frame_PortFrame port to send data from, from 0 to 225.

The documentation for this class was generated from the following files: