[SX127x] Fixed typos
This commit is contained in:
parent
f1f995e9d8
commit
caa05f8ad8
8 changed files with 23 additions and 27 deletions
|
@ -59,11 +59,11 @@ void loop() {
|
||||||
|
|
||||||
if (state == PREAMBLE_DETECTED) {
|
if (state == PREAMBLE_DETECTED) {
|
||||||
// LoRa preamble was detected
|
// LoRa preamble was detected
|
||||||
Serial.println(F(" detected preamble!"));
|
Serial.println(F("detected preamble!"));
|
||||||
|
|
||||||
} else if (state == CHANNEL_FREE) {
|
} else if (state == CHANNEL_FREE) {
|
||||||
// no preamble was detected, channel is free
|
// no preamble was detected, channel is free
|
||||||
Serial.println(F(" channel is free!"));
|
Serial.println(F("channel is free!"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,8 +97,8 @@ void loop() {
|
||||||
// transmit FSK packet
|
// transmit FSK packet
|
||||||
int state = fsk.transmit("Hello World!");
|
int state = fsk.transmit("Hello World!");
|
||||||
/*
|
/*
|
||||||
byte byteArr[] = {0x01, 0x23, 0x45, 0x56,
|
byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
|
||||||
0x78, 0xAB, 0xCD, 0xEF};
|
0x89, 0xAB, 0xCD, 0xEF};
|
||||||
int state = lora.transmit(byteArr, 8);
|
int state = lora.transmit(byteArr, 8);
|
||||||
*/
|
*/
|
||||||
if (state == ERR_NONE) {
|
if (state == ERR_NONE) {
|
||||||
|
|
|
@ -118,7 +118,7 @@ void loop() {
|
||||||
// you can also read received data as byte array
|
// you can also read received data as byte array
|
||||||
/*
|
/*
|
||||||
byte byteArr[8];
|
byte byteArr[8];
|
||||||
int state = lora.receive(byteArr, 8);
|
int state = lora.readData(byteArr, 8);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (state == ERR_NONE) {
|
if (state == ERR_NONE) {
|
||||||
|
|
|
@ -91,9 +91,6 @@ void setup() {
|
||||||
// you can also change the settings at runtime
|
// you can also change the settings at runtime
|
||||||
// and check if the configuration was changed successfully
|
// and check if the configuration was changed successfully
|
||||||
|
|
||||||
// different modules accept different parameters
|
|
||||||
// see https://github.com/jgromes/LoRaLib/wiki/Supported-LoRa-modules
|
|
||||||
|
|
||||||
// set carrier frequency to 433.5 MHz
|
// set carrier frequency to 433.5 MHz
|
||||||
if (loraSX1278.setFrequency(433.5) == ERR_INVALID_FREQUENCY) {
|
if (loraSX1278.setFrequency(433.5) == ERR_INVALID_FREQUENCY) {
|
||||||
Serial.println(F("Selected frequency is invalid for this module!"));
|
Serial.println(F("Selected frequency is invalid for this module!"));
|
||||||
|
@ -147,14 +144,14 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set amplifier gain to 1 (accepted range is 1 - 6, where 1 is maximum gain)
|
// set amplifier gain to 1 (accepted range is 1 - 6, where 1 is maximum gain)
|
||||||
// NOTE: set value to 0 to enable autmatic gain control
|
// NOTE: set value to 0 to enable automatic gain control
|
||||||
// leave at 0 unless you know what you're doing
|
// leave at 0 unless you know what you're doing
|
||||||
if (loraSX1278.setGain(1) == ERR_INVALID_GAIN) {
|
if (loraSX1278.setGain(1) == ERR_INVALID_GAIN) {
|
||||||
Serial.println(F("Selected gain is invalid for this module!"));
|
Serial.println(F("Selected gain is invalid for this module!"));
|
||||||
while (true);
|
while (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.println(F("All settings succesfully changed!"));
|
Serial.println(F("All settings successfully changed!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
|
@ -63,7 +63,7 @@ void loop() {
|
||||||
|
|
||||||
// you can also transmit byte array up to 256 bytes long
|
// you can also transmit byte array up to 256 bytes long
|
||||||
/*
|
/*
|
||||||
byte byteArr[] = {0x01, 0x23, 0x45, 0x56, 0x78, 0xAB, 0xCD, 0xEF};
|
byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
|
||||||
int state = lora.transmit(byteArr, 8);
|
int state = lora.transmit(byteArr, 8);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -78,11 +78,11 @@ void loop() {
|
||||||
|
|
||||||
} else if (state == ERR_PACKET_TOO_LONG) {
|
} else if (state == ERR_PACKET_TOO_LONG) {
|
||||||
// the supplied packet was longer than 256 bytes
|
// the supplied packet was longer than 256 bytes
|
||||||
Serial.println(F(" too long!"));
|
Serial.println(F("too long!"));
|
||||||
|
|
||||||
} else if (state == ERR_TX_TIMEOUT) {
|
} else if (state == ERR_TX_TIMEOUT) {
|
||||||
// timeout occured while transmitting packet
|
// timeout occurred while transmitting packet
|
||||||
Serial.println(F(" timeout!"));
|
Serial.println(F("timeout!"));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// some other error occurred
|
// some other error occurred
|
||||||
|
|
|
@ -67,9 +67,9 @@ void setup() {
|
||||||
|
|
||||||
// you can also transmit byte array up to 256 bytes long
|
// you can also transmit byte array up to 256 bytes long
|
||||||
/*
|
/*
|
||||||
byte byteArr[] = {0x01, 0x23, 0x45, 0x56,
|
byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
|
||||||
0x78, 0xAB, 0xCD, 0xEF};
|
0x89, 0xAB, 0xCD, 0xEF};
|
||||||
state = lora.transmit(byteArr, 8);
|
state = lora.startTransmit(byteArr, 8);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,9 +129,9 @@ void loop() {
|
||||||
|
|
||||||
// you can also transmit byte array up to 256 bytes long
|
// you can also transmit byte array up to 256 bytes long
|
||||||
/*
|
/*
|
||||||
byte byteArr[] = {0x01, 0x23, 0x45, 0x56,
|
byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
|
||||||
0x78, 0xAB, 0xCD, 0xEF};
|
0x89, 0xAB, 0xCD, 0xEF};
|
||||||
int state = lora.transmit(byteArr, 8);
|
int state = lora.startTransmit(byteArr, 8);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// we're ready to send more packets,
|
// we're ready to send more packets,
|
||||||
|
|
|
@ -43,7 +43,7 @@ int16_t SX127x::begin(uint8_t chipVersion, uint8_t syncWord, uint8_t currentLimi
|
||||||
state = SX127x::setPreambleLength(preambleLength);
|
state = SX127x::setPreambleLength(preambleLength);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// initalize internal variables
|
// initialize internal variables
|
||||||
_dataRate = 0.0;
|
_dataRate = 0.0;
|
||||||
|
|
||||||
return(state);
|
return(state);
|
||||||
|
|
|
@ -480,7 +480,7 @@
|
||||||
#define SX127X_FLAG_TX_READY 0b00100000 // 5 5 transmission ready (after PA ramp-up)
|
#define SX127X_FLAG_TX_READY 0b00100000 // 5 5 transmission ready (after PA ramp-up)
|
||||||
#define SX127X_FLAG_PLL_LOCK 0b00010000 // 4 4 PLL locked
|
#define SX127X_FLAG_PLL_LOCK 0b00010000 // 4 4 PLL locked
|
||||||
#define SX127X_FLAG_RSSI 0b00001000 // 3 3 RSSI value exceeds RSSI threshold
|
#define SX127X_FLAG_RSSI 0b00001000 // 3 3 RSSI value exceeds RSSI threshold
|
||||||
#define SX127X_FLAG_TIMEOUT 0b00000100 // 2 2 timeout occured
|
#define SX127X_FLAG_TIMEOUT 0b00000100 // 2 2 timeout occurred
|
||||||
#define SX127X_FLAG_PREAMBLE_DETECT 0b00000010 // 1 1 valid preamble was detected
|
#define SX127X_FLAG_PREAMBLE_DETECT 0b00000010 // 1 1 valid preamble was detected
|
||||||
#define SX127X_FLAG_SYNC_ADDRESS_MATCH 0b00000001 // 0 0 sync address matched
|
#define SX127X_FLAG_SYNC_ADDRESS_MATCH 0b00000001 // 0 0 sync address matched
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@
|
||||||
#define SX127X_FLAG_FIFO_FULL 0b10000000 // 7 7 FIFO is full
|
#define SX127X_FLAG_FIFO_FULL 0b10000000 // 7 7 FIFO is full
|
||||||
#define SX127X_FLAG_FIFO_EMPTY 0b01000000 // 6 6 FIFO is empty
|
#define SX127X_FLAG_FIFO_EMPTY 0b01000000 // 6 6 FIFO is empty
|
||||||
#define SX127X_FLAG_FIFO_LEVEL 0b00100000 // 5 5 number of bytes in FIFO exceeds FIFO_THRESHOLD
|
#define SX127X_FLAG_FIFO_LEVEL 0b00100000 // 5 5 number of bytes in FIFO exceeds FIFO_THRESHOLD
|
||||||
#define SX127X_FLAG_FIFO_OVERRUN 0b00010000 // 4 4 FIFO overrun occured
|
#define SX127X_FLAG_FIFO_OVERRUN 0b00010000 // 4 4 FIFO overrun occurred
|
||||||
#define SX127X_FLAG_PACKET_SENT 0b00001000 // 3 3 packet was successfully sent
|
#define SX127X_FLAG_PACKET_SENT 0b00001000 // 3 3 packet was successfully sent
|
||||||
#define SX127X_FLAG_PAYLOAD_READY 0b00000100 // 2 2 packet was successfully received
|
#define SX127X_FLAG_PAYLOAD_READY 0b00000100 // 2 2 packet was successfully received
|
||||||
#define SX127X_FLAG_CRC_OK 0b00000010 // 1 1 CRC check passed
|
#define SX127X_FLAG_CRC_OK 0b00000010 // 1 1 CRC check passed
|
||||||
|
@ -565,7 +565,7 @@ class SX127x: public PhysicalLayer {
|
||||||
int16_t begin(uint8_t chipVersion, uint8_t syncWord, uint8_t currentLimit, uint16_t preambleLength);
|
int16_t begin(uint8_t chipVersion, uint8_t syncWord, uint8_t currentLimit, uint16_t preambleLength);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Reset method. Will reset the chip to the default state using RST pin. Declared pure virtual since SX1272 and SX1278 implmentations differ.
|
\brief Reset method. Will reset the chip to the default state using RST pin. Declared pure virtual since SX1272 and SX1278 implementations differ.
|
||||||
*/
|
*/
|
||||||
virtual void reset() = 0;
|
virtual void reset() = 0;
|
||||||
|
|
||||||
|
@ -663,7 +663,6 @@ class SX127x: public PhysicalLayer {
|
||||||
*/
|
*/
|
||||||
int16_t packetMode();
|
int16_t packetMode();
|
||||||
|
|
||||||
|
|
||||||
// interrupt methods
|
// interrupt methods
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -880,7 +879,7 @@ class SX127x: public PhysicalLayer {
|
||||||
/*!
|
/*!
|
||||||
\brief Sets RSSI measurement configuration in FSK mode.
|
\brief Sets RSSI measurement configuration in FSK mode.
|
||||||
|
|
||||||
\param smoothingSamples Number of samples taken to avergae the RSSI result.
|
\param smoothingSamples Number of samples taken to average the RSSI result.
|
||||||
numSamples = 2 ^ (1 + smoothingSamples), allowed values are in range 0 (2 samples) - 7 (256 samples)
|
numSamples = 2 ^ (1 + smoothingSamples), allowed values are in range 0 (2 samples) - 7 (256 samples)
|
||||||
|
|
||||||
\param offset Signed RSSI offset that will be automatically compensated. 1 dB per LSB, defaults to 0, allowed values are in range -16 dB to +15 dB.
|
\param offset Signed RSSI offset that will be automatically compensated. 1 dB per LSB, defaults to 0, allowed values are in range -16 dB to +15 dB.
|
||||||
|
|
Loading…
Add table
Reference in a new issue