2,use ESB code
3,I want to do a transport data from PRX to PTX
You send data from the PRX to the PTX in almost the same way as you send data from the PTX.
You use the same function, but you have to pre-load the packet to be sent. Then the packet will be sent to the PTX as a part of the ACK on the next packet the PTX sends to the PRX.
If you upload the packet beforehand it will simply be queued in the FIFO, and then it will be sent as soon as you receive something from the PTX.
If you use the SDK ESB example as a starting point it should be relatively quick to modify it so that the PRX sends data in return to the PTX.
Hi , in ESB example, in PRX code , function on_radio_disabled_rx, I donot find which code is fuction to sent ACK. Is ACK have to put NRF_RADIO->TASKS_TXEN=1 ??
The ESB code uses shortcuts to automate many of the radio state changes, to reduce the amount of CPU wakeups and interrupts.
When sending an ACK it will enable both the DISABLED->TXEN shortcut, to enable the TX automatically after disabling the radio in RX mode, as well as the READY->START shortcut, to start transmission as soon as the radio is ready.
In other words there shouldn't be a manual call to NRF_RADIO->TASKS_TXEN = 1 to send the ACK (since the shortcut automates the process), but you can see the configuration of the SHORTS register before disabling the radio.
You welcome :)