diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2024-12-10 19:43:38 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2024-12-10 19:43:38 +0800 |
| commit | b8103d0b0624ca7fbbccfc7d7b2bef560efd3198 (patch) | |
| tree | c05dea9834bc471cd653c8e9b9049d70338fc4de /rf_test/radio.c | |
| parent | 2c039dc4090ed31b46395ca2026a79061f095597 (diff) | |
| download | smart-home-b8103d0b0624ca7fbbccfc7d7b2bef560efd3198.tar.gz | |
Function to start listening.
Diffstat (limited to 'rf_test/radio.c')
| -rw-r--r-- | rf_test/radio.c | 9 |
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); |
