[SX126x] Added standby overload

pull/13/head
jgromes 2019-05-28 19:22:22 +02:00
rodzic fd4da5771c
commit ee7697e6dc
2 zmienionych plików z 16 dodań i 5 usunięć

Wyświetl plik

@ -322,6 +322,10 @@ int16_t SX126x::sleep() {
return(state); return(state);
} }
int16_t SX126x::standby() {
return(SX126x::standby(SX126X_STANDBY_RC));
}
int16_t SX126x::standby(uint8_t mode) { int16_t SX126x::standby(uint8_t mode) {
uint8_t data[] = {mode}; uint8_t data[] = {mode};
return(SPIwriteCommand(SX126X_CMD_SET_STANDBY, data, 1)); return(SPIwriteCommand(SX126X_CMD_SET_STANDBY, data, 1));

Wyświetl plik

@ -410,7 +410,7 @@ class SX126x: public PhysicalLayer {
int16_t transmitDirect(uint32_t frf = 0); int16_t transmitDirect(uint32_t frf = 0);
/*! /*!
\brief Starts direct mode reception. Only implemented for PhysicalLyer compatibility, as %SX126x series does not support direct mode reception. \brief Starts direct mode reception. Only implemented for PhysicalLayer compatibility, as %SX126x series does not support direct mode reception.
Will always return ERR_UNKNOWN. Will always return ERR_UNKNOWN.
\returns \ref status_codes \returns \ref status_codes
@ -432,13 +432,20 @@ class SX126x: public PhysicalLayer {
int16_t sleep(); int16_t sleep();
/*! /*!
\brief Sets the module to standby mode. \brief Sets the module to standby mode (overload for PhysicalLayer compatibility, uses 13 MHz RC oscillator).
\param mode Oscillator to be used in standby mode. Defaults to SX126X_STANDBY_RC (13 MHz RC oscillator), can also be set SX126X_STANDBY_XOSC (32 MHz external crystal oscillator).
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t standby(uint8_t mode = SX126X_STANDBY_RC); int16_t standby();
/*!
\brief Sets the module to standby mode.
\param mode Oscillator to be used in standby mode. Can be set to SX126X_STANDBY_RC (13 MHz RC oscillator) or SX126X_STANDBY_XOSC (32 MHz external crystal oscillator).
\returns \ref status_codes
*/
int16_t standby(uint8_t mode);
// interrupt methods // interrupt methods