Method SetBitrateTolerance added for CC1101, Updated error handling (#1152)
* Update TypeDef.h * Update CC1101.h * Update CC1101.cpp * Update CC1101.cpp Update of error handling
This commit is contained in:
parent
ace0997359
commit
61a4cae935
3 changed files with 21 additions and 0 deletions
|
@ -292,6 +292,11 @@
|
|||
*/
|
||||
#define RADIOLIB_ERR_INVALID_OOK_RSSI_PEAK_TYPE (-108)
|
||||
|
||||
/*!
|
||||
\brief Supplied Bitrate tolerance value is out of Range.
|
||||
*/
|
||||
#define RADIOLIB_ERR_INVALID_BIT_RATE_TOLERANCE_VALUE (-109)
|
||||
|
||||
// APRS status codes
|
||||
|
||||
/*!
|
||||
|
|
|
@ -470,6 +470,15 @@ int16_t CC1101::setBitRate(float br) {
|
|||
return(state);
|
||||
}
|
||||
|
||||
int16_t CC1101::setBitRateTolerance(uint8_t brt) {
|
||||
if (brt > 0x03) return (RADIOLIB_ERR_INVALID_BIT_RATE_TOLERANCE_VALUE);
|
||||
|
||||
// Set Bit Rate tolerance
|
||||
int16_t state = SPIsetRegValue(RADIOLIB_CC1101_REG_BSCFG, brt, 1, 0);
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
||||
int16_t CC1101::setRxBandwidth(float rxBw) {
|
||||
RADIOLIB_CHECK_RANGE(rxBw, 58.0, 812.0, RADIOLIB_ERR_INVALID_RX_BANDWIDTH);
|
||||
|
||||
|
|
|
@ -738,6 +738,13 @@ class CC1101: public PhysicalLayer {
|
|||
*/
|
||||
int16_t setBitRate(float br) override;
|
||||
|
||||
/*!
|
||||
\brief Sets bit rate tolerance in BSCFG register. Allowed values are 0:(0%), 1(3,125%), 2:(6,25%) and 3:(12,5%).
|
||||
\param brt Bit rate tolerance to be set.
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setBitRateTolerance(uint8_t brt);
|
||||
|
||||
/*!
|
||||
\brief Sets receiver bandwidth. Allowed values are 58, 68, 81, 102, 116, 135, 162,
|
||||
203, 232, 270, 325, 406, 464, 541, 650 and 812 kHz.
|
||||
|
|
Loading…
Add table
Reference in a new issue