[nRF24] Added TRNG support

This commit is contained in:
jgromes 2020-09-13 17:52:53 +02:00
parent e7fb555192
commit 5376931b02
2 changed files with 13 additions and 0 deletions

View file

@ -503,6 +503,12 @@ int16_t nRF24::setEncoding(uint8_t encoding) {
return(ERR_NONE); return(ERR_NONE);
} }
uint8_t nRF24::random() {
// nRF24 is unable to measure RSSI, hence no TRNG
// this method is implemented only for PhysicalLayer compatibility
return(0);
}
void nRF24::clearIRQ() { void nRF24::clearIRQ() {
// clear status bits // clear status bits
_mod->SPIsetRegValue(NRF24_REG_STATUS, NRF24_RX_DR | NRF24_TX_DS | NRF24_MAX_RT, 6, 4); _mod->SPIsetRegValue(NRF24_REG_STATUS, NRF24_RX_DR | NRF24_TX_DS | NRF24_MAX_RT, 6, 4);

View file

@ -464,6 +464,13 @@ class nRF24: public PhysicalLayer {
*/ */
int16_t setEncoding(uint8_t encoding) override; int16_t setEncoding(uint8_t encoding) override;
/*!
\brief Dummy random method, to ensure PhysicalLayer compatibility.
\returns Always returns 0.
*/
uint8_t random();
#ifndef RADIOLIB_GODMODE #ifndef RADIOLIB_GODMODE
private: private:
#endif #endif