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