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
|
* Constructor
|
||||||
*/
|
*/
|
||||||
SX1272_LoRaRadio::SX1272_LoRaRadio(PinName spi_mosi, PinName spi_miso,
|
SX1272_LoRaRadio::SX1272_LoRaRadio(PinName spi_mosi,
|
||||||
PinName spi_sclk, PinName nss, PinName reset, PinName dio0, PinName dio1,
|
PinName spi_miso,
|
||||||
PinName dio2, PinName dio3, PinName dio4, PinName dio5, PinName rf_switch_ctl1,
|
PinName spi_sclk,
|
||||||
PinName rf_switch_ctl2,
|
PinName nss,
|
||||||
PinName txctl, PinName rxctl, PinName antswitch, PinName pwr_amp_ctl)
|
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),
|
: _spi(spi_mosi, spi_miso, spi_sclk),
|
||||||
_chip_select(nss, 1), _reset_ctl(reset),
|
_chip_select(nss, 1),
|
||||||
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3),
|
_reset_ctl(reset),
|
||||||
_dio4_ctl(dio4), _dio5_ctl(dio5), _rf_switch_ctl1(rf_switch_ctl1, 0),
|
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3), _dio4_ctl(dio4), _dio5_ctl(dio5),
|
||||||
_rf_switch_ctl2(rf_switch_ctl2, 0),_txctl(txctl, 0), _rxctl(rxctl, 0),
|
_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)
|
_ant_switch(antswitch, PIN_INPUT, PullUp, 0),
|
||||||
|
_pwr_amp_ctl(pwr_amp_ctl),
|
||||||
|
_tcxo(tcxo)
|
||||||
|
|
||||||
#ifdef MBED_CONF_RTOS_PRESENT
|
#ifdef MBED_CONF_RTOS_PRESENT
|
||||||
, irq_thread(osPriorityRealtime, 1024)
|
, irq_thread(osPriorityRealtime, 1024)
|
||||||
#endif
|
#endif
|
||||||
|
@ -190,6 +206,10 @@ SX1272_LoRaRadio::SX1272_LoRaRadio(PinName spi_mosi, PinName spi_miso,
|
||||||
|
|
||||||
_radio_events = NULL;
|
_radio_events = NULL;
|
||||||
|
|
||||||
|
if (tcxo != NC) {
|
||||||
|
_tcxo = 1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MBED_CONF_RTOS_PRESENT
|
#ifdef MBED_CONF_RTOS_PRESENT
|
||||||
irq_thread.start(mbed::callback(this, &SX1272_LoRaRadio::rf_irq_task));
|
irq_thread.start(mbed::callback(this, &SX1272_LoRaRadio::rf_irq_task));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -55,13 +55,24 @@ public:
|
||||||
* The pins that are marked NC are optional. It is assumed that these
|
* The pins that are marked NC are optional. It is assumed that these
|
||||||
* pins are not connected until/unless configured otherwise.
|
* pins are not connected until/unless configured otherwise.
|
||||||
*/
|
*/
|
||||||
SX1272_LoRaRadio(PinName mosi, PinName miso, PinName sclk, PinName nss,
|
SX1272_LoRaRadio(PinName mosi,
|
||||||
PinName reset, PinName dio0, PinName dio1, PinName dio2,
|
PinName miso,
|
||||||
PinName dio3, PinName dio4, PinName dio5,
|
PinName sclk,
|
||||||
PinName rf_switch_ctl1=NC,
|
PinName nss,
|
||||||
PinName rf_switch_ctl2=NC, PinName txctl = NC,
|
PinName reset,
|
||||||
PinName rxctl = NC, PinName ant_switch = NC,
|
PinName dio0,
|
||||||
PinName pwr_amp_ctl = NC);
|
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
|
* Destructor
|
||||||
|
@ -323,6 +334,7 @@ private:
|
||||||
mbed::DigitalOut _rxctl;
|
mbed::DigitalOut _rxctl;
|
||||||
mbed::DigitalInOut _ant_switch;
|
mbed::DigitalInOut _ant_switch;
|
||||||
mbed::DigitalOut _pwr_amp_ctl;
|
mbed::DigitalOut _pwr_amp_ctl;
|
||||||
|
mbed::DigitalOut _tcxo;
|
||||||
|
|
||||||
// Contains all RF control pin names
|
// Contains all RF control pin names
|
||||||
// This storage is needed even after assigning the
|
// This storage is needed even after assigning the
|
||||||
|
|
|
@ -158,18 +158,32 @@ static uint8_t radio_variant;
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
SX1276_LoRaRadio::SX1276_LoRaRadio(PinName spi_mosi, PinName spi_miso,
|
SX1276_LoRaRadio::SX1276_LoRaRadio(PinName spi_mosi,
|
||||||
PinName spi_sclk, PinName nss, PinName reset, PinName dio0,
|
PinName spi_miso,
|
||||||
PinName dio1, PinName dio2, PinName dio3, PinName dio4,
|
PinName spi_sclk,
|
||||||
PinName dio5, PinName rf_switch_ctl1, PinName rf_switch_ctl2,
|
PinName nss,
|
||||||
PinName txctl, PinName rxctl, PinName antswitch,
|
PinName reset,
|
||||||
PinName pwr_amp_ctl, PinName tcxo)
|
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),
|
: _spi(spi_mosi, spi_miso, spi_sclk),
|
||||||
_chip_select(nss, 1), _reset_ctl(reset),
|
_chip_select(nss, 1),
|
||||||
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3),
|
_reset_ctl(reset),
|
||||||
_dio4_ctl(dio4), _dio5_ctl(dio5), _rf_switch_ctl1(rf_switch_ctl1, 0),
|
_dio0_ctl(dio0), _dio1_ctl(dio1), _dio2_ctl(dio2), _dio3_ctl(dio3), _dio4_ctl(dio4), _dio5_ctl(dio5),
|
||||||
_rf_switch_ctl2(rf_switch_ctl2, 0),_txctl(txctl, 0), _rxctl(rxctl, 0),
|
_rf_switch_ctl1(rf_switch_ctl1, 0), _rf_switch_ctl2(rf_switch_ctl2, 0),
|
||||||
_ant_switch(antswitch, PIN_INPUT, PullUp, 0), _pwr_amp_ctl(pwr_amp_ctl),
|
_txctl(txctl, 0), _rxctl(rxctl, 0),
|
||||||
|
_ant_switch(antswitch, PIN_INPUT, PullUp, 0),
|
||||||
|
_pwr_amp_ctl(pwr_amp_ctl),
|
||||||
_tcxo(tcxo)
|
_tcxo(tcxo)
|
||||||
|
|
||||||
#ifdef MBED_CONF_RTOS_PRESENT
|
#ifdef MBED_CONF_RTOS_PRESENT
|
||||||
|
|
|
@ -69,12 +69,22 @@ public:
|
||||||
* setting SX1276 radio module gets connected to an external power amplifier
|
* setting SX1276 radio module gets connected to an external power amplifier
|
||||||
* or radio latch controls are connected.
|
* or radio latch controls are connected.
|
||||||
*/
|
*/
|
||||||
SX1276_LoRaRadio(PinName mosi, PinName miso, PinName sclk, PinName nss,
|
SX1276_LoRaRadio(PinName mosi,
|
||||||
PinName reset, PinName dio0, PinName dio1, PinName dio2,
|
PinName miso,
|
||||||
PinName dio3, PinName dio4, PinName dio5,
|
PinName sclk,
|
||||||
PinName rf_switch_ctl1=NC,
|
PinName nss,
|
||||||
PinName rf_switch_ctl2=NC, PinName txctl = NC,
|
PinName reset,
|
||||||
PinName rxctl = NC, PinName ant_switch = NC,
|
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 pwr_amp_ctl = NC,
|
||||||
PinName tcxo = NC);
|
PinName tcxo = NC);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue