summaryrefslogtreecommitdiffstats
path: root/rf_test/radio.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2024-12-10 19:43:38 +0800
committerSadeep Madurange <sadeep@asciimx.com>2024-12-10 19:43:38 +0800
commitb8103d0b0624ca7fbbccfc7d7b2bef560efd3198 (patch)
treec05dea9834bc471cd653c8e9b9049d70338fc4de /rf_test/radio.c
parent2c039dc4090ed31b46395ca2026a79061f095597 (diff)
downloadsmart-home-b8103d0b0624ca7fbbccfc7d7b2bef560efd3198.tar.gz
Function to start listening.
Diffstat (limited to 'rf_test/radio.c')
-rw-r--r--rf_test/radio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/rf_test/radio.c b/rf_test/radio.c
index 37cfab9..83bd7c2 100644
--- a/rf_test/radio.c
+++ b/rf_test/radio.c
@@ -96,6 +96,15 @@ uint8_t radio_recv(char *buf, uint8_t n)
return read_len;
}
+void radio_listen(void)
+{
+ write_reg(0x01, (read_reg(0x01) & 0xE3) | 0x10);
+ while ((read_reg(0x27) & 0x80))
+ ;
+
+ // todo: go to low power mode
+}
+
void radio_init(const struct radio_cfg *cfg)
{
SPI_DDR |= (1 << SPI_SS) | (1 << SPI_SCK) | (1 << SPI_MOSI);