Hilscher netX microcontroller driver  V0.0.5.0
Documentation of the netX driver package

Timer peripheral module driver. More...

Collaboration diagram for TIM:

Data Structures

union  DRV_TIM_DEVICE_U
 Union of the possible timer device pointers. More...
 
struct  DRV_TIM_CONFIGURATION_T
 Timer base Configuration Structure definition. More...
 
struct  DRV_TIM_HANDLE_T
 Timer Base Handle Structure definition. More...
 

Macros

#define DRV_TIM_CLOCK_RATE   SystemCoreClock
 
#define DRV_HANDLE_CHECK(handle)
 

Enumerations

enum  DRV_TIM_PRELOAD_VALUE_E {
  DRV_TIM_PRELOAD_VALUE_1Hz = 100000000ul,
  DRV_TIM_PRELOAD_VALUE_1s = 100000000ul,
  DRV_TIM_PRELOAD_VALUE_2Hz = 50000000ul,
  DRV_TIM_PRELOAD_VALUE_500ms = 50000000ul,
  DRV_TIM_PRELOAD_VALUE_10Hz = 10000000ul,
  DRV_TIM_PRELOAD_VALUE_100ms = 10000000ul,
  DRV_TIM_PRELOAD_VALUE_100Hz = 1000000ul,
  DRV_TIM_PRELOAD_VALUE_10ms = 1000000ul,
  DRV_TIM_PRELOAD_VALUE_1KHz = 100000ul,
  DRV_TIM_PRELOAD_VALUE_1ms = 100000ul,
  DRV_TIM_PRELOAD_VALUE_2KHz = 50000ul,
  DRV_TIM_PRELOAD_VALUE_500us = 50000ul,
  DRV_TIM_PRELOAD_VALUE_10KHz = 10000ul,
  DRV_TIM_PRELOAD_VALUE_100us = 10000ul,
  DRV_TIM_PRELOAD_VALUE_100KHz = 1000ul,
  DRV_TIM_PRELOAD_VALUE_10us = 1000ul,
  DRV_TIM_PRELOAD_VALUE_1MHz = 100ul,
  DRV_TIM_PRELOAD_VALUE_1us = 100ul,
  DRV_TIM_PRELOAD_VALUE_2MHz = 50ul,
  DRV_TIM_PRELOAD_VALUE_500ns = 50ul,
  DRV_TIM_PRELOAD_VALUE_10MHz = 10ul,
  DRV_TIM_PRELOAD_VALUE_100ns = 10ul,
  DRV_TIM_PRELOAD_VALUE_100MHz = 1ul,
  DRV_TIM_PRELOAD_VALUE_10ns = 1ul,
  DRV_TIM_PRELOAD_VALUE_DEFAULT = 0ul
}
 Time structure of the timer driver. More...
 
enum  DRV_TIM_STATE_E {
  DRV_TIM_STATE_DEFAULT = 0x00ul,
  DRV_TIM_STATE_STOPPED = 0x01ul,
  DRV_TIM_STATE_PAUSED = 0x02ul,
  DRV_TIM_STATE_RUNNING = 0x03ul,
  DRV_TIM_STATE_TIMEOUT = 0x04ul,
  DRV_TIM_STATE_ERROR = 0x05ul
}
 Enumeration of the timer State. More...
 
enum  DRV_TIM_EXTERNAL_EVENT_MODE_E {
  DRV_TIM_EXTERNAL_EVENT_MODE_DEFAULT = 0x00ul,
  DRV_TIM_EXTERNAL_EVENT_MODE_EXTERNAL_EVENTS = 0x01ul,
  DRV_TIM_EXTERNAL_EVENT_MODE_WATCHDOG = 0x02ul,
  DRV_TIM_EXTERNAL_EVENT_MODE_AUTO_RUN = 0x03ul
}
 Enumeration of the external event mode. More...
 
enum  DRV_TIM_EXTERNAL_EVENT_TRIGGER_E {
  DRV_TIM_EXTERNAL_EVENT_MODE_HIGH_LEVEL = 0x00ul,
  DRV_TIM_EXTERNAL_EVENT_MODE_RISING_EDGE = 0x01ul
}
 Enumeration defines the kind of external event signal. More...
 
