diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-02-01 14:03:04 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-02-01 14:03:04 +0800 |
| commit | 32641a33d568295034647b880cffaf06d5fa6e07 (patch) | |
| tree | 8591690ddc459df84a457d19cae7c84bf5128c08 /nRF24L01/radio.c | |
| parent | 9431f1ff97fe50df6c5d0937820b6696b493fe06 (diff) | |
| download | smart-home-32641a33d568295034647b880cffaf06d5fa6e07.tar.gz | |
wip
Diffstat (limited to 'nRF24L01/radio.c')
| -rw-r--r-- | nRF24L01/radio.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nRF24L01/radio.c b/nRF24L01/radio.c index 43355db..7138ce1 100644 --- a/nRF24L01/radio.c +++ b/nRF24L01/radio.c @@ -66,6 +66,13 @@ #define NRF24L01_PWR_UP 1 #define NRF24L01_PRIM_RX 0 +#define NRF24L01_ENAA_P5 5 +#define NRF24L01_ENAA_P4 4 +#define NRF24L01_ENAA_P3 3 +#define NRF24L01_ENAA_P2 2 +#define NRF24L01_ENAA_P1 1 +#define NRF24L01_ENAA_P0 0 + static inline uint8_t read_reg(uint8_t reg) { SPI_PORT &= ~(1 << SPI_SS); @@ -124,4 +131,14 @@ void radio_init(const struct radio_cfg *cfg) conf &= ~(1 << NRF24L01_PRIM_RX); write_reg(NRF24L01_REG_CONFIG, conf); + + conf = 0; + conf |= (1 << NRF24L01_ENAA_P5); + conf |= (1 << NRF24L01_ENAA_P4); + conf |= (1 << NRF24L01_ENAA_P3); + conf |= (1 << NRF24L01_ENAA_P2); + conf |= (1 << NRF24L01_ENAA_P1); + conf |= (1 << NRF24L01_ENAA_P0); + + write_reg(NRF24L01_REG_EN_AA, conf); } |
