mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2024-10-01 03:15:40 -04:00
Added continual RSSI monitoring for tuned channel
This commit is contained in:
parent
20d3e85c20
commit
2c826fb3dc
13
LoRa.cpp
13
LoRa.cpp
@ -49,6 +49,7 @@
|
|||||||
#define REG_MODEM_STAT 0x18
|
#define REG_MODEM_STAT 0x18
|
||||||
#define REG_PKT_SNR_VALUE 0x19
|
#define REG_PKT_SNR_VALUE 0x19
|
||||||
#define REG_PKT_RSSI_VALUE 0x1a
|
#define REG_PKT_RSSI_VALUE 0x1a
|
||||||
|
#define REG_RSSI_VALUE 0x1b
|
||||||
#define REG_MODEM_CONFIG_1 0x1d
|
#define REG_MODEM_CONFIG_1 0x1d
|
||||||
#define REG_MODEM_CONFIG_2 0x1e
|
#define REG_MODEM_CONFIG_2 0x1e
|
||||||
#define REG_PREAMBLE_MSB 0x20
|
#define REG_PREAMBLE_MSB 0x20
|
||||||
@ -239,6 +240,18 @@ uint8_t LoRaClass::modemStatus() {
|
|||||||
return readRegister(REG_MODEM_STAT);
|
return readRegister(REG_MODEM_STAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t LoRaClass::currentRssiRaw() {
|
||||||
|
uint8_t rssi = readRegister(REG_RSSI_VALUE);
|
||||||
|
return rssi;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ISR_VECT LoRaClass::currentRssi() {
|
||||||
|
int rssi = (int)readRegister(REG_RSSI_VALUE) - RSSI_OFFSET;
|
||||||
|
if (_frequency < 820E6) rssi -= 7;
|
||||||
|
return rssi;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t LoRaClass::packetRssiRaw() {
|
uint8_t LoRaClass::packetRssiRaw() {
|
||||||
uint8_t pkt_rssi_value = readRegister(REG_PKT_RSSI_VALUE);
|
uint8_t pkt_rssi_value = readRegister(REG_PKT_RSSI_VALUE);
|
||||||
return pkt_rssi_value;
|
return pkt_rssi_value;
|
||||||
|
2
LoRa.h
2
LoRa.h
@ -31,7 +31,9 @@ public:
|
|||||||
|
|
||||||
int parsePacket(int size = 0);
|
int parsePacket(int size = 0);
|
||||||
int packetRssi();
|
int packetRssi();
|
||||||
|
int currentRssi();
|
||||||
uint8_t packetRssiRaw();
|
uint8_t packetRssiRaw();
|
||||||
|
uint8_t currentRssiRaw();
|
||||||
uint8_t packetSnrRaw();
|
uint8_t packetSnrRaw();
|
||||||
float packetSnr();
|
float packetSnr();
|
||||||
long packetFrequencyError();
|
long packetFrequencyError();
|
||||||
|
Loading…
Reference in New Issue
Block a user