mirror of https://github.com/ARMmbed/mbed-os.git
Add TCXO pin for SX1272
Also reformatted constructor params list to more readable formatpull/12741/head
parent
e5bd56e0fc
commit
247d8a5777
|
@ -163,17 +163,33 @@ static bool RadioIsActive = false;
|
|||
/**
|
||||
* Constructor
|
||||
*/
|
||||
SX1272_LoRaRadio::SX1272_LoRaRadio(PinName spi_mosi, PinName spi_miso,
|
||||
PinName spi_sclk, PinName nss, PinName reset, PinName dio0, PinName dio1,
|
||||
PinName dio2, PinName dio3, PinName dio4, PinName dio5, PinName rf_switch_ctl1,
|
||||
PinName rf_switch_ctl2,
|
||||
PinName txctl, PinName rxctl, PinName antswitch, PinName pwr_amp_ctl)
|
||||
SX1272_LoRaRadio::SX1272_LoRaRadio(PinName spi_mosi,
|
||||
PinName spi_miso,
|
||||
PinName spi_sclk,
|
||||
PinName nss,
|
||||
PinName reset,
|
||||
PinName dio0,
|
||||
PinName dio1,
|
||||
PinName dio2,
|
||||
PinName dio3,
|
||||
PinName dio4,
|
||||
PinName dio5,
|
||||
PinName rf_switch_ctl1,
|
||||
PinName rf_switch_ctl2,
|
||||
PinName txctl,
|
||||
PinName rxctl,
|
||||
PinName antswitch,
|
||||
PinName pwr_amp_ctl,
|
||||
PinName tcxo)
|
||||
: _spi(spi_mosi, spi_miso, spi_sclk),
|
||||
_chip_select(nss, 1), _reset_ctl(reset),
|
||||
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3),
|
||||
_dio4_ctl(dio4), _dio5_ctl(dio5), _rf_switch_ctl1(rf_switch_ctl1, 0),
|
||||
_rf_switch_ctl2(rf_switch_ctl2, 0),_txctl(txctl, 0), _rxctl(rxctl, 0),
|
||||
_ant_switch(antswitch, PIN_INPUT, PullUp, 0), _pwr_amp_ctl(pwr_amp_ctl)
|
||||
_chip_select(nss, 1),
|
||||
_reset_ctl(reset),
|
||||
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3), _dio4_ctl(dio4), _dio5_ctl(dio5),
|
||||
_rf_switch_ctl1(rf_switch_ctl1, 0), _rf_switch_ctl2(rf_switch_ctl2, 0), _txctl(txctl, 0), _rxctl(rxctl, 0),
|
||||
_ant_switch(antswitch, PIN_INPUT, PullUp, 0),
|
||||
_pwr_amp_ctl(pwr_amp_ctl),
|
||||
_tcxo(tcxo)
|
||||
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
, irq_thread(osPriorityRealtime, 1024)
|
||||
#endif
|
||||
|
@ -190,6 +206,10 @@ SX1272_LoRaRadio::SX1272_LoRaRadio(PinName spi_mosi, PinName spi_miso,
|
|||
|
||||
_radio_events = NULL;
|
||||
|
||||
if (tcxo != NC) {
|
||||
_tcxo = 1;
|
||||
}
|
||||
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
irq_thread.start(mbed::callback(this, &SX1272_LoRaRadio::rf_irq_task));
|
||||
#endif
|
||||
|
|
|
@ -55,13 +55,24 @@ public:
|
|||
* The pins that are marked NC are optional. It is assumed that these
|
||||
* pins are not connected until/unless configured otherwise.
|
||||
*/
|
||||
SX1272_LoRaRadio(PinName mosi, PinName miso, PinName sclk, PinName nss,
|
||||
PinName reset, PinName dio0, PinName dio1, PinName dio2,
|
||||
PinName dio3, PinName dio4, PinName dio5,
|
||||
PinName rf_switch_ctl1=NC,
|
||||
PinName rf_switch_ctl2=NC, PinName txctl = NC,
|
||||
PinName rxctl = NC, PinName ant_switch = NC,
|
||||
PinName pwr_amp_ctl = NC);
|
||||
SX1272_LoRaRadio(PinName mosi,
|
||||
PinName miso,
|
||||
PinName sclk,
|
||||
PinName nss,
|
||||
PinName reset,
|
||||
PinName dio0,
|
||||
PinName dio1,
|
||||
PinName dio2,
|
||||
PinName dio3,
|
||||
PinName dio4,
|
||||
PinName dio5,
|
||||
PinName rf_switch_ctl1 = NC,
|
||||
PinName rf_switch_ctl2 = NC,
|
||||
PinName txctl = NC,
|
||||
PinName rxctl = NC,
|
||||
PinName ant_switch = NC,
|
||||
PinName pwr_amp_ctl = NC,
|
||||
PinName tcxo = NC);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
|
@ -323,6 +334,7 @@ private:
|
|||
mbed::DigitalOut _rxctl;
|
||||
mbed::DigitalInOut _ant_switch;
|
||||
mbed::DigitalOut _pwr_amp_ctl;
|
||||
mbed::DigitalOut _tcxo;
|
||||
|
||||
// Contains all RF control pin names
|
||||
// This storage is needed even after assigning the
|
||||
|
|
|
@ -158,18 +158,32 @@ static uint8_t radio_variant;
|
|||
/**
|
||||
* Constructor
|
||||
*/
|
||||
SX1276_LoRaRadio::SX1276_LoRaRadio(PinName spi_mosi, PinName spi_miso,
|
||||
PinName spi_sclk, PinName nss, PinName reset, PinName dio0,
|
||||
PinName dio1, PinName dio2, PinName dio3, PinName dio4,
|
||||
PinName dio5, PinName rf_switch_ctl1, PinName rf_switch_ctl2,
|
||||
PinName txctl, PinName rxctl, PinName antswitch,
|
||||
PinName pwr_amp_ctl, PinName tcxo)
|
||||
SX1276_LoRaRadio::SX1276_LoRaRadio(PinName spi_mosi,
|
||||
PinName spi_miso,
|
||||
PinName spi_sclk,
|
||||
PinName nss,
|
||||
PinName reset,
|
||||
PinName dio0,
|
||||
PinName dio1,
|
||||
PinName dio2,
|
||||
PinName dio3,
|
||||
PinName dio4,
|
||||
PinName dio5,
|
||||
PinName rf_switch_ctl1,
|
||||
PinName rf_switch_ctl2,
|
||||
PinName txctl,
|
||||
PinName rxctl,
|
||||
PinName antswitch,
|
||||
PinName pwr_amp_ctl,
|
||||
PinName tcxo)
|
||||
: _spi(spi_mosi, spi_miso, spi_sclk),
|
||||
_chip_select(nss, 1), _reset_ctl(reset),
|
||||
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3),
|
||||
_dio4_ctl(dio4), _dio5_ctl(dio5), _rf_switch_ctl1(rf_switch_ctl1, 0),
|
||||
_rf_switch_ctl2(rf_switch_ctl2, 0),_txctl(txctl, 0), _rxctl(rxctl, 0),
|
||||
_ant_switch(antswitch, PIN_INPUT, PullUp, 0), _pwr_amp_ctl(pwr_amp_ctl),
|
||||
_chip_select(nss, 1),
|
||||
_reset_ctl(reset),
|
||||
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3), _dio4_ctl(dio4), _dio5_ctl(dio5),
|
||||
_rf_switch_ctl1(rf_switch_ctl1, 0), _rf_switch_ctl2(rf_switch_ctl2, 0),
|
||||
_txctl(txctl, 0), _rxctl(rxctl, 0),
|
||||
_ant_switch(antswitch, PIN_INPUT, PullUp, 0),
|
||||
_pwr_amp_ctl(pwr_amp_ctl),
|
||||
_tcxo(tcxo)
|
||||
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
|
|
|
@ -69,12 +69,22 @@ public:
|
|||
* setting SX1276 radio module gets connected to an external power amplifier
|
||||
* or radio latch controls are connected.
|
||||
*/
|
||||
SX1276_LoRaRadio(PinName mosi, PinName miso, PinName sclk, PinName nss,
|
||||
PinName reset, PinName dio0, PinName dio1, PinName dio2,
|
||||
PinName dio3, PinName dio4, PinName dio5,
|
||||
PinName rf_switch_ctl1=NC,
|
||||
PinName rf_switch_ctl2=NC, PinName txctl = NC,
|
||||
PinName rxctl = NC, PinName ant_switch = NC,
|
||||
SX1276_LoRaRadio(PinName mosi,
|
||||
PinName miso,
|
||||
PinName sclk,
|
||||
PinName nss,
|
||||
PinName reset,
|
||||
PinName dio0,
|
||||
PinName dio1,
|
||||
PinName dio2,
|
||||
PinName dio3,
|
||||
PinName dio4,
|
||||
PinName dio5,
|
||||
PinName rf_switch_ctl1 = NC,
|
||||
PinName rf_switch_ctl2 = NC,
|
||||
PinName txctl = NC,
|
||||
PinName rxctl = NC,
|
||||
PinName ant_switch = NC,
|
||||
PinName pwr_amp_ctl = NC,
|
||||
PinName tcxo = NC);
|
||||
|
||||
|
|
Loading…
Reference in New Issue