27#include "platform/Callback.h"
503 uint32_t datarate, uint8_t coderate,
504 uint32_t bandwidth_afc, uint16_t preamble_len,
505 uint16_t symb_timeout,
bool fix_len,
507 bool crc_on,
bool freq_hop_on, uint8_t hop_period,
508 bool iq_inverted,
bool rx_continuous) = 0;
540 uint32_t bandwidth, uint32_t datarate,
541 uint8_t coderate, uint16_t preamble_len,
542 bool fix_len,
bool crc_on,
bool freq_hop_on,
543 uint8_t hop_period,
bool iq_inverted, uint32_t timeout) = 0;
553 virtual void send(uint8_t *buffer, uint8_t size) = 0;
632 int16_t rssi_threshold,
633 uint32_t max_carrier_sense_time) = 0;
Interface for the radios, containing the main functions that a radio needs, and five callback functio...
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)=0
Sets the radio to continuous wave transmission mode.
virtual bool check_rf_frequency(uint32_t frequency)=0
Checks whether the given RF is in range.
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth, uint32_t datarate, uint8_t coderate, uint32_t bandwidth_afc, uint16_t preamble_len, uint16_t symb_timeout, bool fix_len, uint8_t payload_len, bool crc_on, bool freq_hop_on, uint8_t hop_period, bool iq_inverted, bool rx_continuous)=0
Sets reception parameters.
virtual void init_radio(radio_events_t *events)=0
Registers radio events with the Mbed LoRaWAN stack and undergoes initialization steps,...
virtual void lock(void)=0
Acquires exclusive access to this radio.
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)=0
Computes the packet time on air for the given payload.
virtual void set_channel(uint32_t freq)=0
Sets the carrier frequency.
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev, uint32_t bandwidth, uint32_t datarate, uint8_t coderate, uint16_t preamble_len, bool fix_len, bool crc_on, bool freq_hop_on, uint8_t hop_period, bool iq_inverted, uint32_t timeout)=0
Sets the transmission parameters.
virtual void unlock(void)=0
Releases exclusive access to this radio.
virtual void receive(void)=0
Sets the radio to reception mode.
virtual uint32_t random(void)=0
Generates a 32 bit random value based on RSSI readings.
virtual void set_public_network(bool enable)=0
Sets the network to public or private.
virtual radio_state_t get_status(void)=0
Gets the radio status.
virtual void standby(void)=0
Sets the radio to standby mode.
virtual void start_cad(void)=0
Sets the radio to CAD mode.
virtual void send(uint8_t *buffer, uint8_t size)=0
Sends the packet.
virtual void radio_reset()=0
Resets the radio module.
virtual bool perform_carrier_sense(radio_modems_t modem, uint32_t freq, int16_t rssi_threshold, uint32_t max_carrier_sense_time)=0
Performs carrier sensing.
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)=0
Sets the maximum payload length.
virtual void sleep(void)=0
Put the RF module in sleep mode.
Callback class based on template specialization.
struct radio_lora_settings radio_lora_settings_t
LoRa modem parameters.
struct radio_lora_packet_handler radio_lora_packet_handler_t
LoRa packet Contains information about a LoRa packet.
enum radio_state radio_state_t
Radio driver internal state.
enum modem_type radio_modems_t
Type of modem.
struct radio_fsk_packet_handler radio_fsk_packet_handler_t
FSK packet handle.
struct radio_settings radio_settings_t
Global radio settings.
radio_state
Radio driver internal state.
struct radio_fsk_settings radio_fsk_settings_t
FSK modem parameters.
struct radio_events radio_events_t
Reporting functions for upper layers.
@ MODEM_LORA
LoRa operation mode.
@ MODEM_FSK
FSK operation mode.
Reporting functions for upper layers.
mbed::Callback< void()> tx_timeout
Callback when Transmission is timed out.
mbed::Callback< void(uint8_t current_channel)> fhss_change_channel
FHSS Change Channel callback prototype.
mbed::Callback< void()> rx_error
Callback when Reception ends up in error.
mbed::Callback< void(bool channel_busy)> cad_done
CAD Done callback prototype.
mbed::Callback< void(const uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr)> rx_done
Rx Done callback prototype.
mbed::Callback< void()> tx_done
Callback when Transmission is done.
mbed::Callback< void()> rx_timeout
Callback when Reception is timed out.
uint16_t nb_bytes
Keeps track of number of bytes already read from the RX FIFO.
int16_t rssi_value
Storage for RSSI value of the received signal.
int32_t afc_value
Automated frequency correction value.
uint8_t fifo_thresh
Stores the FIFO threshold value.
uint8_t chunk_size
Defines the size of a chunk of outgoing buffer written to the FIFO at a unit time.
uint8_t rx_gain
LNA gain value (dbm).
uint8_t sync_word_detected
Set to true (1) when a SyncWord is detected, otherwise false (0).
uint16_t size
Size of the received data in bytes.
uint8_t preamble_detected
Set to true (1) when a Preamble is detected, otherwise false (0).
uint32_t rx_single_timeout
Timeout value in symbols (symb) after which the radio driver reports a timeout if the radio did not r...
uint32_t tx_timeout
Timeout value in milliseconds (ms) after which the radio driver reports a timeout if the radio was un...
uint16_t preamble_len
Expected preamble length.
bool fix_len
This flag turns on if the TX data size is fixed.
uint32_t bandwidth_afc
Automated frequency correction bandwidth.
uint32_t bandwidth
Modulation bandwidth.
int8_t power
Transmit power.
bool crc_on
Turn CRC on/off.
uint32_t datarate
Data rate (SF).
uint8_t payload_len
Size of outgoing data.
uint32_t f_dev
Frequency deviation.
bool rx_continuous
Turn continuous reception mode (such as Class C mode) on/off.
LoRa packet Contains information about a LoRa packet.
int16_t rssi_value
RSSI value in dBm for the received packet.
uint8_t size
Size of the transmitted or received packet.
int8_t snr_value
Signal-to-noise ratio of a received packet.
bool low_datarate_optimize
Turn low data rate optimization on/off.
uint32_t tx_timeout
Timeout in milliseconds (ms) after which the radio driver reports an error if the radio was unable to...
uint16_t preamble_len
Preamble length in symbols.
bool fix_len
Set to true if the outgoing payload length is fixed.
bool iq_inverted
Turn IQ inversion on/off.
uint32_t bandwidth
Modulation bandwidth.
bool public_network
Change the network mode to Public or Private.
int8_t power
Transmit power.
uint8_t coderate
Error correction code rate.
bool freq_hop_on
Turn frequency hopping on/off.
bool crc_on
Turn CRC on/off.
uint8_t hop_period
Number of symbols between two frequency hops.
uint32_t datarate
Data rate (SF).
uint8_t payload_len
Size of outgoing payload.
bool rx_continuous
Turn continuous reception mode (such as in Class C) on/off.
uint32_t channel
Current channel of operation.
radio_state_t state
Current state of the radio, such as RF_IDLE.
radio_lora_settings_t lora
Settings for LoRa modem part.
radio_fsk_packet_handler_t fsk_packet_handler
FSK packet and meta data.
radio_lora_packet_handler_t lora_packet_handler
LoRa packet and metadata.
uint8_t modem
Current modem operation, such as MODEM_LORA.
radio_fsk_settings_t fsk
Settings for FSK modem part.
Structure to hold RF controls for LoRa Radio.
PinName rf_switch_ctl1
TX latch switch pin.
PinName rf_switch_ctl2
RX latch switch pin.
PinName ant_switch
Transceiver switch pin.
PinName rxctl
RX control pin for transceiver packaged as a module.
PinName tcxo
TCXO crystal control pin.
PinName pwr_amp_ctl
Power amplifier control pin.
PinName txctl
TX control pin for transceiver packaged as a module.