Repeatitive Timer and Edge Counter in nRF5340

I need repetitive Timer and Edge Counter in my application. There is is a single Timer Peripheral that can be used either as a Timer or Counter.  As well, further in counter mode, it is required to count both edges pe second. SO, how can all these be achieved ?

Parents Reply
  • Hi, I have already used a Timer using Zephyr Kernel s below:

    K_WORK_DEFINE(my_work, my_work_handler);

    void my_timer_handler(struct k_timer *dummy)
    {
    k_work_submit(&my_work);
    }

    K_TIMER_DEFINE(my_timer, my_timer_handler, NULL);

    void my_work_handler(struct k_work *work)

    {

    }

    k_timer_start(&my_timer, K_SECONDS(4), K_SECONDS(30));

    Form above it is not clear that which Timer has been used in it ?

Children
Related