Add setRfSwitchTable() wrapper methods
This gives all radios that use an rfswitch (i.e. have a setRfSwitchPins() wrapper already) a wrapper method for setRfSwitchTable() too. This wrapper just calls the same method on Module, to make it easier for sketches to use it.
This commit is contained in:
parent
83ff964b66
commit
3779faf600
12 changed files with 42 additions and 0 deletions
src/modules
CC1101
RF69
SX126x
SX127x
SX128x
Si443x
|
@ -902,6 +902,10 @@ void CC1101::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
|||
_mod->setRfSwitchPins(rxEn, txEn);
|
||||
}
|
||||
|
||||
void CC1101::setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]) {
|
||||
_mod->setRfSwitchTable(pins, table);
|
||||
}
|
||||
|
||||
uint8_t CC1101::randomByte() {
|
||||
// set mode to Rx
|
||||
SPIsendCommand(RADIOLIB_CC1101_CMD_RX);
|
||||
|
|
|
@ -931,6 +931,9 @@ class CC1101: public PhysicalLayer {
|
|||
/*! \copydoc Module::setRfSwitchPins */
|
||||
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||
|
||||
/*! \copydoc Module::setRfSwitchTable */
|
||||
void setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
|
||||
|
||||
/*!
|
||||
\brief Get one truly random byte from RSSI noise.
|
||||
|
||||
|
|
|
@ -916,6 +916,10 @@ void RF69::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
|||
_mod->setRfSwitchPins(rxEn, txEn);
|
||||
}
|
||||
|
||||
void RF69::setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]) {
|
||||
_mod->setRfSwitchTable(pins, table);
|
||||
}
|
||||
|
||||
uint8_t RF69::randomByte() {
|
||||
// set mode to Rx
|
||||
setMode(RADIOLIB_RF69_RX);
|
||||
|
|
|
@ -1013,6 +1013,9 @@ class RF69: public PhysicalLayer {
|
|||
/*! \copydoc Module::setRfSwitchPins */
|
||||
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||
|
||||
/*! \copydoc Module::setRfSwitchTable */
|
||||
void setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
|
||||
|
||||
/*!
|
||||
\brief Get one truly random byte from RSSI noise.
|
||||
|
||||
|
|
|
@ -1199,6 +1199,10 @@ void SX126x::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
|||
_mod->setRfSwitchPins(rxEn, txEn);
|
||||
}
|
||||
|
||||
void SX126x::setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]) {
|
||||
_mod->setRfSwitchTable(pins, table);
|
||||
}
|
||||
|
||||
int16_t SX126x::forceLDRO(bool enable) {
|
||||
// check active modem
|
||||
if(getPacketType() != RADIOLIB_SX126X_PACKET_TYPE_LORA) {
|
||||
|
|
|
@ -917,6 +917,9 @@ class SX126x: public PhysicalLayer {
|
|||
/*! \copydoc Module::setRfSwitchPins */
|
||||
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||
|
||||
/*! \copydoc Module::setRfSwitchTable */
|
||||
void setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
|
||||
|
||||
/*!
|
||||
\brief Forces LoRa low data rate optimization. Only available in LoRa mode. After calling this method, LDRO will always be set to
|
||||
the provided value, regardless of symbol length. To re-enable automatic LDRO configuration, call SX126x::autoLDRO()
|
||||
|
|
|
@ -1258,6 +1258,10 @@ void SX127x::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
|||
_mod->setRfSwitchPins(rxEn, txEn);
|
||||
}
|
||||
|
||||
void SX127x::setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]) {
|
||||
_mod->setRfSwitchTable(pins, table);
|
||||
}
|
||||
|
||||
uint8_t SX127x::randomByte() {
|
||||
// check active modem
|
||||
uint8_t rssiValueReg = RADIOLIB_SX127X_REG_RSSI_WIDEBAND;
|
||||
|
|
|
@ -1144,6 +1144,9 @@ class SX127x: public PhysicalLayer {
|
|||
/*! \copydoc Module::setRfSwitchPins */
|
||||
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||
|
||||
/*! \copydoc Module::setRfSwitchTable */
|
||||
void setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
|
||||
|
||||
/*!
|
||||
\brief Get one truly random byte from RSSI noise.
|
||||
|
||||
|
|
|
@ -1243,6 +1243,10 @@ void SX128x::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
|||
_mod->setRfSwitchPins(rxEn, txEn);
|
||||
}
|
||||
|
||||
void SX128x::setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]) {
|
||||
_mod->setRfSwitchTable(pins, table);
|
||||
}
|
||||
|
||||
uint8_t SX128x::randomByte() {
|
||||
// it's unclear whether SX128x can measure RSSI while not receiving a packet
|
||||
// this method is implemented only for PhysicalLayer compatibility
|
||||
|
|
|
@ -812,6 +812,9 @@ class SX128x: public PhysicalLayer {
|
|||
/*! \copydoc Module::setRfSwitchPins */
|
||||
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||
|
||||
/*! \copydoc Module::setRfSwitchTable */
|
||||
void setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
|
||||
|
||||
/*!
|
||||
\brief Dummy random method, to ensure PhysicalLayer compatibility.
|
||||
|
||||
|
|
|
@ -568,6 +568,10 @@ void Si443x::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
|||
_mod->setRfSwitchPins(rxEn, txEn);
|
||||
}
|
||||
|
||||
void Si443x::setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]) {
|
||||
_mod->setRfSwitchTable(pins, table);
|
||||
}
|
||||
|
||||
uint8_t Si443x::randomByte() {
|
||||
// set mode to Rx
|
||||
_mod->SPIwriteRegister(RADIOLIB_SI443X_REG_OP_FUNC_CONTROL_1, RADIOLIB_SI443X_RX_ON | RADIOLIB_SI443X_XTAL_ON);
|
||||
|
|
|
@ -788,6 +788,9 @@ class Si443x: public PhysicalLayer {
|
|||
/*! \copydoc Module::setRfSwitchPins */
|
||||
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||
|
||||
/*! \copydoc Module::setRfSwitchTable */
|
||||
void setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
|
||||
|
||||
/*!
|
||||
\brief Get one truly random byte from RSSI noise.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue