Use the sequence that follows to initialize and configure the timers:
- To use a GPT module, enable the peripheral domain and the appropriate GPT module in the PRCM by writing to the PRCM:GPTCLKGR, the PRCM:GPTCLKGS, and the PRCM:GPTCLKGDS registers, or by using the following driver library functions:
PRCMPeripheralRunEnable(uint32_t, ui32Peripheral)
PRCMPeripheralSleepEnable(uint32_t, ui32Peripheral)
PRCMPeripheralDeepSLeepEnable(uint32_t, ui32Peripheral)
- Next, load the setting to the clock controller by writing to the PRCM:CLKLOADCTL register.
- Configure the IOC module to route the output from the GPT module to the IOs.
- The IOC module must then be configured to output the timer signal on the wanted I/O pin. For this, IOCFGn.PORTID must be written to the correct PORTIDs (for more details, see Section 14).
The following sections show module initialization and configuration examples for each of the supported timer modes.