diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-02-09 11:03:37 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-02-09 11:03:37 +0800 |
| commit | e058394ed6e67a2935bc1d06ef256d5aa66f3f54 (patch) | |
| tree | 488dce7ec4ca3b08b3260c444b62573633f07970 | |
| parent | b4fce69fdcc4ed19aacb239107c391786546d0dc (diff) | |
| download | smart-home-e058394ed6e67a2935bc1d06ef256d5aa66f3f54.tar.gz | |
Set address with to 3 bytes.
| -rw-r--r-- | nRF24L01/radio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nRF24L01/radio.c b/nRF24L01/radio.c index 3dc11f9..8f39403 100644 --- a/nRF24L01/radio.c +++ b/nRF24L01/radio.c @@ -136,13 +136,14 @@ void radio_init(const struct radio_cfg *cfg) conf |= (1 << NRF24L01_MASK_TX_DS); conf |= (1 << NRF24L01_MASK_MAX_RT); conf |= (1 << NRF24L01_CRCO); - write_reg(NRF24L01_REG_CONFIG, conf); // only use data pipe 0 conf = 0; conf &= ~(1 << NRF24L01_ERX_P1); conf |= (1 << NRF24L01_ERX_P0); - write_reg(NRF24L01_REG_EN_RXADDR, conf); + + // set address with to 3 bytes + write_reg(NRF24L01_REG_SETUP_AW, 0x01); } |
