Difference between revisions of "Nrf52-timer-config"

From Wiki at Neela Nurseries
Jump to: navigation, search
m
Line 5: Line 5:
 
Looking at some example code in <code>nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/components/app_simple_timer.c</code>, there are routines to init, start, stop (pause) and to uninitialize.  Given a task to assure that a Nordic chip goes into lower or lowest possible power mode, we'll first examine the 'stop' and 'uninit' routines in this Nordic demo code.
 
Looking at some example code in <code>nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/components/app_simple_timer.c</code>, there are routines to init, start, stop (pause) and to uninitialize.  Given a task to assure that a Nordic chip goes into lower or lowest possible power mode, we'll first examine the 'stop' and 'uninit' routines in this Nordic demo code.
  
The routine <code> uint32_t app_simple_timer_stop(void)</code> is a wrapper to <code> nrf_drv_timer_pause()</code>.  Going through reverse engineering steps this routine is first defined via a macro:
+
The routine <code> uint32_t app_simple_timer_stop(void)</code> is a wrapper to <code> nrf_drv_timer_pause(nrfx_timer_t const * const p_instance)</code>.  Going through reverse engineering steps this routine is first defined via a macro:
  
 
   ./integration/nrfx/legacy/nrf_drv_timer.h:82:#define nrf_drv_timer_pause          nrfx_timer_pause
 
   ./integration/nrfx/legacy/nrf_drv_timer.h:82:#define nrf_drv_timer_pause          nrfx_timer_pause
 +
 +
The definition of <code>nrfx_timer_pause()</code> is in the following .c file,
 +
 +
  ./modules/nrfx/drivers/include/nrfx_timer.h:186:void nrfx_timer_pause(nrfx_timer_t const * const p_instance);
 +
  ./modules/nrfx/drivers/src/nrfx_timer.c:170:void nrfx_timer_pause(nrfx_timer_t const * const p_instance)
 +
  
  
Line 15: Line 21:
 
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules
 
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules
 
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules/nrfx/drivers/include
 
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules/nrfx/drivers/include
 +
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules/nrfx/drivers/src
 +
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy
 
</pre>
 
</pre>

Revision as of 14:36, 25 April 2021


2021-04-25

Looking at some example code in nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/components/app_simple_timer.c, there are routines to init, start, stop (pause) and to uninitialize. Given a task to assure that a Nordic chip goes into lower or lowest possible power mode, we'll first examine the 'stop' and 'uninit' routines in this Nordic demo code.

The routine uint32_t app_simple_timer_stop(void) is a wrapper to nrf_drv_timer_pause(nrfx_timer_t const * const p_instance). Going through reverse engineering steps this routine is first defined via a macro:

  ./integration/nrfx/legacy/nrf_drv_timer.h:82:#define nrf_drv_timer_pause          nrfx_timer_pause

The definition of nrfx_timer_pause() is in the following .c file,

  ./modules/nrfx/drivers/include/nrfx_timer.h:186:void nrfx_timer_pause(nrfx_timer_t const * const p_instance);
  ./modules/nrfx/drivers/src/nrfx_timer.c:170:void nrfx_timer_pause(nrfx_timer_t const * const p_instance)


First Nordic demo code directories in which we're reviewing files:

nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/components/libraries/simple_timer
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules/nrfx/drivers/include
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/modules/nrfx/drivers/src
nRF5SDK153059ac345/nRF5_SDK_15.3.0_59ac345/integration/nrfx/legacy