enum  DRV_TIM_SYSTIME_REFERENCE_E {
  DRV_TIM_SYSTIME_REFERENCE_DEFAULT = 0x00ul,
  DRV_TIM_SYSTIME_REFERENCE_COM = 0x10ul,
  DRV_TIM_SYSTIME_REFERENCE_COM_UC = 0x11ul,
  DRV_TIM_SYSTIME_REFERENCE_APP = 0x12ul,
  DRV_TIM_SYSTIME_REFERENCE_RESERVED = 0x13ul,
  DRV_TIM_SYSTIME_REFERENCE_MIN = DRV_TIM_SYSTIME_REFERENCE_COM
}
 The time base that is used for the timer. More...
 
enum  DRV_TIM_COUNTING_MODE_E {
  DRV_TIM_COUNTING_MODE_ONCE = 0x00ul,
  DRV_TIM_COUNTING_MODE_CONTINUOUS = 0x01ul,
  DRV_TIM_COUNTING_MODE_COMPARE = 0x02ul,
  DRV_TIM_COUNTING_MODE_RESERVED = 0x03ul
}
 Enumeration of the available counting modes. More...
 
enum  DRV_TIM_SYMMETRIC_E {
  DRV_TIM_SYMMETRIC_SAWTOOTH = 0x00ul,
  DRV_TIM_SYMMETRIC_TRIANGLE = 0x01ul
}
 Enumeration of the counting symmetries available. More...
 
enum  {
  DRV_TIM_IRQ_GPIOTIM0 = 0x00u,
  DRV_TIM_IRQ_GPIOTIM1 = 0x01u,
  DRV_TIM_IRQ_GPIOTIM2 = 0x02u,
  DRV_TIM_IRQ_TIMER0 = 0x03u,
  DRV_TIM_IRQ_TIMER1 = 0x04u,
  DRV_TIM_IRQ_TIMER2 = 0x05u,
  DRV_TIM_IRQ_SYSTIME_COMPARE = 0x06u,
  DRV_TIM_IRQ_SYSTICK = 0x07u
}
 

Functions

void DRV_TIM_GPIOTIM0_Callback (void)
 This is the callback of the GPIOTIM 0 IRQ. More...
 
void DRV_TIM_GPIOTIM1_Callback (void)
 This is the callback of the GPIOTIM 1 IRQ. More...
 
void DRV_TIM_GPIOTIM2_Callback (void)
 This is the callback of the GPIOTIM 2 IRQ. More...
 
void DRV_TIM_TIMER0_Callback (void)
 This is the callback of the TIMER 0 IRQ. More...
 
void DRV_TIM_TIMER1_Callback (void)
 This is the callback of the TIMER 1 IRQ. More...
 
void DRV_TIM_TIMER2_Callback (void)
 This is the callback of the TIMER 2 IRQ. More...
 
void DRV_TIM_SYSTIME_COMPARE_Callback (void)
 This is the callback of the SYSTIME COMPARE IRQ. More...
 
void DRV_TIM_ARMSYSTICK_Callback (void)
 This is the callback of the SYSTEM TICK IRQ. More...
 
DRV_STATUS_E DRV_TIM_Init (DRV_TIM_HANDLE_T *const ptTim)
 
DRV_STATUS_E DRV_TIM_DeInit (DRV_TIM_HANDLE_T *const ptTim)
 
DRV_STATUS_E DRV_TIM_Start (DRV_TIM_HANDLE_T *const ptTim)
 
DRV_STATUS_E DRV_TIM_Stop (DRV_TIM_HANDLE_T *const ptTim)
 
DRV_STATUS_E DRV_TIM_Pause (DRV_TIM_HANDLE_T *const ptTim)
 
DRV_STATUS_E DRV_TIM_Wait (DRV_TIM_HANDLE_T *const ptTim, uint32_t ulTickCnt)
 
DRV_STATUS_E DRV_TIM_IRQAttach (DRV_TIM_HANDLE_T *const ptTim, DRV_CALLBACK_F pfnUserClb, void *pvUser)
 
DRV_STATUS_E DRV_TIM_GetState (DRV_TIM_HANDLE_T *const ptTim, DRV_TIM_STATE_E *const peState)
 
DRV_STATUS_E DRV_TIM_GetValue (DRV_TIM_HANDLE_T *const ptTim, uint32_t *const ptSoftwareValue, uint32_t *const ptHardwareValue)
 
DRV_STATUS_E DRV_TIM_SetPreload (DRV_TIM_HANDLE_T *const ptTim, DRV_TIM_PRELOAD_VALUE_E const tCounterValue)
 
void GPIOTIM0_IRQHandler (void)
 This function handles interrupts requests. More...
 
void GPIOTIM1_IRQHandler (void)
 This function handles interrupts requests. More...
 
void GPIOTIM2_IRQHandler (void)
 This function handles interrupts requests. More...
 
void TIM0_IRQHandler (void)
 This function handles interrupts requests. More...
 
void TIM1_IRQHandler (void)
 This function handles interrupts requests. More...
 
void TIM2_IRQHandler (void)
 This function handles interrupts requests. More...
 
void SYSTIME_IRQHandler (void)
 This function handles interrupts requests. More...
 
void SysTick_Handler (void)
 This function handles interrupts requests. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_Init (DRV_TIM_HANDLE_T *const ptTim)
 Initializes the TIM Base peripheral. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_DeInit (DRV_TIM_HANDLE_T *const ptTim)
 DeInitializes the TIM Base peripheral. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_Start (DRV_TIM_HANDLE_T *const ptTim)
 Starts the TIM generation. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_Stop (DRV_TIM_HANDLE_T *const ptTim)
 Stops the TIM generation. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_Pause (DRV_TIM_HANDLE_T *const ptTim)
 Pauses the TIM generation. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_Wait (DRV_TIM_HANDLE_T *const ptTim, uint32_t ulTickCnt)
 Waits at least until uSkipCnt events have occurred. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_ChannelSetThreshold (DRV_TIM_HANDLE_T *const ptTim, DRV_DIO_ID_T ulChannelID, uint32_t ulTC)
 This function sets the threshold used for the specified channel. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_ChannelGetCapture (DRV_TIM_HANDLE_T *const ptTim, DRV_DIO_ID_T ulChannelID, uint32_t *const ulValue)
 This function gets the captured value of the specified channel. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_IRQAttach (DRV_TIM_HANDLE_T *const ptTim, DRV_CALLBACK_F pfnUserClb, void *pvUser)
 Attaches a given callback to the counter. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_GetState (DRV_TIM_HANDLE_T *const ptTim, DRV_TIM_STATE_E *const peState)
 Stores the state of the given counter. More...
 
__STATIC_FORCEINLINE void DRV_TIM_HANDLE_T::DRV_TIM_LatchSytimes (void)
 This function latches all system time counters. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_GetValue (DRV_TIM_HANDLE_T *const ptTim, uint32_t *const ptSoftwareValue, uint32_t *const ptHardwareValue)
 Stores the current counter value. More...
 
DRV_STATUS_E DRV_TIM_HANDLE_T::DRV_TIM_SetPreload (DRV_TIM_HANDLE_T *const ptTim, DRV_TIM_PRELOAD_VALUE_E tCounterValue)
 Sets a new preload value. More...
 

Variables

static IRQn_Type const aulIRQnTable [DRV_TIM_IRQ_COUNT] = DRV_TIM_IRQ_LIST
 Table of the IRQ vector numbers. More...
 
static DRV_CALLBACK_F s_apTIMCallbackTable [DRV_TIM_IRQ_COUNT] = { 0 }
 Used for mapping the handle to an interrupt. More...
 
static void * s_apTIMCallbackHandleTable [DRV_TIM_IRQ_COUNT] = { 0 }
 
static DRV_TIM_HANDLE_Ts_apTIMCallbackDriverHandleTable [DRV_TIM_IRQ_COUNT] = { 0 }
 
static volatile uint32_t s_apTIMIrqCntr [DRV_TIM_IRQ_COUNT] = { 0 }
 

Detailed Description

Timer peripheral module driver.

Macro Definition Documentation

#define DRV_HANDLE_CHECK (   handle)
Value:
if((handle) == 0){ \
return DRV_ERROR_PARAM; \
} \
if((handle)->ptDevice.ptGpio == 0 || \
(handle)->tConfiguration.eDeviceID < DRV_TIM_DEVICE_ID_GPIOCNTR_MIN || \
(handle)->tConfiguration.eDeviceID > DRV_TIM_DEVICE_ID_SYSTIME_MAX){ \
return DRV_ERROR_PARAM; \
}

Define for checking the consistency of the handle or static representation of the driver.

Definition at line 84 of file netx_drv_tim.c.

#define DRV_TIM_CLOCK_RATE   SystemCoreClock

The Clock rate of the chip.

Definition at line 208 of file netx_drv_tim.h.

Enumeration Type Documentation

