[nRF24] Added missing standby overload
This commit is contained in:
parent
8ace6350cf
commit
45826fb00d
2 changed files with 14 additions and 1 deletions
|
@ -72,13 +72,17 @@ int16_t nRF24::sleep() {
|
|||
}
|
||||
|
||||
int16_t nRF24::standby() {
|
||||
return(standby(RADIOLIB_NRF24_POWER_UP));
|
||||
}
|
||||
|
||||
int16_t nRF24::standby(uint8_t mode) {
|
||||
// make sure carrier output is disabled
|
||||
_mod->SPIsetRegValue(RADIOLIB_NRF24_REG_RF_SETUP, RADIOLIB_NRF24_CONT_WAVE_OFF, 7, 7);
|
||||
_mod->SPIsetRegValue(RADIOLIB_NRF24_REG_RF_SETUP, RADIOLIB_NRF24_PLL_LOCK_OFF, 4, 4);
|
||||
_mod->digitalWrite(_mod->getRst(), LOW);
|
||||
|
||||
// use standby-1 mode
|
||||
return(_mod->SPIsetRegValue(RADIOLIB_NRF24_REG_CONFIG, RADIOLIB_NRF24_POWER_UP, 1, 1));
|
||||
return(_mod->SPIsetRegValue(RADIOLIB_NRF24_REG_CONFIG, mode, 1, 1));
|
||||
}
|
||||
|
||||
int16_t nRF24::transmit(uint8_t* data, size_t len, uint8_t addr) {
|
||||
|
|
|
@ -235,6 +235,15 @@ class nRF24: public PhysicalLayer {
|
|||
*/
|
||||
int16_t standby() override;
|
||||
|
||||
/*!
|
||||
\brief Sets the module to standby.
|
||||
|
||||
\param mode Standby mode to be used.
|
||||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t standby(uint8_t mode) override;
|
||||
|
||||
/*!
|
||||
\brief Blocking binary transmit method.
|
||||
Overloads for string-based transmissions are implemented in PhysicalLayer.
|
||||
|
|
Loading…
Add table
Reference in a new issue