summaryrefslogtreecommitdiffstats
path: root/rf_test/radio.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2024-12-07 20:10:20 +0800
committerSadeep Madurange <sadeep@asciimx.com>2024-12-07 20:10:20 +0800
commit4bbcee2a8cadb65e2268474b2908cae1e5840e24 (patch)
tree6d17da0b719264d8d1d0ff609e0dd69619c39b5d /rf_test/radio.c
parentf25e6c86d8597610c1b6f408f9a7fe1ce2a8458f (diff)
downloadsmart-home-4bbcee2a8cadb65e2268474b2908cae1e5840e24.tar.gz
Add license info.
Diffstat (limited to 'rf_test/radio.c')
-rw-r--r--rf_test/radio.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/rf_test/radio.c b/rf_test/radio.c
index fa5a482..5ad1055 100644
--- a/rf_test/radio.c
+++ b/rf_test/radio.c
@@ -1,3 +1,29 @@
+// **********************************************************************************
+// Driver definition for HopeRF RFM69W/RFM69HW/RFM69CW/RFM69HCW, Semtech SX1231/1231H
+// **********************************************************************************
+// Copyright LowPowerLab LLC 2018, https://www.LowPowerLab.com/contact
+// **********************************************************************************
+// License
+// **********************************************************************************
+// This program is free software; you can redistribute it
+// and/or modify it under the terms of the GNU General
+// Public License as published by the Free Software
+// Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will
+// be useful, but WITHOUT ANY WARRANTY; without even the
+// implied warranty of MERCHANTABILITY or FITNESS FOR A
+// PARTICULAR PURPOSE. See the GNU General Public
+// License for more details.
+//
+// Licence can be viewed at
+// http://www.gnu.org/licenses/gpl-3.0.txt
+//
+// Please maintain this license information along with authorship
+// and copyright notices in any redistribution of this code
+// **********************************************************************************
+
#include <stdlib.h>
#include <avr/io.h>
@@ -58,10 +84,14 @@ static inline void set_power_level(uint8_t pwl)
write_reg(0x11, (pa_mask | pwl));
}
-void radio_send(const char *data, uint8_t n)
+void radio_sendto(uint8_t addr, const char *data, uint8_t n)
{
uint8_t i;
+ // force the receiver into WAIT mode
+ write_reg(0x3D, ((read_reg(0x3D) & 0xFB) | 0x04));
+
+
// STDBY + ListenAbort
write_reg(0x01, 0x04);
while ((read_reg(0x27) >> 7) != 1)