anonymous enum

Those are the defines associated with the irq list enumeration. This should probably be moved to the csp.

Enumerator
DRV_TIM_IRQ_GPIOTIM0 
DRV_TIM_IRQ_GPIOTIM1 
DRV_TIM_IRQ_GPIOTIM2 
DRV_TIM_IRQ_TIMER0 
DRV_TIM_IRQ_TIMER1 
DRV_TIM_IRQ_TIMER2 
DRV_TIM_IRQ_SYSTIME_COMPARE 
DRV_TIM_IRQ_SYSTICK 

Definition at line 39 of file netx_drv_tim.c.

Enumeration of the available counting modes.

They decide in which way the counter reloads and how events are generated.

Enumerator
DRV_TIM_COUNTING_MODE_ONCE 

Counts only once and does not reload.

DRV_TIM_COUNTING_MODE_CONTINUOUS 

Counts continuously and reloads from reload/preload register.

DRV_TIM_COUNTING_MODE_COMPARE 

Compares the counter value with reference clock value and issues an event.

DRV_TIM_COUNTING_MODE_RESERVED 

Reserved mode, behaviour not defined.

Definition at line 149 of file netx_drv_tim.h.

Enumeration of the external event mode.

It defines if the timer uses external events and in which way they will be used

Enumerator
DRV_TIM_EXTERNAL_EVENT_MODE_DEFAULT 

No external events are used.

DRV_TIM_EXTERNAL_EVENT_MODE_EXTERNAL_EVENTS 

Each event increments the counter.

DRV_TIM_EXTERNAL_EVENT_MODE_WATCHDOG 

The counter is reset by an event.

DRV_TIM_EXTERNAL_EVENT_MODE_AUTO_RUN 

The counter runs only by external signal.

Definition at line 108 of file netx_drv_tim.h.

Enumeration defines the kind of external event signal.

The external event mode will be triggerd by the following condition. The condition can be inverted by inversion of channel with the digital input output driver.

Enumerator
DRV_TIM_EXTERNAL_EVENT_MODE_HIGH_LEVEL 

External event is triggered by high level.

DRV_TIM_EXTERNAL_EVENT_MODE_RISING_EDGE 

External event is triggered by rising edge.

Definition at line 122 of file netx_drv_tim.h.

Time structure of the timer driver.

This structure contains the tick count based on the system clock that runs with 100Mhz.

Enumerator
DRV_TIM_PRELOAD_VALUE_1Hz 

Preload value for 1Hz.

DRV_TIM_PRELOAD_VALUE_1s 

Preload value for 1s.

DRV_TIM_PRELOAD_VALUE_2Hz 

Preload value for 2Hz.

DRV_TIM_PRELOAD_VALUE_500ms 

Preload value for 500ms.

DRV_TIM_PRELOAD_VALUE_10Hz 

Preload value for 10Hz.

DRV_TIM_PRELOAD_VALUE_100ms 

Preload value for 100ms.

DRV_TIM_PRELOAD_VALUE_100Hz 

Preload value for 100Hz.

DRV_TIM_PRELOAD_VALUE_10ms 

Preload value for 10ms.

DRV_TIM_PRELOAD_VALUE_1KHz 

Preload value for 1KHz.

DRV_TIM_PRELOAD_VALUE_1ms 

Preload value for 1ms.

DRV_TIM_PRELOAD_VALUE_2KHz 

Preload value for 2KHz.

DRV_TIM_PRELOAD_VALUE_500us 

Preload value for 500us.

DRV_TIM_PRELOAD_VALUE_10KHz 

Preload value for 10KHz.

DRV_TIM_PRELOAD_VALUE_100us 

Preload value for 100us.

DRV_TIM_PRELOAD_VALUE_100KHz 

Preload value for 100KHz.

DRV_TIM_PRELOAD_VALUE_10us 

Preload value for 10us.

DRV_TIM_PRELOAD_VALUE_1MHz 

Preload value for 1MHz.

DRV_TIM_PRELOAD_VALUE_1us 

Preload value for 1us.

DRV_TIM_PRELOAD_VALUE_2MHz 

Preload value for 2MHz.

DRV_TIM_PRELOAD_VALUE_500ns 

Preload value for 500ns.

DRV_TIM_PRELOAD_VALUE_10MHz 

Preload value for 10MHz.

DRV_TIM_PRELOAD_VALUE_100ns 

Preload value for 100ns.

