[CC1101] Added direct reception support

This commit is contained in:
jgromes 2021-06-14 21:14:47 +02:00
parent aa53706b31
commit 06d40c78bc
2 changed files with 22 additions and 1 deletions

View file

@ -865,11 +865,18 @@ uint8_t CC1101::random() {
return(randByte); return(randByte);
} }
int16_t CC1101::getChipVersion() { int16_t CC1101::getChipVersion() {
return(SPIgetRegValue(CC1101_REG_VERSION)); return(SPIgetRegValue(CC1101_REG_VERSION));
} }
void CC1101::setDirectAction(void (*func)(void)) {
setGdo2Action(func);
}
void CC1101::readBit(RADIOLIB_PIN_TYPE pin) {
updateDirectBuffer((uint8_t)digitalRead(pin));
}
int16_t CC1101::config() { int16_t CC1101::config() {
// Reset the radio. Registers may be dirty from previous usage. // Reset the radio. Registers may be dirty from previous usage.
SPIsendCommand(CC1101_CMD_RESET); SPIsendCommand(CC1101_CMD_RESET);

View file

@ -897,6 +897,20 @@ class CC1101: public PhysicalLayer {
*/ */
int16_t getChipVersion(); int16_t getChipVersion();
/*!
\brief Set interrupt service routine function to call when data bit is receveid in direct mode.
\param func Pointer to interrupt service routine.
*/
void setDirectAction(void (*func)(void));
/*!
\brief Function to read and process data bit in direct reception mode.
\param pin Pin on which to read.
*/
void readBit(RADIOLIB_PIN_TYPE pin);
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL) #if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL)
protected: protected:
#endif #endif