summaryrefslogtreecommitdiffstats
path: root/nRF24L01
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-02-01 13:53:20 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-02-01 13:53:20 +0800
commitaf242450180ab4928361a9633579cbd045365d80 (patch)
treeb1006371d6c791b01dee76e673bcf82ce8c5ce22 /nRF24L01
parent93216abf883188420c5b89b770950f3dee0712e2 (diff)
downloadsmart-home-af242450180ab4928361a9633579cbd045365d80.tar.gz
wip
Diffstat (limited to 'nRF24L01')
-rw-r--r--nRF24L01/radio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nRF24L01/radio.c b/nRF24L01/radio.c
index fbbd935..26d4c49 100644
--- a/nRF24L01/radio.c
+++ b/nRF24L01/radio.c
@@ -61,7 +61,10 @@
#define NRF24L01_MASK_RX_DR 6
#define NRF24L01_MASK_TX_DS 5
#define NRF24L01_MASK_MAX_RT 4
-#define NRF24L01_CRCO 3
+#define NRF24L01_EN_CRC 3
+#define NRF24L01_CRCO 2
+#define NRF24L01_PWR_UP 1
+#define NRF24L01_PRIM_RX 0
static inline uint8_t read_reg(uint8_t reg)
{
@@ -118,9 +121,12 @@ void radio_init(const struct radio_cfg *cfg)
_delay_ms(NRF24L01_POWER_ON_RST_DELAY);
- conf = 0x08;
+ conf = 0;
conf |= (1 << NRF24L01_MASK_RX_DR) | (1 << NRF24L01_MASK_TX_DS) | (1 << NRF24L01_MASK_MAX_RT);
+ conf |= (1 << NRF24L01_EN_CRC);
conf |= (1 << NRF24L01_CRCO);
+ conf &= ~(1 << NRF24L01_PWR_UP);
+ conf &= ~(1 << NRF24L01_PRIM_RX);
write_config_reg(conf);
}