DRV_TIM_PRELOAD_VALUE_100MHz 

Preload value for 100MHz.

DRV_TIM_PRELOAD_VALUE_10ns 

Preload value for 10ns.

DRV_TIM_PRELOAD_VALUE_DEFAULT 

Preload value of a stopped/paused timer or the systime unit.

Definition at line 61 of file netx_drv_tim.h.

Enumeration of the timer State.

Enumerator
DRV_TIM_STATE_DEFAULT 

Peripheral not yet initialized or disabled

DRV_TIM_STATE_STOPPED 

Peripheral Initialized and ready for use, timer stopped

DRV_TIM_STATE_PAUSED 

Timer is paused

DRV_TIM_STATE_RUNNING 

Timer is running

DRV_TIM_STATE_TIMEOUT 

Timeout state

DRV_TIM_STATE_ERROR 

Reception process is ongoing

Definition at line 93 of file netx_drv_tim.h.

Enumeration of the counting symmetries available.

Defines in which way the counter counts. From low to high or from low to high/2 and back to low.

Enumerator
DRV_TIM_SYMMETRIC_SAWTOOTH 

asymmetric mode

DRV_TIM_SYMMETRIC_TRIANGLE 

symmetric mode

Definition at line 162 of file netx_drv_tim.h.

The time base that is used for the timer.

This time base will be used for the timer. This is necessary because system timers might be stopped for debugging and also if the counter will be used in the DRV_TIM_COUNTING_MODE_COMPARE mode.

Enumerator
DRV_TIM_SYSTIME_REFERENCE_DEFAULT 

The default time base. (APP)

DRV_TIM_SYSTIME_REFERENCE_COM 

SYSTIME COM

DRV_TIM_SYSTIME_REFERENCE_COM_UC 

SYSTIME COM UC

DRV_TIM_SYSTIME_REFERENCE_APP 

SYSTIME APP

DRV_TIM_SYSTIME_REFERENCE_RESERVED 

RESERVED

DRV_TIM_SYSTIME_REFERENCE_MIN 

The minimum enumeration value for boundary check.

Definition at line 134 of file netx_drv_tim.h.

Function Documentation

__WEAK void DRV_TIM_ARMSYSTICK_Callback ( void  )

This is the callback of the SYSTEM TICK IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1533 of file netx_drv_tim.c.

Here is the caller graph for this function:

DRV_STATUS_E DRV_TIM_ChannelGetCapture ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_DIO_ID_T  ulChannelID,
uint32_t *const  ulValue 
)

This function gets the captured value of the specified channel.

This function sets the threshold capture of a digital input output channel. It is used if the specified channel is in Blink, PWM, PWM2 or capture mode.

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
[in]ulChannelIDThe id of the channel to be configured
[in]ulValueThe counter used as reference
Returns
An error code describing the current status of the driver.

Definition at line 973 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_ChannelSetThreshold ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_DIO_ID_T  ulChannelID,
uint32_t  ulTC 
)

This function sets the threshold used for the specified channel.

This function sets the threshold of a digital input output channel.

The PWM is set if the counter is greater or equal the threshold, so it defines the low time if the channel is not inverted. In triangle, both values are divided by 2 so that the low time is the same as in sawtooth.

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
[in]ulChannelIDThe id of the channel to be configured
[in]ulTCThe counter used as reference
Returns
An error code describing the current status of the driver.

Definition at line 933 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_DeInit ( DRV_TIM_HANDLE_T *const  ptTim)

DeInitializes the TIM Base peripheral.

Definition at line 267 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_DeInit ( DRV_TIM_HANDLE_T *const  ptTim)
Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
Returns
Driver status

Definition at line 267 of file netx_drv_tim.c.

Here is the call graph for this function:

DRV_STATUS_E DRV_TIM_GetState ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_TIM_STATE_E *const  peState 
)

Stores the state of the given counter.

Definition at line 1091 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_GetState ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_TIM_STATE_E *const  peState 
)
Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
[out]peStatepointer to a DRV_TIM_STATE_E enumeration that will be modified with the current state.
Returns
Driver status

Definition at line 1091 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_GetValue ( DRV_TIM_HANDLE_T *const  ptTim,
uint32_t *const  ptSoftwareValue,
uint32_t *const  ptHardwareValue 
)

Stores the current counter value.

Definition at line 1142 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_GetValue ( DRV_TIM_HANDLE_T *const  ptTim,
uint32_t *const  ptSoftwareValue,
uint32_t *const  ptHardwareValue 
)

