[LR11x0] Use IRQ instead of DIO1 as pin name

This commit is contained in:
jgromes 2024-04-21 08:34:00 +02:00
parent 01208574d9
commit 9451f36332
9 changed files with 23 additions and 23 deletions

View file

@ -25,7 +25,7 @@
// LR1110 has the following connections:
// NSS pin: 10
// DIO1 pin: 2
// IRQ pin: 2
// NRST pin: 3
// BUSY pin: 9
LR1110 radio = new Module(10, 2, 3, 9);

View file

@ -20,7 +20,7 @@
// LR1110 has the following connections:
// NSS pin: 10
// DIO1 pin: 2
// IRQ pin: 2
// NRST pin: 3
// BUSY pin: 9
LR1110 radio = new Module(10, 2, 3, 9);
@ -45,7 +45,7 @@ void setup() {
// set the function that will be called
// when LoRa packet or timeout is detected
radio.setDio1Action(setFlag);
radio.setIrqAction(setFlag);
// start scanning the channel
Serial.print(F("[LR1110] Starting scan for LoRa preamble ... "));

View file

@ -21,7 +21,7 @@
// LR1110 has the following connections:
// NSS pin: 10
// DIO1 pin: 2
// IRQ pin: 2
// NRST pin: 3
// BUSY pin: 9
LR1110 radio = new Module(10, 2, 3, 9);

View file

@ -30,7 +30,7 @@
// LR1110 has the following connections:
// NSS pin: 10
// DIO1 pin: 2
// IRQ pin: 2
// NRST pin: 3
// BUSY pin: 9
LR1110 radio = new Module(10, 2, 3, 9);

View file

@ -26,7 +26,7 @@
// LR1110 has the following connections:
// NSS pin: 10
// DIO1 pin: 2
// IRQ pin: 2
// NRST pin: 3
// BUSY pin: 9
LR1110 radio = new Module(10, 2, 3, 9);

View file

@ -21,7 +21,7 @@
// LR1110 has the following connections:
// NSS pin: 10
// DIO1 pin: 2
// IRQ pin: 2
// NRST pin: 3
// BUSY pin: 9
LR1110 radio = new Module(10, 2, 3, 9);

View file

@ -22,7 +22,7 @@
// LR1110 has the following connections:
// NSS pin: 10
// DIO1 pin: 2
// IRQ pin: 2
// NRST pin: 3
// BUSY pin: 9
LR1110 radio = new Module(10, 2, 3, 9);

View file

@ -373,28 +373,28 @@ int16_t LR11x0::sleep(bool retainConfig, uint32_t sleepTime) {
return(state);
}
void LR11x0::setDio1Action(void (*func)(void)) {
void LR11x0::setIrqAction(void (*func)(void)) {
this->mod->hal->attachInterrupt(this->mod->hal->pinToInterrupt(this->mod->getIrq()), func, this->mod->hal->GpioInterruptRising);
}
void LR11x0::clearDio1Action() {
void LR11x0::clearIrqAction() {
this->mod->hal->detachInterrupt(this->mod->hal->pinToInterrupt(this->mod->getIrq()));
}
void LR11x0::setPacketReceivedAction(void (*func)(void)) {
this->setDio1Action(func);
this->setIrqAction(func);
}
void LR11x0::clearPacketReceivedAction() {
this->clearDio1Action();
this->clearIrqAction();
}
void LR11x0::setPacketSentAction(void (*func)(void)) {
this->setDio1Action(func);
this->setIrqAction(func);
}
void LR11x0::clearPacketSentAction() {
this->clearDio1Action();
this->clearIrqAction();
}
int16_t LR11x0::startTransmit(uint8_t* data, size_t len, uint8_t addr) {

View file

@ -663,15 +663,15 @@ class LR11x0: public PhysicalLayer {
// interrupt methods
/*!
\brief Sets interrupt service routine to call when DIO1 activates.
\brief Sets interrupt service routine to call when IRQ1 activates.
\param func ISR to call.
*/
void setDio1Action(void (*func)(void));
void setIrqAction(void (*func)(void));
/*!
\brief Clears interrupt service routine to call when DIO1 activates.
\brief Clears interrupt service routine to call when IRQ1 activates.
*/
void clearDio1Action();
void clearIrqAction();
/*!
\brief Sets interrupt service routine to call when a packet is received.
@ -720,13 +720,13 @@ class LR11x0: public PhysicalLayer {
int16_t startReceive();
/*!
\brief Interrupt-driven receive method. DIO1 will be activated when full packet is received.
\brief Interrupt-driven receive method. IRQ1 will be activated when full packet is received.
\param timeout Raw timeout value, expressed as multiples of 1/32.768 kHz (approximately 30.52 us).
Defaults to RADIOLIB_LR11X0_RX_TIMEOUT_INF for infinite timeout (Rx continuous mode),
set to RADIOLIB_LR11X0_RX_TIMEOUT_NONE for no timeout (Rx single mode).
If timeout other than infinite is set, signal will be generated on DIO1.
If timeout other than infinite is set, signal will be generated on IRQ1.
\param irqFlags Sets the IRQ flags that will trigger DIO1, defaults to RADIOLIB_LR11X0_IRQ_RX_DONE.
\param irqFlags Sets the IRQ flags that will trigger IRQ1, defaults to RADIOLIB_LR11X0_IRQ_RX_DONE.
\param len Only for PhysicalLayer compatibility, not used.
\returns \ref status_codes
*/
@ -749,14 +749,14 @@ class LR11x0: public PhysicalLayer {
int16_t readData(uint8_t* data, size_t len) override;
/*!
\brief Interrupt-driven channel activity detection method. DIO1 will be activated
\brief Interrupt-driven channel activity detection method. IRQ1 will be activated
when LoRa preamble is detected, or upon timeout. Defaults to CAD parameter values recommended by AN1200.48.
\returns \ref status_codes
*/
int16_t startChannelScan() override;
/*!
\brief Interrupt-driven channel activity detection method. DIO1 will be activated
\brief Interrupt-driven channel activity detection method. IRQ1 will be activated
when LoRa preamble is detected, or upon timeout.
\param symbolNum Number of symbols for CAD detection.
\param detPeak Peak value for CAD detection.