[SX126x] Cleanup whitespaces
This commit is contained in:
parent
9b9a34bd2c
commit
dc2eb523a9
2 changed files with 88 additions and 88 deletions
|
@ -380,7 +380,7 @@ int16_t SX126x::directMode() {
|
||||||
// set preamble length to the maximum to prevent SX126x from exiting Tx mode for a while
|
// set preamble length to the maximum to prevent SX126x from exiting Tx mode for a while
|
||||||
state = setPreambleLength(0xFFFF);
|
state = setPreambleLength(0xFFFF);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
return(state);
|
return(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ int16_t SX126x::packetMode() {
|
||||||
// set mode to standby
|
// set mode to standby
|
||||||
int16_t state = standby();
|
int16_t state = standby();
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// set preamble length to the default
|
// set preamble length to the default
|
||||||
state = setPreambleLength(16);
|
state = setPreambleLength(16);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
@ -396,7 +396,7 @@ int16_t SX126x::packetMode() {
|
||||||
// disable TxDone interrupt
|
// disable TxDone interrupt
|
||||||
state = setDioIrqParams(RADIOLIB_SX126X_IRQ_NONE, RADIOLIB_SX126X_IRQ_NONE);
|
state = setDioIrqParams(RADIOLIB_SX126X_IRQ_NONE, RADIOLIB_SX126X_IRQ_NONE);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// restore the magic registers
|
// restore the magic registers
|
||||||
state = _mod->SPIsetRegValue(RADIOLIB_SX126X_REG_DIOX_IN_ENABLE, RADIOLIB_SX126X_DIO3_IN_DISABLED, 3, 3);
|
state = _mod->SPIsetRegValue(RADIOLIB_SX126X_REG_DIOX_IN_ENABLE, RADIOLIB_SX126X_DIO3_IN_DISABLED, 3, 3);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
@ -1951,15 +1951,15 @@ int16_t SX126x::config(uint8_t modem) {
|
||||||
|
|
||||||
int16_t SX126x::SPIparseStatus(uint8_t in) {
|
int16_t SX126x::SPIparseStatus(uint8_t in) {
|
||||||
if((in & 0b00001110) == RADIOLIB_SX126X_STATUS_CMD_TIMEOUT) {
|
if((in & 0b00001110) == RADIOLIB_SX126X_STATUS_CMD_TIMEOUT) {
|
||||||
return(RADIOLIB_ERR_SPI_CMD_TIMEOUT);
|
return(RADIOLIB_ERR_SPI_CMD_TIMEOUT);
|
||||||
} else if((in & 0b00001110) == RADIOLIB_SX126X_STATUS_CMD_INVALID) {
|
} else if((in & 0b00001110) == RADIOLIB_SX126X_STATUS_CMD_INVALID) {
|
||||||
return(RADIOLIB_ERR_SPI_CMD_INVALID);
|
return(RADIOLIB_ERR_SPI_CMD_INVALID);
|
||||||
} else if((in & 0b00001110) == RADIOLIB_SX126X_STATUS_CMD_FAILED) {
|
} else if((in & 0b00001110) == RADIOLIB_SX126X_STATUS_CMD_FAILED) {
|
||||||
return(RADIOLIB_ERR_SPI_CMD_FAILED);
|
return(RADIOLIB_ERR_SPI_CMD_FAILED);
|
||||||
} else if((in == 0x00) || (in == 0xFF)) {
|
} else if((in == 0x00) || (in == 0xFF)) {
|
||||||
return(RADIOLIB_ERR_CHIP_NOT_FOUND);
|
return(RADIOLIB_ERR_CHIP_NOT_FOUND);
|
||||||
}
|
}
|
||||||
return(RADIOLIB_ERR_NONE);
|
return(RADIOLIB_ERR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SX126x::findChip(uint8_t ver) {
|
bool SX126x::findChip(uint8_t ver) {
|
||||||
|
@ -1986,7 +1986,7 @@ bool SX126x::findChip(uint8_t ver) {
|
||||||
RADIOLIB_DEBUG_PRINT(F("SX126x not found! ("));
|
RADIOLIB_DEBUG_PRINT(F("SX126x not found! ("));
|
||||||
RADIOLIB_DEBUG_PRINT(i + 1);
|
RADIOLIB_DEBUG_PRINT(i + 1);
|
||||||
RADIOLIB_DEBUG_PRINTLN(F(" of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:"));
|
RADIOLIB_DEBUG_PRINTLN(F(" of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:"));
|
||||||
_mod->hexdump((uint8_t*)version, 16, RADIOLIB_SX126X_REG_VERSION_STRING);
|
_mod->hexdump((uint8_t*)version, 16, RADIOLIB_SX126X_REG_VERSION_STRING);
|
||||||
RADIOLIB_DEBUG_PRINT(F("Expected string: "));
|
RADIOLIB_DEBUG_PRINT(F("Expected string: "));
|
||||||
RADIOLIB_DEBUG_PRINTLN(versionBuff);
|
RADIOLIB_DEBUG_PRINTLN(versionBuff);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -947,124 +947,124 @@ class SX126x: public PhysicalLayer {
|
||||||
size_t getPacketLength(bool update = true) override;
|
size_t getPacketLength(bool update = true) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set modem in fixed packet length mode. Available in FSK mode only.
|
\brief Set modem in fixed packet length mode. Available in FSK mode only.
|
||||||
|
|
||||||
\param len Packet length.
|
\param len Packet length.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t fixedPacketLengthMode(uint8_t len = RADIOLIB_SX126X_MAX_PACKET_LENGTH);
|
int16_t fixedPacketLengthMode(uint8_t len = RADIOLIB_SX126X_MAX_PACKET_LENGTH);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set modem in variable packet length mode. Available in FSK mode only.
|
\brief Set modem in variable packet length mode. Available in FSK mode only.
|
||||||
|
|
||||||
\param len Maximum packet length.
|
\param len Maximum packet length.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t variablePacketLengthMode(uint8_t maxLen = RADIOLIB_SX126X_MAX_PACKET_LENGTH);
|
int16_t variablePacketLengthMode(uint8_t maxLen = RADIOLIB_SX126X_MAX_PACKET_LENGTH);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get expected time-on-air for a given size of payload
|
\brief Get expected time-on-air for a given size of payload
|
||||||
|
|
||||||
\param len Payload length in bytes.
|
\param len Payload length in bytes.
|
||||||
|
|
||||||
\returns Expected time-on-air in microseconds.
|
\returns Expected time-on-air in microseconds.
|
||||||
*/
|
*/
|
||||||
uint32_t getTimeOnAir(size_t len);
|
uint32_t getTimeOnAir(size_t len);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get instantaneous RSSI value during recption of the packet. Should switch to FSK receive mode for LBT implementation.
|
\brief Get instantaneous RSSI value during recption of the packet. Should switch to FSK receive mode for LBT implementation.
|
||||||
|
|
||||||
\returns Instantaneous RSSI value in dBm, in steps of 0.5dBm
|
\returns Instantaneous RSSI value in dBm, in steps of 0.5dBm
|
||||||
*/
|
*/
|
||||||
float getRSSIInst();
|
float getRSSIInst();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set implicit header mode for future reception/transmission.
|
\brief Set implicit header mode for future reception/transmission.
|
||||||
|
|
||||||
\param len Payload length in bytes.
|
\param len Payload length in bytes.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t implicitHeader(size_t len);
|
int16_t implicitHeader(size_t len);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set explicit header mode for future reception/transmission.
|
\brief Set explicit header mode for future reception/transmission.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t explicitHeader();
|
int16_t explicitHeader();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set regulator mode to LDO.
|
\brief Set regulator mode to LDO.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setRegulatorLDO();
|
int16_t setRegulatorLDO();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set regulator mode to DC-DC.
|
\brief Set regulator mode to DC-DC.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setRegulatorDCDC();
|
int16_t setRegulatorDCDC();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets transmission encoding. Available in FSK mode only. Serves only as alias for PhysicalLayer compatibility.
|
\brief Sets transmission encoding. Available in FSK mode only. Serves only as alias for PhysicalLayer compatibility.
|
||||||
|
|
||||||
\param encoding Encoding to be used. Set to 0 for NRZ, and 2 for whitening.
|
\param encoding Encoding to be used. Set to 0 for NRZ, and 2 for whitening.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setEncoding(uint8_t encoding) override;
|
int16_t setEncoding(uint8_t encoding) override;
|
||||||
|
|
||||||
/*! \copydoc Module::setRfSwitchPins */
|
/*! \copydoc Module::setRfSwitchPins */
|
||||||
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn);
|
||||||
|
|
||||||
/*! \copydoc Module::setRfSwitchTable */
|
/*! \copydoc Module::setRfSwitchTable */
|
||||||
void setRfSwitchTable(const RADIOLIB_PIN_TYPE (&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]);
|
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
|
\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()
|
the provided value, regardless of symbol length. To re-enable automatic LDRO configuration, call SX126x::autoLDRO()
|
||||||
|
|
||||||
\param enable Force LDRO to be always enabled (true) or disabled (false).
|
\param enable Force LDRO to be always enabled (true) or disabled (false).
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t forceLDRO(bool enable);
|
int16_t forceLDRO(bool enable);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Re-enables automatic LDRO configuration. Only available in LoRa mode. After calling this method, LDRO will be enabled automatically
|
\brief Re-enables automatic LDRO configuration. Only available in LoRa mode. After calling this method, LDRO will be enabled automatically
|
||||||
when symbol length exceeds 16 ms.
|
when symbol length exceeds 16 ms.
|
||||||
|
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t autoLDRO();
|
int16_t autoLDRO();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get one truly random byte from RSSI noise.
|
\brief Get one truly random byte from RSSI noise.
|
||||||
|
|
||||||
\returns TRNG byte.
|
\returns TRNG byte.
|
||||||
*/
|
*/
|
||||||
uint8_t randomByte();
|
uint8_t randomByte();
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE)
|
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE)
|
||||||
/*!
|
/*!
|
||||||
\brief Set interrupt service routine function to call when data bit is receveid in direct mode.
|
\brief Set interrupt service routine function to call when data bit is receveid in direct mode.
|
||||||
|
|
||||||
\param func Pointer to interrupt service routine.
|
\param func Pointer to interrupt service routine.
|
||||||
*/
|
*/
|
||||||
void setDirectAction(void (*func)(void));
|
void setDirectAction(void (*func)(void));
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Function to read and process data bit in direct reception mode.
|
\brief Function to read and process data bit in direct reception mode.
|
||||||
|
|
||||||
\param pin Pin on which to read.
|
\param pin Pin on which to read.
|
||||||
*/
|
*/
|
||||||
void readBit(RADIOLIB_PIN_TYPE pin);
|
void readBit(RADIOLIB_PIN_TYPE pin);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Upload binary patch into the SX126x device RAM.
|
\brief Upload binary patch into the SX126x device RAM.
|
||||||
|
|
Loading…
Add table
Reference in a new issue