This function stores the current counter values in the given pointer position. A software event is triggered if the hardware counter overflows by reaching its border. Keep in mind, that a counter iterates and a timer decrements.

If the hardware counters border/preload is set to e.g. 1ms it will overflow each ms and the software counter is incremented.

The software counter is iterated by the interrupt handlers and works only in the interrupt operation mode.

The systimes have to be latched before read. The software counter value contains the seconds and the hardware counter value contains the nano seconds of the systime counter.

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
[out]ptSoftwareValuepointer to a uint32_t where the current software counter value is written to.
[out]ptHardwareValuepointer to a uint32_t where the current hardware counter value is written to.
Returns
Driver status

Definition at line 1142 of file netx_drv_tim.c.

Here is the caller graph for this function:

__WEAK void DRV_TIM_GPIOTIM0_Callback ( void  )

This is the callback of the GPIOTIM 0 IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1354 of file netx_drv_tim.c.

Here is the caller graph for this function:

__WEAK void DRV_TIM_GPIOTIM1_Callback ( void  )

This is the callback of the GPIOTIM 1 IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1381 of file netx_drv_tim.c.

Here is the caller graph for this function:

__WEAK void DRV_TIM_GPIOTIM2_Callback ( void  )

This is the callback of the GPIOTIM 2 IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1407 of file netx_drv_tim.c.

Here is the caller graph for this function:

DRV_STATUS_E DRV_TIM_Init ( DRV_TIM_HANDLE_T *const  ptTim)

The device specified in the handle will be initialized and configured after the given attributes. If the interrupt or dma method is chosen, the nvic and dmac is also configured.

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
Returns
Driver status

Definition at line 107 of file netx_drv_tim.c.

Here is the call graph for this function:

DRV_STATUS_E DRV_TIM_Init ( DRV_TIM_HANDLE_T *const  ptTim)

Initializes the TIM Base peripheral.

Definition at line 107 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_IRQAttach ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_CALLBACK_F  pfnUserClb,
void *  pvUser 
)

Attaches a given callback to the counter.

Definition at line 1016 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_IRQAttach ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_CALLBACK_F  pfnUserClb,
void *  pvUser 
)

This method will attach a user given callback with the user given pointer to the interrupt of the given timer device context object.

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
[in]pfnUserClbThe callback to be called.
[in]pvUserThe handle given as second function parameter.
Returns
Driver status

Definition at line 1016 of file netx_drv_tim.c.

__STATIC_FORCEINLINE void DRV_TIM_LatchSytimes ( void  )

This function latches all system time counters.

All systimes have to be read once, after that, they return the actual value. A latch does not expire.

Returns
void

Definition at line 276 of file netx_drv_tim.h.

Here is the call graph for this function:

DRV_STATUS_E DRV_TIM_Pause ( DRV_TIM_HANDLE_T *const  ptTim)

Pauses the TIM generation.

Definition at line 619 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_Pause ( DRV_TIM_HANDLE_T *const  ptTim)
Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
Returns
Driver status

Definition at line 619 of file netx_drv_tim.c.

Here is the call graph for this function:

DRV_STATUS_E DRV_TIM_SetPreload ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_TIM_PRELOAD_VALUE_E  tCounterValue 
)

Sets a new preload value.

Definition at line 1281 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_SetPreload ( DRV_TIM_HANDLE_T *const  ptTim,
DRV_TIM_PRELOAD_VALUE_E const  tCounterValue 
)
Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
[in]tCounterValuecontains the value set as new preload.
Returns
Driver status

Definition at line 1281 of file netx_drv_tim.c.

Here is the caller graph for this function:

DRV_STATUS_E DRV_TIM_Start ( DRV_TIM_HANDLE_T *const  ptTim)

Starts the TIM generation.

Definition at line 338 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_Start ( DRV_TIM_HANDLE_T *const  ptTim)

The timer is started in non blocking mode.

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
Returns
Driver status

Definition at line 338 of file netx_drv_tim.c.

Here is the call graph for this function:

DRV_STATUS_E DRV_TIM_Stop ( DRV_TIM_HANDLE_T *const  ptTim)

Stops the TIM generation.

Definition at line 477 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_Stop ( DRV_TIM_HANDLE_T *const  ptTim)

The timer is stopped in blocking mode. After the function has finished the timer is inactive, no interrupts will occur anymore and the dma has also stopped.

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
Returns
Driver status

