From 32602307b741dce78c7e8da5f272d1f845b30e13 Mon Sep 17 00:00:00 2001 From: jgromes Date: Tue, 11 Feb 2020 14:27:00 +0100 Subject: [PATCH] [RF69] Swapped frequency deviation and rx bandwdith in begin method --- examples/RF69/RF69_Receive/RF69_Receive.ino | 2 +- examples/RF69/RF69_Receive_AES/RF69_Receive_AES.ino | 2 +- .../RF69/RF69_Receive_Address/RF69_Receive_Address.ino | 2 +- .../RF69_Receive_Interrupt/RF69_Receive_Interrupt.ino | 4 ++-- examples/RF69/RF69_Settings/RF69_Settings.ino | 6 +++--- examples/RF69/RF69_Transmit/RF69_Transmit.ino | 2 +- examples/RF69/RF69_Transmit_AES/RF69_Transmit_AES.ino | 2 +- .../RF69/RF69_Transmit_Address/RF69_Transmit_Address.ino | 2 +- .../RF69_Transmit_Interrupt/RF69_Transmit_Interrupt.ino | 8 ++++---- src/modules/RF69/RF69.cpp | 2 +- src/modules/RF69/RF69.h | 6 +++--- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/RF69/RF69_Receive/RF69_Receive.ino b/examples/RF69/RF69_Receive/RF69_Receive.ino index e45e45c0..597ee63e 100644 --- a/examples/RF69/RF69_Receive/RF69_Receive.ino +++ b/examples/RF69/RF69_Receive/RF69_Receive.ino @@ -33,8 +33,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); diff --git a/examples/RF69/RF69_Receive_AES/RF69_Receive_AES.ino b/examples/RF69/RF69_Receive_AES/RF69_Receive_AES.ino index 9fb3a5c6..7c947cf0 100644 --- a/examples/RF69/RF69_Receive_AES/RF69_Receive_AES.ino +++ b/examples/RF69/RF69_Receive_AES/RF69_Receive_AES.ino @@ -29,8 +29,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); diff --git a/examples/RF69/RF69_Receive_Address/RF69_Receive_Address.ino b/examples/RF69/RF69_Receive_Address/RF69_Receive_Address.ino index d1095ba3..86e1ebbc 100644 --- a/examples/RF69/RF69_Receive_Address/RF69_Receive_Address.ino +++ b/examples/RF69/RF69_Receive_Address/RF69_Receive_Address.ino @@ -31,8 +31,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); diff --git a/examples/RF69/RF69_Receive_Interrupt/RF69_Receive_Interrupt.ino b/examples/RF69/RF69_Receive_Interrupt/RF69_Receive_Interrupt.ino index e25dc64b..2e8929ac 100644 --- a/examples/RF69/RF69_Receive_Interrupt/RF69_Receive_Interrupt.ino +++ b/examples/RF69/RF69_Receive_Interrupt/RF69_Receive_Interrupt.ino @@ -29,8 +29,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); @@ -104,7 +104,7 @@ void loop() { // you can also read received data as byte array /* byte byteArr[8]; - int state = lora.receive(byteArr, 8); + int state = lora.readData(byteArr, 8); */ if (state == ERR_NONE) { diff --git a/examples/RF69/RF69_Settings/RF69_Settings.ino b/examples/RF69/RF69_Settings/RF69_Settings.ino index d4f5a158..2fee90ba 100644 --- a/examples/RF69/RF69_Settings/RF69_Settings.ino +++ b/examples/RF69/RF69_Settings/RF69_Settings.ino @@ -41,8 +41,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf1.begin(); @@ -58,11 +58,11 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 868.0 MHz // bit rate: 300.0 kbps - // Rx bandwidth: 250.0 kHz // frequency deviation: 60.0 kHz + // Rx bandwidth: 250.0 kHz // output power: 17 dBm // sync word: 0x2D01 - state = rf2.begin(868.0, 300.0, 250.0, 60.0, 17); + state = rf2.begin(868.0, 300.0, 60.0, 250.0, 17); if (state == ERR_NONE) { Serial.println(F("success!")); } else { diff --git a/examples/RF69/RF69_Transmit/RF69_Transmit.ino b/examples/RF69/RF69_Transmit/RF69_Transmit.ino index 8e6fea55..05879c0b 100644 --- a/examples/RF69/RF69_Transmit/RF69_Transmit.ino +++ b/examples/RF69/RF69_Transmit/RF69_Transmit.ino @@ -31,8 +31,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); diff --git a/examples/RF69/RF69_Transmit_AES/RF69_Transmit_AES.ino b/examples/RF69/RF69_Transmit_AES/RF69_Transmit_AES.ino index 03f98a2e..a9ec4ff5 100644 --- a/examples/RF69/RF69_Transmit_AES/RF69_Transmit_AES.ino +++ b/examples/RF69/RF69_Transmit_AES/RF69_Transmit_AES.ino @@ -29,8 +29,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); diff --git a/examples/RF69/RF69_Transmit_Address/RF69_Transmit_Address.ino b/examples/RF69/RF69_Transmit_Address/RF69_Transmit_Address.ino index 69e7d102..b9b36870 100644 --- a/examples/RF69/RF69_Transmit_Address/RF69_Transmit_Address.ino +++ b/examples/RF69/RF69_Transmit_Address/RF69_Transmit_Address.ino @@ -31,8 +31,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); diff --git a/examples/RF69/RF69_Transmit_Interrupt/RF69_Transmit_Interrupt.ino b/examples/RF69/RF69_Transmit_Interrupt/RF69_Transmit_Interrupt.ino index 59dd02fb..0387849a 100644 --- a/examples/RF69/RF69_Transmit_Interrupt/RF69_Transmit_Interrupt.ino +++ b/examples/RF69/RF69_Transmit_Interrupt/RF69_Transmit_Interrupt.ino @@ -35,8 +35,8 @@ void setup() { Serial.print(F("[RF69] Initializing ... ")); // carrier frequency: 434.0 MHz // bit rate: 48.0 kbps - // Rx bandwidth: 125.0 kHz // frequency deviation: 50.0 kHz + // Rx bandwidth: 125.0 kHz // output power: 13 dBm // sync word: 0x2D01 int state = rf.begin(); @@ -63,7 +63,7 @@ void setup() { /* byte byteArr[] = {0x01, 0x23, 0x45, 0x56, 0x78, 0xAB, 0xCD, 0xEF}; - state = rf.transmit(byteArr, 8); + state = rf.startTransmit(byteArr, 8); */ } @@ -121,11 +121,11 @@ void loop() { // 256 characters long transmissionState = rf.startTransmit("Hello World!"); - // you can also transmit byte array up to 256 bytes long + // you can also transmit byte array up to 64 bytes long /* byte byteArr[] = {0x01, 0x23, 0x45, 0x56, 0x78, 0xAB, 0xCD, 0xEF}; - int state = rf.transmit(byteArr, 8); + int state = rf.startTransmit(byteArr, 8); */ // we're ready to send more packets, diff --git a/src/modules/RF69/RF69.cpp b/src/modules/RF69/RF69.cpp index 11c50c7f..d4e64325 100644 --- a/src/modules/RF69/RF69.cpp +++ b/src/modules/RF69/RF69.cpp @@ -12,7 +12,7 @@ RF69::RF69(Module* module) : PhysicalLayer(RF69_FREQUENCY_STEP_SIZE, RF69_MAX_PA _syncWordLength = 2; } -int16_t RF69::begin(float freq, float br, float rxBw, float freqDev, int8_t power) { +int16_t RF69::begin(float freq, float br, float freqDev, float rxBw, int8_t power) { // set module properties _mod->init(RADIOLIB_USE_SPI); Module::pinMode(_mod->getIrq(), INPUT); diff --git a/src/modules/RF69/RF69.h b/src/modules/RF69/RF69.h index 44f5020a..94644e1b 100644 --- a/src/modules/RF69/RF69.h +++ b/src/modules/RF69/RF69.h @@ -455,15 +455,15 @@ class RF69: public PhysicalLayer { \param br Bit rate to be used in kbps. Defaults to 48.0 kbps. - \param rxBw Receiver bandwidth in kHz. Defaults to 125.0 kHz. - \param freqDev Frequency deviation from carrier frequency in kHz Defaults to 50.0 kHz. + \param rxBw Receiver bandwidth in kHz. Defaults to 125.0 kHz. + \param power Output power in dBm. Defaults to 13 dBm. \returns \ref status_codes */ - int16_t begin(float freq = 434.0, float br = 48.0, float rxBw = 125.0, float freqDev = 50.0, int8_t power = 13); + int16_t begin(float freq = 434.0, float br = 48.0, float freqDev = 50.0, float rxBw = 125.0, int8_t power = 13); /*! \brief Reset method. Will reset the chip to the default state using RST pin.