[LR11x0] Make regulator mode and Rx gain config public (#1108)
This commit is contained in:
parent
0d491060b2
commit
c3e99c8698
2 changed files with 41 additions and 6 deletions
|
@ -44,6 +44,9 @@ int16_t LR11x0::begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t
|
|||
state = invertIQ(false);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
state = setRegulatorLDO();
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
return(RADIOLIB_ERR_NONE);
|
||||
}
|
||||
|
||||
|
@ -85,6 +88,9 @@ int16_t LR11x0::beginGFSK(float br, float freqDev, float rxBw, int8_t power, uin
|
|||
state = setCRC(2);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
state = setRegulatorLDO();
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
return(RADIOLIB_ERR_NONE);
|
||||
}
|
||||
|
||||
|
@ -103,6 +109,9 @@ int16_t LR11x0::beginLRFHSS(uint8_t bw, uint8_t cr, int8_t power, float tcxoVolt
|
|||
state = setSyncWord(0x12AD101B);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
state = setRegulatorLDO();
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// set fixed configuration
|
||||
return(setModulationParamsLrFhss(RADIOLIB_LR11X0_LR_FHSS_BIT_RATE_RAW, RADIOLIB_LR11X0_LR_FHSS_SHAPING_GAUSSIAN_BT_1_0));
|
||||
}
|
||||
|
@ -1363,6 +1372,19 @@ float LR11x0::getDataRate() const {
|
|||
return(this->dataRateMeasured);
|
||||
}
|
||||
|
||||
int16_t LR11x0::setRegulatorLDO() {
|
||||
return(this->setRegMode(RADIOLIB_LR11X0_REG_MODE_LDO));
|
||||
}
|
||||
|
||||
int16_t LR11x0::setRegulatorDCDC() {
|
||||
return(this->setRegMode(RADIOLIB_LR11X0_REG_MODE_DC_DC));
|
||||
}
|
||||
|
||||
int16_t LR11x0::setRxBoostedGainMode(bool en) {
|
||||
uint8_t buff[1] = { (uint8_t)en };
|
||||
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_SET_RX_BOOSTED, true, buff, sizeof(buff)));
|
||||
}
|
||||
|
||||
int16_t LR11x0::setLrFhssConfig(uint8_t bw, uint8_t cr, uint8_t hdrCount, uint16_t hopSeed) {
|
||||
// check active modem
|
||||
uint8_t type = RADIOLIB_LR11X0_PACKET_TYPE_NONE;
|
||||
|
@ -2476,11 +2498,6 @@ int16_t LR11x0::setGfskWhitParams(uint16_t seed) {
|
|||
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_SET_GFSK_WHIT_PARAMS, true, buff, sizeof(buff)));
|
||||
}
|
||||
|
||||
int16_t LR11x0::setRxBoosted(bool en) {
|
||||
uint8_t buff[1] = { (uint8_t)en };
|
||||
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_SET_RX_BOOSTED, true, buff, sizeof(buff)));
|
||||
}
|
||||
|
||||
int16_t LR11x0::setRangingParameter(uint8_t symbolNum) {
|
||||
// the first byte is reserved
|
||||
uint8_t buff[2] = { 0x00, symbolNum };
|
||||
|
|
|
@ -1247,6 +1247,25 @@ class LR11x0: public PhysicalLayer {
|
|||
*/
|
||||
float getDataRate() const;
|
||||
|
||||
/*!
|
||||
\brief Set regulator mode to LDO.
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setRegulatorLDO();
|
||||
|
||||
/*!
|
||||
\brief Set regulator mode to DC-DC.
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setRegulatorDCDC();
|
||||
|
||||
/*!
|
||||
\brief Enables or disables Rx Boosted Gain mode (additional Rx gain for increased power consumption).
|
||||
\param en True for Rx Boosted Gain, false for Rx Power Saving Gain
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t setRxBoostedGainMode(bool en);
|
||||
|
||||
/*!
|
||||
\brief Sets LR-FHSS configuration.
|
||||
\param bw LR-FHSS bandwidth, one of RADIOLIB_LR11X0_LR_FHSS_BW_* values.
|
||||
|
@ -1416,7 +1435,6 @@ class LR11x0: public PhysicalLayer {
|
|||
int16_t setRangingTxRxDelay(uint32_t delay);
|
||||
int16_t setGfskCrcParams(uint32_t init, uint32_t poly);
|
||||
int16_t setGfskWhitParams(uint16_t seed);
|
||||
int16_t setRxBoosted(bool en);
|
||||
int16_t setRangingParameter(uint8_t symbolNum);
|
||||
int16_t setRssiCalibration(const int8_t* tune, int16_t gainOffset);
|
||||
int16_t setLoRaSyncWord(uint8_t sync);
|
||||
|
|
Loading…
Add table
Reference in a new issue