[LR11x0] Use IRQ instead of DIO1 as pin name
This commit is contained in:
parent
01208574d9
commit
9451f36332
9 changed files with 23 additions and 23 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
// LR1110 has the following connections:
|
// LR1110 has the following connections:
|
||||||
// NSS pin: 10
|
// NSS pin: 10
|
||||||
// DIO1 pin: 2
|
// IRQ pin: 2
|
||||||
// NRST pin: 3
|
// NRST pin: 3
|
||||||
// BUSY pin: 9
|
// BUSY pin: 9
|
||||||
LR1110 radio = new Module(10, 2, 3, 9);
|
LR1110 radio = new Module(10, 2, 3, 9);
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
// LR1110 has the following connections:
|
// LR1110 has the following connections:
|
||||||
// NSS pin: 10
|
// NSS pin: 10
|
||||||
// DIO1 pin: 2
|
// IRQ pin: 2
|
||||||
// NRST pin: 3
|
// NRST pin: 3
|
||||||
// BUSY pin: 9
|
// BUSY pin: 9
|
||||||
LR1110 radio = new Module(10, 2, 3, 9);
|
LR1110 radio = new Module(10, 2, 3, 9);
|
||||||
|
@ -45,7 +45,7 @@ void setup() {
|
||||||
|
|
||||||
// set the function that will be called
|
// set the function that will be called
|
||||||
// when LoRa packet or timeout is detected
|
// when LoRa packet or timeout is detected
|
||||||
radio.setDio1Action(setFlag);
|
radio.setIrqAction(setFlag);
|
||||||
|
|
||||||
// start scanning the channel
|
// start scanning the channel
|
||||||
Serial.print(F("[LR1110] Starting scan for LoRa preamble ... "));
|
Serial.print(F("[LR1110] Starting scan for LoRa preamble ... "));
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
// LR1110 has the following connections:
|
// LR1110 has the following connections:
|
||||||
// NSS pin: 10
|
// NSS pin: 10
|
||||||
// DIO1 pin: 2
|
// IRQ pin: 2
|
||||||
// NRST pin: 3
|
// NRST pin: 3
|
||||||
// BUSY pin: 9
|
// BUSY pin: 9
|
||||||
LR1110 radio = new Module(10, 2, 3, 9);
|
LR1110 radio = new Module(10, 2, 3, 9);
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
// LR1110 has the following connections:
|
// LR1110 has the following connections:
|
||||||
// NSS pin: 10
|
// NSS pin: 10
|
||||||
// DIO1 pin: 2
|
// IRQ pin: 2
|
||||||
// NRST pin: 3
|
// NRST pin: 3
|
||||||
// BUSY pin: 9
|
// BUSY pin: 9
|
||||||
LR1110 radio = new Module(10, 2, 3, 9);
|
LR1110 radio = new Module(10, 2, 3, 9);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
// LR1110 has the following connections:
|
// LR1110 has the following connections:
|
||||||
// NSS pin: 10
|
// NSS pin: 10
|
||||||
// DIO1 pin: 2
|
// IRQ pin: 2
|
||||||
// NRST pin: 3
|
// NRST pin: 3
|
||||||
// BUSY pin: 9
|
// BUSY pin: 9
|
||||||
LR1110 radio = new Module(10, 2, 3, 9);
|
LR1110 radio = new Module(10, 2, 3, 9);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
// LR1110 has the following connections:
|
// LR1110 has the following connections:
|
||||||
// NSS pin: 10
|
// NSS pin: 10
|
||||||
// DIO1 pin: 2
|
// IRQ pin: 2
|
||||||
// NRST pin: 3
|
// NRST pin: 3
|
||||||
// BUSY pin: 9
|
// BUSY pin: 9
|
||||||
LR1110 radio = new Module(10, 2, 3, 9);
|
LR1110 radio = new Module(10, 2, 3, 9);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
// LR1110 has the following connections:
|
// LR1110 has the following connections:
|
||||||
// NSS pin: 10
|
// NSS pin: 10
|
||||||
// DIO1 pin: 2
|
// IRQ pin: 2
|
||||||
// NRST pin: 3
|
// NRST pin: 3
|
||||||
// BUSY pin: 9
|
// BUSY pin: 9
|
||||||
LR1110 radio = new Module(10, 2, 3, 9);
|
LR1110 radio = new Module(10, 2, 3, 9);
|
||||||
|
|
|
@ -373,28 +373,28 @@ int16_t LR11x0::sleep(bool retainConfig, uint32_t sleepTime) {
|
||||||
return(state);
|
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);
|
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()));
|
this->mod->hal->detachInterrupt(this->mod->hal->pinToInterrupt(this->mod->getIrq()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LR11x0::setPacketReceivedAction(void (*func)(void)) {
|
void LR11x0::setPacketReceivedAction(void (*func)(void)) {
|
||||||
this->setDio1Action(func);
|
this->setIrqAction(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LR11x0::clearPacketReceivedAction() {
|
void LR11x0::clearPacketReceivedAction() {
|
||||||
this->clearDio1Action();
|
this->clearIrqAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LR11x0::setPacketSentAction(void (*func)(void)) {
|
void LR11x0::setPacketSentAction(void (*func)(void)) {
|
||||||
this->setDio1Action(func);
|
this->setIrqAction(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LR11x0::clearPacketSentAction() {
|
void LR11x0::clearPacketSentAction() {
|
||||||
this->clearDio1Action();
|
this->clearIrqAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t LR11x0::startTransmit(uint8_t* data, size_t len, uint8_t addr) {
|
int16_t LR11x0::startTransmit(uint8_t* data, size_t len, uint8_t addr) {
|
||||||
|
|
|
@ -663,15 +663,15 @@ class LR11x0: public PhysicalLayer {
|
||||||
// interrupt methods
|
// 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.
|
\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.
|
\brief Sets interrupt service routine to call when a packet is received.
|
||||||
|
@ -720,13 +720,13 @@ class LR11x0: public PhysicalLayer {
|
||||||
int16_t startReceive();
|
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).
|
\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),
|
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).
|
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.
|
\param len Only for PhysicalLayer compatibility, not used.
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
|
@ -749,14 +749,14 @@ class LR11x0: public PhysicalLayer {
|
||||||
int16_t readData(uint8_t* data, size_t len) override;
|
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.
|
when LoRa preamble is detected, or upon timeout. Defaults to CAD parameter values recommended by AN1200.48.
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t startChannelScan() override;
|
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.
|
when LoRa preamble is detected, or upon timeout.
|
||||||
\param symbolNum Number of symbols for CAD detection.
|
\param symbolNum Number of symbols for CAD detection.
|
||||||
\param detPeak Peak value for CAD detection.
|
\param detPeak Peak value for CAD detection.
|
||||||
|
|
Loading…
Add table
Reference in a new issue