Mistake on this page?
Report an issue in GitHub or email us
LoRaRadio.h
1 /**
2  * Copyright (c) 2017, Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef LORARADIO_H_
19 #define LORARADIO_H_
20 
21 /** @addtogroup LoRaWAN
22  * Parent class for a LoRa radio driver
23  * @{
24  */
25 
26 #include "platform/Callback.h"
27 #include "PinNames.h"
28 
29 /**
30  * Structure to hold RF controls for LoRa Radio.
31  * SX1276 have an extra control for the crystal (used in DISCO-L072CZ).
32  * A subset of these pins may be used by the driver in accordance with the physical
33  * implementation.
34  */
35 typedef struct {
36  /** TX latch switch pin.
37  * Exact operation is implementation specific.
38  */
39  PinName rf_switch_ctl1;
40 
41  /** RX latch switch pin.
42  * Exact operation is implementation specific.
43  */
44  PinName rf_switch_ctl2;
45 
46  /** TX control pin for transceiver packaged as a module.
47  * Exact operation is implementation specific.
48  */
49  PinName txctl;
50 
51  /** RX control pin for transceiver packaged as a module.
52  * Exact operation is implementation specific.
53  */
54  PinName rxctl;
55 
56  /** Transceiver switch pin.
57  * Exact operation is implementation specific. One of the polarities of the
58  * pin may drive the transceiver in either TX or RX mode.
59  */
60  PinName ant_switch;
61 
62  /** Power amplifier control pin.
63  * Exact operation is implementation specific. If defined,
64  * controls the operation of an external power amplifier.
65  */
66  PinName pwr_amp_ctl;
67 
68  /** TCXO crystal control pin.
69  * Exact operation is implementation specific.
70  */
71  PinName tcxo;
72 } rf_ctrls;
73 
74 /** Radio driver internal state.
75  * Helps identify current state of the transceiver.
76  */
77 typedef enum radio_state {
78  /** IDLE state.
79  * Radio is in idle state.
80  */
81  RF_IDLE = 0,
82 
83  /** RX state.
84  * Radio is receiving.
85  */
87 
88  /** TX state.
89  * Radio is transmitting.
90  */
92 
93  /** CAD state.
94  * Radio is detecting channel activity.
95  */
98 
99 /** Type of modem.
100  * [LORA/FSK]
101  */
102 typedef enum modem_type {
103  /** FSK operation mode.
104  * Radio is using FSK modulation.
105  */
107 
108  /** LoRa operation mode.
109  * Radio is using LoRa modulation.
110  */
113 
114 /** FSK modem parameters.
115  * Parameters encompassing FSK modulation.
116  */
117 typedef struct radio_fsk_settings {
118  /**
119  * Transmit power.
120  */
121  int8_t power;
122 
123  /**
124  * Frequency deviation.
125  */
126  uint32_t f_dev;
127 
128  /**
129  * Modulation bandwidth.
130  */
131  uint32_t bandwidth;
132 
133  /**
134  * Automated frequency correction bandwidth.
135  */
136  uint32_t bandwidth_afc;
137 
138  /**
139  * Data rate (SF).
140  */
141  uint32_t datarate;
142 
143  /**
144  * Expected preamble length.
145  */
146  uint16_t preamble_len;
147 
148  /**
149  * This flag turns on if the TX data size is fixed.
150  */
151  bool fix_len;
152 
153  /**
154  * Size of outgoing data.
155  */
156  uint8_t payload_len;
157 
158  /**
159  * Turn CRC on/off.
160  */
161  bool crc_on;
162 
163  /** @deprecated
164  * Does not apply to FSK. Will be removed.
165  */
167 
168  /**
169  * Turn continuous reception mode (such as Class C mode) on/off.
170  */
172 
173  /**
174  * Timeout value in milliseconds (ms) after which the radio driver reports
175  * a timeout if the radio was unable to transmit.
176  */
177  uint32_t tx_timeout;
178 
179  /**
180  * Timeout value in symbols (symb) after which the radio driver reports a timeout
181  * if the radio did not receive a Preamble.
182  */
185 
186 /** FSK packet handle.
187  * Contains information about an FSK packet and various metadata.
188  */
189 typedef struct radio_fsk_packet_handler {
190  /**
191  * Set to true (1) when a Preamble is detected, otherwise false (0).
192  */
194 
195  /**
196  * Set to true (1) when a SyncWord is detected, otherwise false (0).
197  */
199 
200  /**
201  * Storage for RSSI value of the received signal.
202  */
203  int8_t rssi_value;
204 
205  /**
206  * Automated frequency correction value.
207  */
208  int32_t afc_value;
209 
210  /**
211  * LNA gain value (dbm).
212  */
213  uint8_t rx_gain;
214 
215  /**
216  * Size of the received data in bytes.
217  */
218  uint16_t size;
219 
220  /**
221  * Keeps track of number of bytes already read from the RX FIFO.
222  */
223  uint16_t nb_bytes;
224 
225  /**
226  * Stores the FIFO threshold value.
227  */
228  uint8_t fifo_thresh;
229 
230  /**
231  * Defines the size of a chunk of outgoing buffer written to
232  * the FIFO at a unit time. For example, if the size of the data exceeds the FIFO
233  * limit, a certain sized chunk is written to the FIFO. Later, a FIFO-level
234  * interrupt enables writing of the remaining data to the FIFO chunk by chunk until
235  * transmission is complete.
236  */
237  uint8_t chunk_size;
239 
240 /** LoRa modem parameters.
241  * Parameters encompassing LoRa modulation.
242  */
243 typedef struct radio_lora_settings {
244  /**
245  * Transmit power.
246  */
247  int8_t power;
248 
249  /**
250  * Modulation bandwidth.
251  */
252  uint32_t bandwidth;
253 
254  /**
255  * Data rate (SF).
256  */
257  uint32_t datarate;
258 
259  /**
260  * Turn low data rate optimization on/off.
261  */
263 
264  /**
265  * Error correction code rate.
266  */
267  uint8_t coderate;
268 
269  /**
270  * Preamble length in symbols.
271  */
272  uint16_t preamble_len;
273 
274  /**
275  * Set to true if the outgoing payload length is fixed.
276  */
277  bool fix_len;
278 
279  /**
280  * Size of outgoing payload.
281  */
282  uint8_t payload_len;
283 
284  /**
285  * Turn CRC on/off.
286  */
287  bool crc_on;
288 
289  /**
290  * Turn frequency hopping on/off.
291  */
293 
294  /**
295  * Number of symbols between two frequency hops.
296  */
297  uint8_t hop_period;
298 
299  /**
300  * Turn IQ inversion on/off. Usually, the end device sends an IQ inverted
301  * signal, and the base stations do not invert. We recommended sending an
302  * IQ inverted signal from the device side, so any transmissions from the
303  * base stations do not interfere with end device transmission.
304  */
306 
307  /**
308  * Turn continuous reception mode (such as in Class C) on/off.
309  */
311 
312  /**
313  * Timeout in milliseconds (ms) after which the radio driver reports an error
314  * if the radio was unable to transmit.
315  */
316  uint32_t tx_timeout;
317 
318  /**
319  * Change the network mode to Public or Private.
320  */
323 
324 /** LoRa packet
325  * Contains information about a LoRa packet.
326  */
328  /**
329  * Signal-to-noise ratio of a received packet.
330  */
331  int8_t snr_value;
332 
333  /**
334  * RSSI value in dBm for the received packet.
335  */
336  int8_t rssi_value;
337 
338  /**
339  * Size of the transmitted or received packet.
340  */
341  uint8_t size;
343 
344 /** Global radio settings.
345  * Contains settings for the overall transceiver operation.
346  */
347 typedef struct radio_settings {
348  /**
349  * Current state of the radio, such as RF_IDLE.
350  */
351  uint8_t state;
352 
353  /**
354  * Current modem operation, such as MODEM_LORA.
355  */
356  uint8_t modem;
357 
358  /**
359  * Current channel of operation.
360  */
361  uint32_t channel;
362 
363  /**
364  * Settings for FSK modem part.
365  */
367 
368  /**
369  * FSK packet and meta data.
370  */
372 
373  /**
374  * Settings for LoRa modem part.
375  */
377 
378  /**
379  * LoRa packet and metadata.
380  */
383 
384 /** Reporting functions for upper layers.
385  * The radio driver reports various vital events to the upper controlling layers
386  * using callback functions provided by the upper layers at the initialization
387  * phase.
388  */
389 typedef struct radio_events {
390  /**
391  * Callback when Transmission is done.
392  */
394 
395  /**
396  * Callback when Transmission is timed out.
397  */
399 
400  /**
401  * Rx Done callback prototype.
402  *
403  * @param payload Received buffer pointer.
404  * @param size Received buffer size.
405  * @param rssi RSSI value computed while receiving the frame [dBm].
406  * @param snr Raw SNR value given by the radio hardware.
407  * FSK : N/A (set to 0)
408  * LoRa: SNR value in dB
409  */
411 
412  /**
413  * Callback when Reception is timed out.
414  */
416 
417  /**
418  * Callback when Reception ends up in error.
419  */
421 
422  /**
423  * FHSS Change Channel callback prototype.
424  *
425  * @param current_channel The index number of the current channel.
426  */
428 
429  /**
430  * CAD Done callback prototype.
431  *
432  * @param channel_busy True, if Channel activity detected.
433  */
436 
437 /**
438  * Interface for the radios, containing the main functions that a radio needs, and five callback functions.
439  */
440 class LoRaRadio {
441 
442 public:
443 
444  /**
445  * Registers radio events with the Mbed LoRaWAN stack and undergoes initialization steps, if any.
446  *
447  * @param events Contains driver callback functions.
448  */
449  virtual void init_radio(radio_events_t *events) = 0;
450 
451  /**
452  * Resets the radio module.
453  */
454  virtual void radio_reset() = 0;
455 
456  /**
457  * Put the RF module in sleep mode.
458  */
459  virtual void sleep(void) = 0;
460 
461  /**
462  * Sets the radio to standby mode.
463  */
464  virtual void standby(void) = 0;
465 
466  /**
467  * Sets reception parameters.
468  *
469  * @param modem The radio modem [0: FSK, 1: LoRa].
470  * @param bandwidth Sets the bandwidth.
471  * FSK : >= 2600 and <= 250000 Hz
472  * LoRa: [0: 125 kHz, 1: 250 kHz,
473  * 2: 500 kHz, 3: Reserved]
474  * @param datarate Sets the datarate.
475  * FSK : 600..300000 bits/s
476  * LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
477  * 10: 1024, 11: 2048, 12: 4096 chips]
478  * @param coderate Sets the coding rate (LoRa only).
479  * FSK : N/A ( set to 0 )
480  * LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
481  * @param bandwidth_afc Sets the AFC bandwidth (FSK only).
482  * FSK : >= 2600 and <= 250000 Hz
483  * LoRa: N/A (set to 0)
484  * @param preamble_len Sets the preamble length (LoRa only).
485  * FSK : N/A (set to 0)
486  * LoRa: Length in symbols (the hardware adds four more symbols).
487  * @param symb_timeout Sets the RxSingle timeout value.
488  * FSK : Timeout number of bytes
489  * LoRa: Timeout in symbols
490  * @param fix_len Fixed length packets [0: variable, 1: fixed].
491  * @param payload_len Sets the payload length when fixed length is used.
492  * @param crc_on Enables/disables CRC [0: OFF, 1: ON].
493  * @param freq_hop_on Enables/disables intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only).
494  * @param hop_period The number of symbols bewteen each hop (LoRa only).
495  * @param iq_inverted Inverts the IQ signals (LoRa only).
496  * FSK : N/A (set to 0)
497  * LoRa: [0: not inverted, 1: inverted]
498  * @param rx_continuous Sets the reception to continuous mode.
499  * [false: single mode, true: continuous mode]
500  */
501  virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
502  uint32_t datarate, uint8_t coderate,
503  uint32_t bandwidth_afc, uint16_t preamble_len,
504  uint16_t symb_timeout, bool fix_len,
505  uint8_t payload_len,
506  bool crc_on, bool freq_hop_on, uint8_t hop_period,
507  bool iq_inverted, bool rx_continuous) = 0;
508 
509  /**
510  * Sets the transmission parameters.
511  *
512  * @param modem The radio modem [0: FSK, 1: LoRa].
513  * @param power Sets the output power [dBm].
514  * @param fdev Sets the frequency deviation (FSK only).
515  * FSK : [Hz]
516  * LoRa: 0
517  * @param bandwidth Sets the bandwidth (LoRa only).
518  * FSK : 0
519  * LoRa: [0: 125 kHz, 1: 250 kHz,
520  * 2: 500 kHz, 3: Reserved]
521  * @param datarate Sets the datarate.
522  * FSK : 600..300000 bits/s
523  * LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
524  * 10: 1024, 11: 2048, 12: 4096 chips]
525  * @param coderate Sets the coding rate (LoRa only).
526  * FSK : N/A ( set to 0 )
527  * LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
528  * @param preamble_len Sets the preamble length.
529  * @param fix_len Fixed length packets [0: variable, 1: fixed].
530  * @param crc_on Enables/disables CRC [0: OFF, 1: ON].
531  * @param freq_hop_on Enables/disables intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only).
532  * @param hop_period The number of symbols between each hop (LoRa only).
533  * @param iq_inverted Inverts IQ signals (LoRa only)
534  * FSK : N/A (set to 0).
535  * LoRa: [0: not inverted, 1: inverted]
536  * @param timeout The transmission timeout [ms].
537  */
538  virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
539  uint32_t bandwidth, uint32_t datarate,
540  uint8_t coderate, uint16_t preamble_len,
541  bool fix_len, bool crc_on, bool freq_hop_on,
542  uint8_t hop_period, bool iq_inverted, uint32_t timeout) = 0;
543 
544  /**
545  * Sends the packet.
546  *
547  * Prepares the packet to be sent and sets the radio to transmission mode.
548  *
549  * @param buffer A pointer to the buffer.
550  * @param size The buffer size.
551  */
552  virtual void send(uint8_t *buffer, uint8_t size) = 0;
553 
554  /**
555  * Sets the radio to reception mode.
556  *
557  * To configure the receiver, use the `set_rx_config()` API.
558  */
559  virtual void receive(void) = 0;
560 
561  /**
562  * Sets the carrier frequency.
563  *
564  * @param freq Channel RF frequency.
565  */
566  virtual void set_channel(uint32_t freq) = 0;
567 
568  /**
569  * Generates a 32 bit random value based on RSSI readings.
570  *
571  * \remark This function sets the radio in LoRa modem mode and disables all interrupts.
572  * After calling this function, either `Radio.SetRxConfig` or
573  * `Radio.SetTxConfig` functions must be called.
574  *
575  * @return A 32 bit random value.
576  */
577  virtual uint32_t random(void) = 0;
578 
579  /**
580  * Gets the radio status.
581  *
582  * @return The current radio status.
583  */
584  virtual uint8_t get_status(void) = 0;
585 
586  /**
587  * Sets the maximum payload length.
588  *
589  * @param modem The radio modem [0: FSK, 1: LoRa].
590  * @param max The maximum payload length in bytes.
591  */
592  virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) = 0;
593 
594  /**
595  * Sets the network to public or private.
596  *
597  * Updates the sync byte. Applies to LoRa modem only.
598  *
599  * @param enable If true, enables a public network.
600  */
601  virtual void set_public_network(bool enable) = 0;
602 
603  /**
604  * Computes the packet time on air for the given payload.
605  *
606  * \remark This can only be called after `SetRxConfig` or `SetTxConfig`.
607  *
608  * @param modem The radio modem [0: FSK, 1: LoRa].
609  * @param pkt_len The packet payload length.
610  * @return The computed `airTime` for the given packet payload length.
611  */
612  virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len) = 0;
613 
614  /**
615  * Performs carrier sensing.
616  *
617  * Checks for a certain time if the RSSI is above a given threshold.
618  * This threshold determines whether or not there is a transmission on
619  * the channel already.
620  *
621  * @param modem The type of radio modem.
622  * @param freq The carrier frequency.
623  * @param rssi_threshold The threshold value of RSSI.
624  * @param max_carrier_sense_time The time set for sensing the channel (ms).
625  *
626  * @return True if there is no active transmission
627  * in the channel, otherwise false.
628  */
629  virtual bool perform_carrier_sense(radio_modems_t modem,
630  uint32_t freq,
631  int16_t rssi_threshold,
632  uint32_t max_carrier_sense_time) = 0;
633 
634  /**
635  * Sets the radio to CAD mode.
636  *
637  */
638  virtual void start_cad(void) = 0;
639 
640  /**
641  * Checks whether the given RF is in range.
642  *
643  * @param frequency The frequency to check.
644  */
645  virtual bool check_rf_frequency(uint32_t frequency) = 0;
646 
647  /** Sets the radio to continuous wave transmission mode.
648  *
649  * @param freq The RF frequency of the channel.
650  * @param power The output power [dBm].
651  * @param time The transmission mode timeout [s].
652  */
653  virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) = 0;
654 
655  /**
656  * Acquires exclusive access to this radio.
657  */
658  virtual void lock(void) = 0;
659 
660  /**
661  * Releases exclusive access to this radio.
662  */
663  virtual void unlock(void) = 0;
664 };
665 
666 #endif // LORARADIO_H_
667 /** @}*/
uint32_t rx_single_timeout
Timeout value in symbols (symb) after which the radio driver reports a timeout if the radio did not r...
Definition: LoRaRadio.h:183
radio_lora_packet_handler_t lora_packet_handler
LoRa packet and metadata.
Definition: LoRaRadio.h:381
bool rx_continuous
Turn continuous reception mode (such as Class C mode) on/off.
Definition: LoRaRadio.h:171
PinName rf_switch_ctl1
TX latch switch pin.
Definition: LoRaRadio.h:39
FSK modem parameters.
Definition: LoRaRadio.h:117
uint8_t hop_period
Number of symbols between two frequency hops.
Definition: LoRaRadio.h:297
struct radio_fsk_settings radio_fsk_settings_t
FSK modem parameters.
LoRa operation mode.
Definition: LoRaRadio.h:111
enum modem_type radio_modems_t
Type of modem.
IDLE state.
Definition: LoRaRadio.h:81
radio_state
Radio driver internal state.
Definition: LoRaRadio.h:77
Structure to hold RF controls for LoRa Radio.
Definition: LoRaRadio.h:35
modem_type
Type of modem.
Definition: LoRaRadio.h:102
uint32_t tx_timeout
Timeout value in milliseconds (ms) after which the radio driver reports a timeout if the radio was un...
Definition: LoRaRadio.h:177
uint32_t f_dev
Frequency deviation.
Definition: LoRaRadio.h:126
struct radio_lora_packet_handler radio_lora_packet_handler_t
LoRa packet Contains information about a LoRa packet.
uint16_t preamble_len
Preamble length in symbols.
Definition: LoRaRadio.h:272
struct radio_lora_settings radio_lora_settings_t
LoRa modem parameters.
int8_t snr_value
Signal-to-noise ratio of a received packet.
Definition: LoRaRadio.h:331
uint32_t bandwidth_afc
Automated frequency correction bandwidth.
Definition: LoRaRadio.h:136
uint8_t preamble_detected
Set to true (1) when a Preamble is detected, otherwise false (0).
Definition: LoRaRadio.h:193
uint8_t coderate
Error correction code rate.
Definition: LoRaRadio.h:267
uint8_t rx_gain
LNA gain value (dbm).
Definition: LoRaRadio.h:213
uint16_t preamble_len
Expected preamble length.
Definition: LoRaRadio.h:146
struct radio_events radio_events_t
Reporting functions for upper layers.
enum radio_state radio_state_t
Radio driver internal state.
uint8_t payload_len
Size of outgoing data.
Definition: LoRaRadio.h:156
uint8_t modem
Current modem operation, such as MODEM_LORA.
Definition: LoRaRadio.h:356
uint32_t channel
Current channel of operation.
Definition: LoRaRadio.h:361
PinName ant_switch
Transceiver switch pin.
Definition: LoRaRadio.h:60
PinName rf_switch_ctl2
RX latch switch pin.
Definition: LoRaRadio.h:44
uint32_t datarate
Data rate (SF).
Definition: LoRaRadio.h:141
TX state.
Definition: LoRaRadio.h:91
uint32_t bandwidth
Modulation bandwidth.
Definition: LoRaRadio.h:131
bool freq_hop_on
Turn frequency hopping on/off.
Definition: LoRaRadio.h:292
bool public_network
Change the network mode to Public or Private.
Definition: LoRaRadio.h:321
uint8_t fifo_thresh
Stores the FIFO threshold value.
Definition: LoRaRadio.h:228
uint8_t chunk_size
Defines the size of a chunk of outgoing buffer written to the FIFO at a unit time.
Definition: LoRaRadio.h:237
radio_fsk_settings_t fsk
Settings for FSK modem part.
Definition: LoRaRadio.h:366
radio_lora_settings_t lora
Settings for LoRa modem part.
Definition: LoRaRadio.h:376
int8_t power
Transmit power.
Definition: LoRaRadio.h:121
Reporting functions for upper layers.
Definition: LoRaRadio.h:389
LoRa packet Contains information about a LoRa packet.
Definition: LoRaRadio.h:327
bool rx_continuous
Turn continuous reception mode (such as in Class C) on/off.
Definition: LoRaRadio.h:310
int8_t rssi_value
Storage for RSSI value of the received signal.
Definition: LoRaRadio.h:203
bool crc_on
Turn CRC on/off.
Definition: LoRaRadio.h:161
bool iq_inverted
Turn IQ inversion on/off.
Definition: LoRaRadio.h:305
uint8_t sync_word_detected
Set to true (1) when a SyncWord is detected, otherwise false (0).
Definition: LoRaRadio.h:198
uint32_t bandwidth
Modulation bandwidth.
Definition: LoRaRadio.h:252
PinName pwr_amp_ctl
Power amplifier control pin.
Definition: LoRaRadio.h:66
int32_t afc_value
Automated frequency correction value.
Definition: LoRaRadio.h:208
bool fix_len
Set to true if the outgoing payload length is fixed.
Definition: LoRaRadio.h:277
FSK packet handle.
Definition: LoRaRadio.h:189
bool crc_on
Turn CRC on/off.
Definition: LoRaRadio.h:287
struct radio_settings radio_settings_t
Global radio settings.
mbed::Callback< void(bool channel_busy)> cad_done
CAD Done callback prototype.
Definition: LoRaRadio.h:434
RX state.
Definition: LoRaRadio.h:86
mbed::Callback< void()> tx_done
Callback when Transmission is done.
Definition: LoRaRadio.h:393
uint16_t nb_bytes
Keeps track of number of bytes already read from the RX FIFO.
Definition: LoRaRadio.h:223
mbed::Callback< void()> tx_timeout
Callback when Transmission is timed out.
Definition: LoRaRadio.h:398
Global radio settings.
Definition: LoRaRadio.h:347
uint32_t tx_timeout
Timeout in milliseconds (ms) after which the radio driver reports an error if the radio was unable to...
Definition: LoRaRadio.h:316
mbed::Callback< void()> rx_timeout
Callback when Reception is timed out.
Definition: LoRaRadio.h:415
int8_t rssi_value
RSSI value in dBm for the received packet.
Definition: LoRaRadio.h:336
PinName tcxo
TCXO crystal control pin.
Definition: LoRaRadio.h:71
uint16_t size
Size of the received data in bytes.
Definition: LoRaRadio.h:218
struct radio_fsk_packet_handler radio_fsk_packet_handler_t
FSK packet handle.
PinName rxctl
RX control pin for transceiver packaged as a module.
Definition: LoRaRadio.h:54
mbed::Callback< void()> rx_error
Callback when Reception ends up in error.
Definition: LoRaRadio.h:420
radio_fsk_packet_handler_t fsk_packet_handler
FSK packet and meta data.
Definition: LoRaRadio.h:371
Interface for the radios, containing the main functions that a radio needs, and five callback functio...
Definition: LoRaRadio.h:440
bool fix_len
This flag turns on if the TX data size is fixed.
Definition: LoRaRadio.h:151
mbed::Callback< void(uint8_t current_channel)> fhss_change_channel
FHSS Change Channel callback prototype.
Definition: LoRaRadio.h:427
int8_t power
Transmit power.
Definition: LoRaRadio.h:247
bool low_datarate_optimize
Turn low data rate optimization on/off.
Definition: LoRaRadio.h:262
uint8_t state
Current state of the radio, such as RF_IDLE.
Definition: LoRaRadio.h:351
CAD state.
Definition: LoRaRadio.h:96
mbed::Callback< void(const uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr)> rx_done
Rx Done callback prototype.
Definition: LoRaRadio.h:410
PinName txctl
TX control pin for transceiver packaged as a module.
Definition: LoRaRadio.h:49
static void sleep(void)
Send the microcontroller to sleep.
FSK operation mode.
Definition: LoRaRadio.h:106
LoRa modem parameters.
Definition: LoRaRadio.h:243
uint8_t payload_len
Size of outgoing payload.
Definition: LoRaRadio.h:282
uint8_t size
Size of the transmitted or received packet.
Definition: LoRaRadio.h:341
uint32_t datarate
Data rate (SF).
Definition: LoRaRadio.h:257
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.