Definition at line 477 of file netx_drv_tim.c.

Here is the call graph for this function:

__WEAK void DRV_TIM_SYSTIME_COMPARE_Callback ( void  )

This is the callback of the SYSTIME COMPARE IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1508 of file netx_drv_tim.c.

Here is the caller graph for this function:

__WEAK void DRV_TIM_TIMER0_Callback ( void  )

This is the callback of the TIMER 0 IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1433 of file netx_drv_tim.c.

Here is the caller graph for this function:

__WEAK void DRV_TIM_TIMER1_Callback ( void  )

This is the callback of the TIMER 1 IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1458 of file netx_drv_tim.c.

Here is the caller graph for this function:

__WEAK void DRV_TIM_TIMER2_Callback ( void  )

This is the callback of the TIMER 2 IRQ.

It is called from the Interrupt service routine. And calls the function attached to the interrupt by DRV_TIM_IRQAttach() , if there is one. Because the implementation has the attribute weak it is possible to implement the callback inside the application context. EOI-handling and source clearing not necessary.

Definition at line 1483 of file netx_drv_tim.c.

Here is the caller graph for this function:

DRV_STATUS_E DRV_TIM_Wait ( DRV_TIM_HANDLE_T *const  ptTim,
uint32_t  ulTickCnt 
)

Waits at least until uSkipCnt events have occurred.

Definition at line 747 of file netx_drv_tim.c.

DRV_STATUS_E DRV_TIM_Wait ( DRV_TIM_HANDLE_T *const  ptTim,
uint32_t  ulTickCnt 
)

If the value uSkipCnt is 0, the function will wait until the next event has occurred. If the value is at least 1 the function will wait until the given ammount of events have occurred. With a timer of 1ms and a ulSkipCnt of 100 the function will wait for 100ms + 1ms (first event) + runtime > 100.5ms

Parameters
[in,out]ptTimpointer to a DRV_TIM_HANDLE_T structure.
[in]ulTickCntCount of events to skip.
Returns
DRV_ERROR DRV_ERROR_PARAM DRV_OK DRV_NSUPP

Definition at line 747 of file netx_drv_tim.c.

void GPIOTIM0_IRQHandler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1341 of file netx_drv_tim.c.

Here is the call graph for this function:

void GPIOTIM1_IRQHandler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1368 of file netx_drv_tim.c.

Here is the call graph for this function:

void GPIOTIM2_IRQHandler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1394 of file netx_drv_tim.c.

Here is the call graph for this function:

void SysTick_Handler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1521 of file netx_drv_tim.c.

Here is the call graph for this function:

void SYSTIME_IRQHandler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1495 of file netx_drv_tim.c.

Here is the call graph for this function:

void TIM0_IRQHandler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1420 of file netx_drv_tim.c.

Here is the call graph for this function:

void TIM1_IRQHandler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1445 of file netx_drv_tim.c.

Here is the call graph for this function:

void TIM2_IRQHandler ( void  )

This function handles interrupts requests.

Returns
None

Definition at line 1470 of file netx_drv_tim.c.

Here is the call graph for this function:

Variable Documentation

IRQn_Type const aulIRQnTable[DRV_TIM_IRQ_COUNT] = DRV_TIM_IRQ_LIST
static

Table of the IRQ vector numbers.

Used to identify the interrupt channels by the device id.

Definition at line 56 of file netx_drv_tim.c.

DRV_TIM_HANDLE_T* s_apTIMCallbackDriverHandleTable[DRV_TIM_IRQ_COUNT] = { 0 }
static

Interrupt driver handler context pointers.

Definition at line 73 of file netx_drv_tim.c.

void* s_apTIMCallbackHandleTable[DRV_TIM_IRQ_COUNT] = { 0 }
static

Interrupt attached handler context pointers.

Definition at line 68 of file netx_drv_tim.c.

DRV_CALLBACK_F s_apTIMCallbackTable[DRV_TIM_IRQ_COUNT] = { 0 }
static

Used for mapping the handle to an interrupt.

Threadsafe and reentrant because its is only written in normal context an used in interrupt context of the specific interrupt.

Definition at line 63 of file netx_drv_tim.c.

volatile uint32_t s_apTIMIrqCntr[DRV_TIM_IRQ_COUNT] = { 0 }
static

Interrupt counter.

Definition at line 78 of file netx_drv_tim.c.