Skip to content

Commit

Permalink
[SX127x] Added PHY startReceive (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Mar 26, 2023
1 parent 9dd401e commit 5d365d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/SX127x/SX127x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ int16_t SX127x::startReceive(uint8_t len, uint8_t mode) {
return(setMode(mode));
}

int16_t SX127x::startReceive(uint32_t mode, uint16_t irqFlags, uint16_t irqMask, size_t len) {
(void)irqFlags;
(void)irqMask;
return(startReceive((uint8_t)len, (uint8_t)mode));
}

void SX127x::setDio0Action(void (*func)(void), RADIOLIB_INTERRUPT_STATUS dir) {
_mod->attachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()), func, dir);
}
Expand Down
15 changes: 15 additions & 0 deletions src/modules/SX127x/SX127x.h
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,21 @@ class SX127x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t startReceive(uint8_t len = 0, uint8_t mode = RADIOLIB_SX127X_RXCONTINUOUS);

/*!
\brief Interrupt-driven receive method, implemented for compatibility with PhysicalLayer.
\param mode Receive mode to be used.
\param irqFlags Ignored.
\param irqMask Ignored.
\param len Expected length of packet to be received. Required for LoRa spreading factor 6.
\returns \ref status_codes
*/
int16_t startReceive(uint32_t mode, uint16_t irqFlags, uint16_t irqMask, size_t len);

/*!
\brief Reads data that was received after calling startReceive method. This method reads len characters.
Expand Down

0 comments on commit 5d365d4

Please sign in to comment.