[nRF24] Added "isCarrierDetected()"

This commit is contained in:
Andrea Guglielmini 2020-02-26 15:54:41 +01:00
parent c23b9302b0
commit 93981f1fcb
2 changed files with 11 additions and 0 deletions

View file

@ -426,6 +426,10 @@ int16_t nRF24::getStatus(uint8_t mask) {
return(_mod->SPIgetRegValue(NRF24_REG_STATUS) & mask); return(_mod->SPIgetRegValue(NRF24_REG_STATUS) & mask);
} }
bool nRF24::isCarrierDetected() {
return(_mod->SPIgetRegValue(NRF24_REG_RPD, 0,0)) == 1;
}
int16_t nRF24::setFrequencyDeviation(float freqDev) { int16_t nRF24::setFrequencyDeviation(float freqDev) {
// nRF24 is unable to set frequency deviation // nRF24 is unable to set frequency deviation
// this method is implemented only for PhysicalLayer compatibility // this method is implemented only for PhysicalLayer compatibility

View file

@ -392,6 +392,13 @@ class nRF24: public PhysicalLayer {
*/ */
int16_t getStatus(uint8_t mask = 0xFF); int16_t getStatus(uint8_t mask = 0xFF);
/*!
\brief Checks if carrier was detected during last RX
\returns Whatever the carrier was above threshold.
*/
bool isCarrierDetected();
/*! /*!
\brief Dummy configuration method, to ensure PhysicalLayer compatibility. \brief Dummy configuration method, to ensure PhysicalLayer compatibility.