![]() |
Infineon MOTIX™ MCU TLE985x Device Family SDK
|
Go to the source code of this file.
Timer2/Timer21 low level access library.
Macros | |
#define | MIN_TIMER_INTERVAL_US 1u |
Functions | |
void | TIMER2_Init (void) |
Initializes the Timer2 module. More... | |
void | TIMER21_Init (void) |
Initializes the Timer21 module. More... | |
bool | TIMER2_Interval_Timer_Setup (uint32 timer_interval_us) |
Initializes the TIMER2 in Reload Mode. More... | |
bool | TIMER21_Interval_Timer_Setup (uint32 timer_interval_us) |
Initializes the TIMER21 in Reload Mode. More... | |
INLINE void | TIMER2_Clk_Prescaler_En (void) |
Enables TIMER2 clock prescaler. More... | |
INLINE void | TIMER2_Clk_Prescaler_Dis (void) |
Disables TIMER2 clock prescaler. More... | |
INLINE void | TIMER2_Clk_Prescaler_Sel (uint8 t2pre) |
Sets TIMER2 clock prescaler. More... | |
INLINE uint8 | TIMER2_Clk_Prescaler_Get (void) |
Reads TIMER2 clock prescaler. More... | |
INLINE uint8 | TIMER2_Overflow_Sts (void) |
Reads TIMER2 Overflow Status. More... | |
INLINE uint8 | TIMER2_External_Sts (void) |
Reads TIMER2 External Status. More... | |
INLINE void | TIMER2_ExternalCtrl_En (void) |
Enables TIMER2 External Control. More... | |
INLINE void | TIMER2_ExternalCtrl_Dis (void) |
Disables TIMER2 External Control. More... | |
INLINE void | TIMER2_Reload_Capture_RisingEdge_Set (void) |
Sets Rising Edge to Capture/Reload Mode for TIMER2. More... | |
INLINE void | TIMER2_Reload_Capture_FallingEdge_Set (void) |
Sets Falling Edge to Capture/Reload Mode for TIMER2. More... | |
INLINE void | TIMER2_ExtStart_RisingEdge_Set (void) |
Sets Rising Edge to External Start for TIMER2. More... | |
INLINE void | TIMER2_ExtStart_FallingEdge_Set (void) |
Sets Falling Edge to External Start for TIMER2. More... | |
INLINE void | TIMER2_UpDownCount_En (void) |
Enables Up/Down Counter for TIMER2. More... | |
INLINE void | TIMER2_UpDownCount_Dis (void) |
Disables Up/Down Counter for TIMER2. More... | |
INLINE void | TIMER2_Mode_Capture_Set (void) |
Selects Capture Mode for TIMER2. More... | |
INLINE void | TIMER2_Mode_Reload_Set (void) |
Selects Reload Mode for TIMER2. More... | |
INLINE void | TIMER2_Mode_Counter_Set (void) |
Selects Mode Counter for TIMER2. More... | |
INLINE void | TIMER2_Mode_Timer_Set (void) |
Selects Mode Timer for TIMER2. More... | |
INLINE void | TIMER2_Value_Set (uint16 t2) |
Sets TIMER2 Value. More... | |
INLINE void | TIMER2_Reload_Value_Set (uint16 t2) |
Sets TIMER2 Reload Value. More... | |
INLINE void | TIMER2_Overflow_Int_Clr (void) |
Clears TIMER2 Overflow Interrupt flag. More... | |
INLINE void | TIMER2_External_Int_Clr (void) |
Clears TIMER2 External Interrupt flag. More... | |
INLINE void | TIMER2_Overflow_Int_En (void) |
Enables TIMER2 Overflow Interrupt. More... | |
INLINE void | TIMER2_Overflow_Int_Dis (void) |
Disables TIMER2 Overflow Interrupt. More... | |
INLINE void | TIMER2_External_Int_En (void) |
Enables TIMER2 External Interrupt. More... | |
INLINE void | TIMER2_External_Int_Dis (void) |
Disables TIMER2 External Interrupt. More... | |
INLINE void | TIMER21_Clk_Prescaler_En (void) |
Enables TIMER21 clock prescaler. More... | |
INLINE void | TIMER21_Clk_Prescaler_Dis (void) |
Disables TIMER21 clock prescaler. More... | |
INLINE void | TIMER21_Clk_Prescaler_Sel (uint8 t21pre) |
Sets TIMER21 clock prescaler. More... | |
INLINE uint8 | TIMER21_Clk_Prescaler_Get (void) |
Reads TIMER21 clock prescaler. More... | |
INLINE uint8 | TIMER21_Overflow_Sts (void) |
Reads TIMER21 Overflow Status. More... | |
INLINE uint8 | TIMER21_External_Sts (void) |
Reads TIMER21 External Status. More... | |
INLINE void | TIMER21_ExternalCtrl_En (void) |
Enables TIMER21 External Control. More... | |
INLINE void | TIMER21_ExternalCtrl_Dis (void) |
Disables TIMER21 External Control. More... | |
INLINE void | TIMER21_Reload_Capture_RisingEdge_Set (void) |
Sets Rising Edge to Capture/Reload Mode for TIMER21. More... | |
INLINE void | TIMER21_Reload_Capture_FallingEdge_Set (void) |
Sets Falling Edge to Capture/Reload Mode for TIMER21. More... | |
INLINE void | TIMER21_ExtStart_RisingEdge_Set (void) |
Sets Rising Edge to External Start for TIMER21. More... | |
INLINE void | TIMER21_ExtStart_FallingEdge_Set (void) |
Sets Falling Edge to External Start for TIMER21. More... | |
INLINE void | TIMER21_UpDownCount_En (void) |
Enables Up/Down Counter for TIMER21. More... | |
INLINE void | TIMER21_UpDownCount_Dis (void) |
Disables Up/Down Counter for TIMER21. More... | |
INLINE void | TIMER21_Mode_Capture_Set (void) |
Selects Capture Mode for TIMER21. More... | |
INLINE void | TIMER21_Mode_Reload_Set (void) |
Selects Reload Mode for TIMER21. More... | |
INLINE void | TIMER21_Mode_Counter_Set (void) |
Selects Mode Counter for TIMER21. More... | |
INLINE void | TIMER21_Mode_Timer_Set (void) |
Selects Mode Timer for TIMER21. More... | |
INLINE void | TIMER21_Value_Set (uint16 t21) |
Sets TIMER21 Value. More... | |
INLINE void | TIMER21_Reload_Value_Set (uint16 t21) |
Sets TIMER21 Reload Value. More... | |
INLINE void | TIMER21_Overflow_Int_Clr (void) |
Clears TIMER21 Overflow Interrupt. More... | |
INLINE void | TIMER21_External_Int_Clr (void) |
Clears TIMER21 External Interrupt. More... | |
INLINE void | TIMER21_Overflow_Int_En (void) |
Enables TIMER21 Overflow Interrupt. More... | |
INLINE void | TIMER21_Overflow_Int_Dis (void) |
Disables TIMER21 Overflow Interrupt. More... | |
INLINE void | TIMER21_External_Int_En (void) |
Enables TIMER21 External Interrupt. More... | |
INLINE void | TIMER21_External_Int_Dis (void) |
Disables TIMER21 External Interrupt. More... | |
INLINE void | TIMER2_Start (void) |
Starts the TIMER2 by software. More... | |
INLINE void | TIMER2_Stop (void) |
Stops the TIMER2 by software. More... | |
INLINE void | TIMER2_ExtStart (void) |
Prepares TIMER2 to be started externally. More... | |
INLINE void | TIMER2_ExtStop (void) |
Disables TIMER2 to be started externally. More... | |
INLINE uint16 | TIMER2_Get_Count (void) |
Reads the TIMER2 count value. More... | |
INLINE uint16 | TIMER2_Get_Capture (void) |
Reads the TIMER2 capture value. More... | |
INLINE void | TIMER2_Clear_Count (void) |
Clears the TIMER2 count value. More... | |
INLINE void | TIMER2_Set_Reload (uint16 value) |
Sets TIMER2 reload value. More... | |
INLINE void | TIMER2_Select_T2IN (TTIMER2_T2IN_Pxx pinsel) |
Sets TIMER2 T2IN Pin. More... | |
INLINE void | TIMER2_Select_T2EX (TTIMER2_T2EX_Pxx pinsel) |
Sets TIMER2 T2EX Pin. More... | |
INLINE void | TIMER21_Start (void) |
Starts the TIMER21 by software. More... | |
INLINE void | TIMER21_Stop (void) |
Stops the TIMER21 by software. More... | |
INLINE void | TIMER21_ExtStart (void) |
Prepares TIMER21 to be started externally. More... | |
INLINE void | TIMER21_ExtStop (void) |
Disables TIMER21 to be started externally. More... | |
INLINE uint16 | TIMER21_Get_Count (void) |
Reads the TIMER21 count value. More... | |
INLINE uint16 | TIMER21_Get_Capture (void) |
Reads the TIMER21 capture value. More... | |
INLINE void | TIMER21_Clear_Count (void) |
Clears the TIMER21 count value. More... | |
INLINE void | TIMER21_Set_Reload (uint16 value) |
Sets TIMER21 reload value. More... | |
INLINE void | TIMER21_Select_T21IN (TTIMER21_T21IN_Pxx pinsel) |
Sets TIMER21 T21IN Pin. More... | |
INLINE void | TIMER21_Select_T21EX (TTIMER21_T21EX_Pxx pinsel) |
Sets TIMER21 T21EX Pin. More... | |
#define MIN_TIMER_INTERVAL_US 1u |
This enum lists TIMER2x Clock Prescaler Configuration.
enum TTIMER21_T21EX_Pxx |
This enum lists the T21EX Inputs.
enum TTIMER21_T21IN_Pxx |
enum TTIMER2_T2EX_Pxx |
This enum lists the T2EX Inputs.
enum TTIMER2_T2IN_Pxx |
INLINE void TIMER21_Clear_Count | ( | void | ) |
Clears the TIMER21 count value.
Example
This example stops and reset TIMER21 by software.
INLINE void TIMER21_Clk_Prescaler_Dis | ( | void | ) |
Disables TIMER21 clock prescaler.
Example
This example disables TIMER21 clock prescaler.
INLINE void TIMER21_Clk_Prescaler_En | ( | void | ) |
Enables TIMER21 clock prescaler.
Example
This example enables TIMER21 clock prescaler.
Reads TIMER21 clock prescaler.
Example
This example reads TIMER21 clock prescaler.
Sets TIMER21 clock prescaler.
t21pre | TIMER21 clock prescaler, see TIMER2x_Clock_Prescaler |
Example
This example sets TIMER21 clock prescaler to DIV2.
INLINE void TIMER21_External_Int_Clr | ( | void | ) |
Clears TIMER21 External Interrupt.
Example
This example treats the TIMER21 External Interrupt.
INLINE void TIMER21_External_Int_Dis | ( | void | ) |
Disables TIMER21 External Interrupt.
Example
This example treats the TIMER21 External Interrupt.
INLINE void TIMER21_External_Int_En | ( | void | ) |
Enables TIMER21 External Interrupt.
Example
This example treats the TIMER21 External Interrupt.
Reads TIMER21 External Status.
Example
This example checks the TIMER21 External Status.
INLINE void TIMER21_ExternalCtrl_Dis | ( | void | ) |
Disables TIMER21 External Control.
Example
This example reads TIMER21 External Status.
INLINE void TIMER21_ExternalCtrl_En | ( | void | ) |
Enables TIMER21 External Control.
Example
This example checks the TIMER21 External Status.
INLINE void TIMER21_ExtStart | ( | void | ) |
Prepares TIMER21 to be started externally.
Example
This example sets Rising Edge to External Start.
INLINE void TIMER21_ExtStart_FallingEdge_Set | ( | void | ) |
Sets Falling Edge to External Start for TIMER21.
Example
This example sets Falling Edge to External Start.
INLINE void TIMER21_ExtStart_RisingEdge_Set | ( | void | ) |
Sets Rising Edge to External Start for TIMER21.
Example
This example sets Rising Edge to External Start.
INLINE void TIMER21_ExtStop | ( | void | ) |
Disables TIMER21 to be started externally.
Example
This example sets Rising Edge to External Start.
Reads the TIMER21 capture value.
Example
This example reads the TIMER21 capture value.
Reads the TIMER21 count value.
Example
This example reads the TIMER21 count value.
void TIMER21_Init | ( | void | ) |
Initializes the Timer21 module.
Initializes the TIMER21 in Reload Mode.
timer_interval_us | timer interval in microseconds |
Example
This example Initializes the TIMER21 in Reload Mode with timer equals to 5000 us.
INLINE void TIMER21_Mode_Capture_Set | ( | void | ) |
Selects Capture Mode for TIMER21.
Example
This example enters 16-bit Capture Mode.
INLINE void TIMER21_Mode_Counter_Set | ( | void | ) |
Selects Mode Counter for TIMER21.
Example
This example sets the Mode Counter.
INLINE void TIMER21_Mode_Reload_Set | ( | void | ) |
Selects Reload Mode for TIMER21.
Example
This example enters Auto-Reload Mode.
INLINE void TIMER21_Mode_Timer_Set | ( | void | ) |
Selects Mode Timer for TIMER21.
Example
This example sets the Mode Timer.
INLINE void TIMER21_Overflow_Int_Clr | ( | void | ) |
Clears TIMER21 Overflow Interrupt.
Example
This example treats the TIMER21 Overflow Interrupt.
INLINE void TIMER21_Overflow_Int_Dis | ( | void | ) |
Disables TIMER21 Overflow Interrupt.
Example
This example treats the TIMER21 Overflow Interrupt.
INLINE void TIMER21_Overflow_Int_En | ( | void | ) |
Enables TIMER21 Overflow Interrupt.
Example
This example treats the TIMER21 Overflow Interrupt.
Reads TIMER21 Overflow Status.
Example
This example checks the TIMER21 Overflow Status.
INLINE void TIMER21_Reload_Capture_FallingEdge_Set | ( | void | ) |
Sets Falling Edge to Capture/Reload Mode for TIMER21.
Example
This example sets Falling Edge to Capture/Reload Mode.
INLINE void TIMER21_Reload_Capture_RisingEdge_Set | ( | void | ) |
Sets Rising Edge to Capture/Reload Mode for TIMER21.
Example
This example sets Rising Edge to Capture/Reload Mode.
Sets TIMER21 Reload Value.
t21 | TIMER21 Reload Value |
Example
This example sets TIMER21 Reload Value to 5000.
INLINE void TIMER21_Select_T21EX | ( | TTIMER21_T21EX_Pxx | pinsel | ) |
Sets TIMER21 T21EX Pin.
pinsel | T21EX Pin select, see TTIMER21_T21EX_Pxx |
Example
This example sets TIMER2 External Input to T21EX_0(P0.2).
INLINE void TIMER21_Select_T21IN | ( | TTIMER21_T21IN_Pxx | pinsel | ) |
Sets TIMER21 T21IN Pin.
pinsel | T21IN Pin select, see TTIMER21_T21IN_Pxx |
Example
This example sets TIMER2 Input to T21_1(P1.2).
Sets TIMER21 reload value.
value | reload value in ticks |
Example
This example sets TIMER21 Reload Value to 5000 ticks.
INLINE void TIMER21_Start | ( | void | ) |
Starts the TIMER21 by software.
Example
This example starts the TIMER21 by software.
INLINE void TIMER21_Stop | ( | void | ) |
Stops the TIMER21 by software.
Example
This example stops and reset TIMER21 by software.
INLINE void TIMER21_UpDownCount_Dis | ( | void | ) |
Disables Up/Down Counter for TIMER21.
Example
This example starts Up Counter once TR2 is set and External Control was disabled.
INLINE void TIMER21_UpDownCount_En | ( | void | ) |
Enables Up/Down Counter for TIMER21.
Example
This example starts Up Counter once there is a logic 1 at pin T21EX which is configured to P0.2 .
Sets TIMER21 Value.
t21 | TIMER21 Value |
Example
This example sets TIMER21 Value to 5000.
INLINE void TIMER2_Clear_Count | ( | void | ) |
Clears the TIMER2 count value.
Example
This example stops and reset TIMER2 by software.
INLINE void TIMER2_Clk_Prescaler_Dis | ( | void | ) |
Disables TIMER2 clock prescaler.
Example
This example disables TIMER2 clock prescaler.
INLINE void TIMER2_Clk_Prescaler_En | ( | void | ) |
Enables TIMER2 clock prescaler.
Example
This example enables TIMER2 clock prescaler.
Reads TIMER2 clock prescaler.
Example
This example reads TIMER2 clock prescaler.
Sets TIMER2 clock prescaler.
t2pre | TIMER2 clock prescaler, see TIMER2x_Clock_Prescaler |
Example
This example sets TIMER2 clock prescaler to DIV2.
INLINE void TIMER2_External_Int_Clr | ( | void | ) |
Clears TIMER2 External Interrupt flag.
Example
This example treats the TIMER2 External Interrupt.
INLINE void TIMER2_External_Int_Dis | ( | void | ) |
Disables TIMER2 External Interrupt.
Example
This example treats the TIMER2 External Interrupt.
INLINE void TIMER2_External_Int_En | ( | void | ) |
Enables TIMER2 External Interrupt.
Example
This example treats the TIMER2 External Interrupt.
Reads TIMER2 External Status.
Example
This example checks the TIMER2 External Status.
INLINE void TIMER2_ExternalCtrl_Dis | ( | void | ) |
Disables TIMER2 External Control.
Example
This example reads TIMER2 External Status.
INLINE void TIMER2_ExternalCtrl_En | ( | void | ) |
Enables TIMER2 External Control.
Example
This example checks the TIMER2 External Status.
INLINE void TIMER2_ExtStart | ( | void | ) |
Prepares TIMER2 to be started externally.
Example
This example sets Rising Edge to External Start.
INLINE void TIMER2_ExtStart_FallingEdge_Set | ( | void | ) |
Sets Falling Edge to External Start for TIMER2.
Example
This example sets Falling Edge to External Start.
INLINE void TIMER2_ExtStart_RisingEdge_Set | ( | void | ) |
Sets Rising Edge to External Start for TIMER2.
Example
This example sets Rising Edge to External Start.
INLINE void TIMER2_ExtStop | ( | void | ) |
Disables TIMER2 to be started externally.
Example
This example sets Rising Edge to External Start.
Reads the TIMER2 capture value.
Example
This example reads the TIMER2 capture value.
Reads the TIMER2 count value.
Example
This example reads the TIMER2 count value.
void TIMER2_Init | ( | void | ) |
Initializes the Timer2 module.
Initializes the TIMER2 in Reload Mode.
timer_interval_us | timer interval in microseconds |
Example
This example Initializes the TIMER2 in Reload Mode with timer equals to 5000 us.
INLINE void TIMER2_Mode_Capture_Set | ( | void | ) |
Selects Capture Mode for TIMER2.
Example
This example enters 16-bit Capture Mode.
INLINE void TIMER2_Mode_Counter_Set | ( | void | ) |
Selects Mode Counter for TIMER2.
Example
This example sets the Mode Counter.
INLINE void TIMER2_Mode_Reload_Set | ( | void | ) |
Selects Reload Mode for TIMER2.
Example
This example enters Auto-Reload Mode.
INLINE void TIMER2_Mode_Timer_Set | ( | void | ) |
Selects Mode Timer for TIMER2.
Example
This example sets the Mode Timer.
INLINE void TIMER2_Overflow_Int_Clr | ( | void | ) |
Clears TIMER2 Overflow Interrupt flag.
Example
This example treats the TIMER2 Overflow Interrupt.
INLINE void TIMER2_Overflow_Int_Dis | ( | void | ) |
Disables TIMER2 Overflow Interrupt.
Example
This example treats the TIMER2 Overflow Interrupt.
INLINE void TIMER2_Overflow_Int_En | ( | void | ) |
Enables TIMER2 Overflow Interrupt.
Example
This example treats the TIMER2 Overflow Interrupt.
Reads TIMER2 Overflow Status.
Example
This example checks the TIMER2 Overflow Status.
INLINE void TIMER2_Reload_Capture_FallingEdge_Set | ( | void | ) |
Sets Falling Edge to Capture/Reload Mode for TIMER2.
Example
This example sets Falling Edge to Capture/Reload Mode.
INLINE void TIMER2_Reload_Capture_RisingEdge_Set | ( | void | ) |
Sets Rising Edge to Capture/Reload Mode for TIMER2.
Example
This example sets Rising Edge to Capture/Reload Mode.
Sets TIMER2 Reload Value.
t2 | TIMER2 Reload Value |
Example
This example sets TIMER2 Reload Value to 5000.
INLINE void TIMER2_Select_T2EX | ( | TTIMER2_T2EX_Pxx | pinsel | ) |
Sets TIMER2 T2EX Pin.
pinsel | T2EX Pin select, see TTIMER2_T2EX_Pxx |
Example
This example sets TIMER2 External Input to T2EX_0(P2.2).
INLINE void TIMER2_Select_T2IN | ( | TTIMER2_T2IN_Pxx | pinsel | ) |
Sets TIMER2 T2IN Pin.
pinsel | T2IN Pin select, see TTIMER2_T2IN_Pxx |
Example
This example sets TIMER2 Input to T2_1(P2.7).
Sets TIMER2 reload value.
value | reload value in ticks |
Example
This example sets TIMER2 Reload Value to 5000 ticks.
INLINE void TIMER2_Start | ( | void | ) |
Starts the TIMER2 by software.
Example
This example starts the TIMER2 by software.
INLINE void TIMER2_Stop | ( | void | ) |
Stops the TIMER2 by software.
Example
This example stops and reset TIMER2 by software.
INLINE void TIMER2_UpDownCount_Dis | ( | void | ) |
Disables Up/Down Counter for TIMER2.
Example
This example starts Up Counter once TR2 is set and External Control was disabled.
INLINE void TIMER2_UpDownCount_En | ( | void | ) |
Enables Up/Down Counter for TIMER2.
Example
This example starts Up Counter once there is a logic 1 at pin T2EX which is configured to P2.2 .
Sets TIMER2 Value.
t2 | TIMER2 Value |
Example
This example sets TIMER2 Value to 5000 ticks.