This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to use PA in esb_ptx

examples\proprietary_rf\esb_ptx例程中如何切换PA收发方向呢,基本思路就是数据发送完了就切成接收的方向,来接收ACK,但是问题是esb_ptx程序中怎么知道数据什么时候发送完? 下面这个代码,并不是等数据发送完了才返回SUCCESS的。请帮忙解答一下,谢谢! if (nrf_esb_write_payload(&tx_payload) == NRF_SUCCESS)

Parents
  • Hi

    You could hook into the hardware events from the radio, and use them to control your GPIO.

    If the ESB library is idle and you upload a new packet then the radio will go into a sequence of TX/RX transactions, to send packets and listen for ACK's. When the radio is enabled in either TX or RX mode you will get an event called EVENT_READY, signaling that the radio is ready for TX/RX. The first READY event will be in TX mode, the second will be in RX mode, and so forth.

    You could use the PPI controller and the GPIOTE module to connect this event to a GPIO, so that the GPIO is set whenever the READY event occurs. You just have to make sure that you keep the TX and RX events apart.

    When the radio is disabled the DISABLED event will occur, and you can use this to clear the pin, to avoid running the PA excessively.

    Best regards
    Torbjørn

Reply
  • Hi

    You could hook into the hardware events from the radio, and use them to control your GPIO.

    If the ESB library is idle and you upload a new packet then the radio will go into a sequence of TX/RX transactions, to send packets and listen for ACK's. When the radio is enabled in either TX or RX mode you will get an event called EVENT_READY, signaling that the radio is ready for TX/RX. The first READY event will be in TX mode, the second will be in RX mode, and so forth.

    You could use the PPI controller and the GPIOTE module to connect this event to a GPIO, so that the GPIO is set whenever the READY event occurs. You just have to make sure that you keep the TX and RX events apart.

    When the radio is disabled the DISABLED event will occur, and you can use this to clear the pin, to avoid running the PA excessively.

    Best regards
    Torbjørn

Children
No Data
Related