Skip to content

Commit b95ebf1

Browse files
committed
text fixed
1 parent f5c06c5 commit b95ebf1

File tree

2 files changed

+52
-18
lines changed

2 files changed

+52
-18
lines changed

NRF24.h

+20-18
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,26 @@ enum {
4141
disable = 0
4242
};
4343

44+
45+
46+
/*
47+
* Set defaults
48+
*
49+
* NOTICE: Don't use it at start of program because it may broke down process
50+
* after reseting the MCU. This function is for only special situations or testing.
51+
*/
52+
void nrf24_defaults(void);
53+
54+
55+
/*
56+
* This function sets everything which is necessary for correct start of program
57+
*
58+
* NOTICE: Without this function in start of program may cause problems after reseting MCU.
59+
* MCU reset does not resets NRF24 module
60+
*/
61+
void nrf24_init(void);
62+
63+
4464
//These functions are for controll CE and CSN pins which are selected in NRF24_conf.h
4565
void csn_high(void);
4666
void csn_low(void);
@@ -332,23 +352,5 @@ uint8_t nrf24_data_available(void);
332352
void nrf24_receive(uint8_t *data, uint8_t size);
333353

334354

335-
/*
336-
* Set defaults
337-
*
338-
* NOTICE: Don't use it as a init at start of program because it may broke down process
339-
* after reseting the MCU. This function is for only special situations or testing.
340-
*/
341-
void nrf24_defaults(void);
342-
343-
344-
/*
345-
* This function sets everything which is vital for correct start of program
346-
*
347-
* NOTICE: Without this function in start of program may cause problems after reseting MCU.
348-
* MCU reset does not resets NRF24 module
349-
*/
350-
void nrf24_init(void);
351-
352-
353355
#endif
354356

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Open NRF24_conf.h and select SPI port, CE and CS GPIO pins and CS and CE pins re
8080

8181
nrf24_auto_ack_all(auto_ack);
8282
nrf24_en_ack_pld(disable);
83+
nrf24_en_dyn_ack(disable);
8384
nrf24_dpl(disable);
8485

8586
nrf24_set_crc(no_crc, _1byte);
@@ -285,13 +286,29 @@ because as i mentioned nrf24 does not returns in default values even after power
285286

286287
nrf24_auto_ack_all(auto_ack);
287288
nrf24_en_ack_pld(enable);
289+
nrf24_en_dyn_ack(enable);
288290

289291
//and other configurations as well
290292

291293
uint8_t dataT[PLD_SIZE] = {"Hello"};
292294
nrf24_transmit_no_ack(dataT, sizeof(dataT));
293295

294296

297+
### **4.With ACK_PLD and IRQ**
298+
299+
nrf24_transmit(dataT, sizeof(dataT));
300+
301+
if(irq == 1){
302+
uint8_t stat = nrf24_r_status();
303+
304+
if(stat & (1 << TX_DS)){
305+
nrf24_receive(tx_ack_pld, sizeof(tx_ack_pld));
306+
}else if(stat & (1 << MAX_RT)){
307+
nrf24_flush_tx();
308+
nrf24_clear_rx_dr();
309+
}
310+
irq = 0;
311+
}
295312

296313

297314
## **Receive:**
@@ -327,3 +344,18 @@ because as i mentioned nrf24 does not returns in default values even after power
327344
}
328345

329346

347+
348+
### **3.With ACK_PLD and IRQ**
349+
350+
if(irq == 1){
351+
uint8_t stat = nrf24_r_status();
352+
353+
if(stat & (1 << RX_DR)){
354+
nrf24_receive(dataR, sizeof(dataR));
355+
nrf24_transmit_rx_ack_pld(0, rx_ack_pld, sizeof(rx_ack_pld));
356+
}
357+
irq = 0;
358+
}
359+
360+
361+

0 commit comments

Comments
 (0)