From af242450180ab4928361a9633579cbd045365d80 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 1 Feb 2025 13:53:20 +0800 Subject: wip --- nRF24L01/radio.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'nRF24L01') 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); } -- cgit v1.2.3