summaryrefslogtreecommitdiffstats
path: root/nRF24L01
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-02-01 14:09:16 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-02-01 14:09:16 +0800
commit9bf259a3a5eea856b1c664c927769e94e8da0e28 (patch)
tree9222e5b1aae9a83d5ef437cc079fdd21403f84c4 /nRF24L01
parent32641a33d568295034647b880cffaf06d5fa6e07 (diff)
downloadsmart-home-9bf259a3a5eea856b1c664c927769e94e8da0e28.tar.gz
wip
Diffstat (limited to 'nRF24L01')
-rw-r--r--nRF24L01/radio.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/nRF24L01/radio.c b/nRF24L01/radio.c
index 7138ce1..50887b8 100644
--- a/nRF24L01/radio.c
+++ b/nRF24L01/radio.c
@@ -73,6 +73,13 @@
#define NRF24L01_ENAA_P1 1
#define NRF24L01_ENAA_P0 0
+#define NRF24L01_ERX_P5 5
+#define NRF24L01_ERX_P4 4
+#define NRF24L01_ERX_P3 3
+#define NRF24L01_ERX_P2 2
+#define NRF24L01_ERX_P1 1
+#define NRF24L01_ERX_P0 0
+
static inline uint8_t read_reg(uint8_t reg)
{
SPI_PORT &= ~(1 << SPI_SS);
@@ -141,4 +148,14 @@ void radio_init(const struct radio_cfg *cfg)
conf |= (1 << NRF24L01_ENAA_P0);
write_reg(NRF24L01_REG_EN_AA, conf);
+
+ conf = 0;
+ conf &= ~(1 << NRF24L01_ERX_P5);
+ conf &= ~(1 << NRF24L01_ERX_P4);
+ conf &= ~(1 << NRF24L01_ERX_P3);
+ conf &= ~(1 << NRF24L01_ERX_P2);
+ conf &= ~(1 << NRF24L01_ERX_P1);
+ conf |= (1 << NRF24L01_ERX_P0);
+
+ write_reg(NRF24L01_REG_EN_RXADDR, conf);
}