Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is there any event triggered at the beginning of an ANT channel period?

Hi,

I am measuring the time taken between an ANT application sending a message, and a receiving ANT application generating an EVENT_RX.  This time is being measured using a logic analyser, connected to the GPIO pins of each nRF52840DK

For example with ANT in asynchronous mode, I am able to set a GPIO pin just before the message is sent, as shown below:

nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(1, 15));

err_code = sd_ant_acknowledge_message_tx(ANT_CHANNEL_NUM,
                                         ANT_STANDARD_DATA_PAYLOAD_SIZE,
                                         m_broadcast_data); // in the case of async, this transmits a message rather than sets the data for the next timed tx
nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(1, 15));

if(err_code != NRF_ANT_ERROR_TRANSFER_IN_PROGRESS) 
{
    APP_ERROR_CHECK(err_code);
}

I understand I am only able to do this because in async mode, there tx function used actually sends the message.

On the case of the recieving end, I have access to an EVENT_RX event, in which I can use to set another GPIO pin, as follows:

switch (p_ant_evt->event)
    {
        case EVENT_RX:
            if (p_ant_evt->message.ANT_MESSAGE_aucPayload[0] == ANT_CUSTOM_PAGE)
            {
                nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(1, 15));
                nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(1, 15));
            }
    }

I would like to do the same for standard ANT, however I cannot find any event that I can use to set the GPIO pin when the message is being sent, as I am aware that sd_ant_broadcast_message_tx() or sd_ant_acknowledge_message_tx() simply set the data that will be sent at the start of the next channel period.

Is there any event generated at the start of a channel period, that I can use to do this?

Thanks,

Luke

Related