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

Do we need to define NRFX_TIMER1_ENABLED inorder to use TIMER1 ?

Hello , 

Do we need to use TIMER1 ,2etc.. to use TIMER1 ? In my current configuration i have set NRFX_TIMER_ENABLED to 1 and others to 0 "NRFX_TIMER0_ENABLED and other instances";

#ifndef NRFX_TIMER_ENABLED
#define NRFX_TIMER_ENABLED 1
#endif
// <q> NRFX_TIMER0_ENABLED  - Enable TIMER0 instance
 

#ifndef NRFX_TIMER0_ENABLED
#define NRFX_TIMER0_ENABLED 0
#endif

// <q> NRFX_TIMER1_ENABLED  - Enable TIMER1 instance
 

#ifndef NRFX_TIMER1_ENABLED
#define NRFX_TIMER1_ENABLED 0
#endif

// <q> NRFX_TIMER2_ENABLED  - Enable TIMER2 instance
 

#ifndef NRFX_TIMER2_ENABLED
#define NRFX_TIMER2_ENABLED 0
#endif

// <q> NRFX_TIMER3_ENABLED  - Enable TIMER3 instance
 

#ifndef NRFX_TIMER3_ENABLED
#define NRFX_TIMER3_ENABLED 0
#endif

// <q> NRFX_TIMER4_ENABLED  - Enable TIMER4 instance
 

#ifndef NRFX_TIMER4_ENABLED
#define NRFX_TIMER4_ENABLED 0
#endif

But i can able to use any TIMER without a problem by using nrf libraries , for exmp:  

static const nrf_drv_timer_t m_timer2 = NRF_DRV_TIMER_INSTANCE(2);
...

   err_code = nrf_drv_timer_init(&m_timer2, &timer_cfg, timer2_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_timer_compare(&m_timer2,
                          NRF_TIMER_CC_CHANNEL0,
                          SAMPLES_IN_BUFFER/2,
                          true);

    nrf_drv_timer_extended_compare(&m_timer2,
                                   NRF_TIMER_CC_CHANNEL1,
                                   SAMPLES_IN_BUFFER,
                                   NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK,
                                   false);
...

Do we need to define NRFX_TIMER1_ENABLED inorder to use TIMER1,2,... by nrf libraries ?  Or are these definitions belongs to some old SDKs ?

BR/

Parents Reply Children
No Data
Related