@@ -26,6 +26,15 @@ SPDX-License-Identifier: BSD-3-Clause
26
26
#ifndef SX1276_LORARADIO_H_
27
27
#define SX1276_LORARADIO_H_
28
28
29
+ #include " PinNames.h"
30
+ #include " InterruptIn.h"
31
+ #include " DigitalOut.h"
32
+ #include " DigitalInOut.h"
33
+ #include " SPI.h"
34
+ #include " Timeout.h"
35
+ #ifdef MBED_CONF_RTOS_PRESENT
36
+ #include " rtos/Thread.h"
37
+ #endif
29
38
#include " netsocket/LoRaRadio.h"
30
39
31
40
#ifdef MBED_SX1276_LORARADIO_BUFFER_SIZE
@@ -34,16 +43,6 @@ SPDX-License-Identifier: BSD-3-Clause
34
43
#define MAX_DATA_BUFFER_SIZE 256
35
44
#endif
36
45
37
- typedef struct {
38
- PinName rf_switch_ctl1;
39
- PinName rf_switch_ctl2;
40
- PinName txctl;
41
- PinName rxctl;
42
- PinName ant_switch;
43
- PinName pwr_amp_ctl;
44
- PinName tcxo;
45
- } rf_ctrls;
46
-
47
46
/* *
48
47
* Radio driver implementation for Semtech SX1272 plus variants.
49
48
* Supports only SPI at the moment. Implements pure virtual LoRaRadio class.
@@ -318,28 +317,28 @@ class SX1276_LoRaRadio: public LoRaRadio {
318
317
private:
319
318
320
319
// SPI and chip select control
321
- SPI _spi;
322
- DigitalOut _chip_select;
320
+ mbed:: SPI _spi;
321
+ mbed:: DigitalOut _chip_select;
323
322
324
323
// module rest control
325
- DigitalInOut _reset_ctl;
324
+ mbed:: DigitalInOut _reset_ctl;
326
325
327
326
// Interrupt controls
328
- InterruptIn _dio0_ctl;
329
- InterruptIn _dio1_ctl;
330
- InterruptIn _dio2_ctl;
331
- InterruptIn _dio3_ctl;
332
- InterruptIn _dio4_ctl;
333
- InterruptIn _dio5_ctl;
327
+ mbed:: InterruptIn _dio0_ctl;
328
+ mbed:: InterruptIn _dio1_ctl;
329
+ mbed:: InterruptIn _dio2_ctl;
330
+ mbed:: InterruptIn _dio3_ctl;
331
+ mbed:: InterruptIn _dio4_ctl;
332
+ mbed:: InterruptIn _dio5_ctl;
334
333
335
334
// Radio specific controls
336
- DigitalOut _rf_switch_ctl1;
337
- DigitalOut _rf_switch_ctl2;
338
- DigitalOut _txctl;
339
- DigitalOut _rxctl;
340
- DigitalInOut _ant_switch;
341
- DigitalOut _pwr_amp_ctl;
342
- DigitalOut _tcxo;
335
+ mbed:: DigitalOut _rf_switch_ctl1;
336
+ mbed:: DigitalOut _rf_switch_ctl2;
337
+ mbed:: DigitalOut _txctl;
338
+ mbed:: DigitalOut _rxctl;
339
+ mbed:: DigitalInOut _ant_switch;
340
+ mbed:: DigitalOut _pwr_amp_ctl;
341
+ mbed:: DigitalOut _tcxo;
343
342
344
343
// Contains all RF control pin names
345
344
// This storage is needed even after assigning the
@@ -361,13 +360,13 @@ class SX1276_LoRaRadio: public LoRaRadio {
361
360
uint8_t _data_buffer[MAX_DATA_BUFFER_SIZE];
362
361
363
362
// TX/RX Timers - all use milisecond units
364
- Timeout tx_timeout_timer;
365
- Timeout rx_timeout_timer;
366
- Timeout rx_timeout_sync_word;
363
+ mbed:: Timeout tx_timeout_timer;
364
+ mbed:: Timeout rx_timeout_timer;
365
+ mbed:: Timeout rx_timeout_sync_word;
367
366
368
367
#ifdef MBED_CONF_RTOS_PRESENT
369
368
// Thread to handle interrupts
370
- Thread irq_thread;
369
+ rtos:: Thread irq_thread;
371
370
#endif
372
371
373
372
// Access protection
@@ -419,6 +418,5 @@ class SX1276_LoRaRadio: public LoRaRadio {
419
418
void handle_dio4_irq ();
420
419
void handle_dio5_irq ();
421
420
void handle_timeout_irq ();
422
- };
423
421
424
422
#endif // SX1276_LORARADIO_H_
0 commit comments