Implementation
Configuring the system timer to periodically generate interrupts:
›
The configuration of the system timer is done through the function
configSystemTimer()
.
–
The system timer immediately runs after PowerUp and needs to be configured.
–
Create an instance of the structure
IfxStm_Timer_Config,
which is initialized
by calling
IfxStm_Timer_initConfig()
. Then configure the following
components:
–
Set the rate in Hz that refers to interrupt events per second.
–
Define the priority for the interrupt (range from 0 to 255)
–
Define the provider for interrupt service request as CPU0, CPU1, CPU2 or
DMA
–
Specify the comparator register that is used to store the compare value to
trigger an event when timer and comparator register match.
–
Use the routine
IfxStm_Timer_init()
together with the instance of structure
IfxStm_Timer_Config
to create the
g_myTimer
handle.
The above functions can be found in the header
IfxStm_Timer.h
.
5
2020-01-17
Copyright © Infineon Technologies AG 2020. All rights reserved.