diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-02-01 12:53:01 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-02-01 12:53:01 +0800 |
| commit | 48929d00ec0cec657293163b82a3d70a9a6823f6 (patch) | |
| tree | 866ad6b3550e895182136460dbf717fadc328c0e /nRF24L01/radio.c | |
| parent | 75b35babe800ee9a2922f3d6b481d2f2e00e158e (diff) | |
| download | smart-home-48929d00ec0cec657293163b82a3d70a9a6823f6.tar.gz | |
wip
Diffstat (limited to 'nRF24L01/radio.c')
| -rw-r--r-- | nRF24L01/radio.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nRF24L01/radio.c b/nRF24L01/radio.c index 7393ed8..a9832ef 100644 --- a/nRF24L01/radio.c +++ b/nRF24L01/radio.c @@ -58,6 +58,10 @@ #define NRF24L01_W_TX_PAYLOAD_NOACK 0xB0 #define NRF24L01_NOP 0xFF +#define NRF24L01_EN_RX_DR_IRQ 0xBF +#define NRF24L01_EN_TX_DS_IRQ 0xDF +#define NRF24L01_EN_MAX_RT_IRQ 0xEF + static inline uint8_t read_reg(uint8_t reg) { SPI_PORT &= ~(1 << SPI_SS); @@ -107,5 +111,7 @@ void radio_init(const struct radio_cfg *cfg) _delay_ms(NRF24L01_POWER_ON_RST_DELAY); // disable all interrupts, enable 2-byte CRC. - write_reg(NRF24L01_REG_CONFIG, 0x7C); + write_reg(NRF24L01_REG_CONFIG, !(NRF24L01_EN_RX_DR_IRQ + & NRF24L01_EN_TX_DS_IRQ + & NRF24L01_EN_MAX_RT_IRQ) | ); } |
