MCUSW
GPT Driver API

Introduction

The GPT Driver MCAL provides low level access to GPT peripheral

present on TDA4XX

See also
GPT Configuration
Gpt Driver Interrupt Handlers
MCAL_GPT_DBG_API

Sub Modules

 GPT Configuration
 
 Gpt Driver Interrupt Handlers
 

Functions

void Gpt_GetVersionInfo (Std_VersionInfoType *VersionInfoPtr)
 This service returns the version information of this module. More...
 
void Gpt_Init (const Gpt_ConfigType *CfgPtr)
 This service initializes all the configured Gpt channels. This will set the state of the each channel to"initialized", also set the Gpt driver state to "Normal". More...
 
void Gpt_DeInit (void)
 This service deinitializes the RTI used by Gpt driver to the power on reset state. The Gpt driver state is changed to "Uninitialized" state". All the channel registers are cleared to stop the timer channels. API will disable all interrupt notifications, wakeup interrupts. More...
 
Gpt_ValueType Gpt_GetTimeElapsed (Gpt_ChannelType Channel)
 Gpt_GetTimeElapsed will return the time elapsed for channel which is referenced. The user can configure the channel in two modes, One-shot and Continuous mode. In one shot mode, if the timer is in stopped state, the function will return time value at the moment of stopping. If the timer is expired, the function will return the target time configured for the channel. In Continuous Mode - The elapsed time value will be the value relative to last occurrence. More...
 
Gpt_ValueType Gpt_GetTimeRemaining (Gpt_ChannelType Channel)
 Gpt_GetTimeRemaining will return the timer value remaining until the target time will be reached next time. The remaining time is target time minus time already elapsed. In one shot mode, if the timer is in stopped state, the function will return remaining time value at the moment of stopping. If the timer is expired, the function will return 0. More...
 
void Gpt_StartTimer (Gpt_ChannelType Channel, Gpt_ValueType Value)
 Gpt_StartTimer will start the selected timer channel with defined target time. If the timer channel is enabled for interrupt notification, then interrupt notification will be triggered after expiration of the selected timer channel. In one shot mode, if the timer is expired then the channel will be stopped in interrupt subroutine. The selected channel will be moved to "Running" state after calling this function. More...
 
void Gpt_StopTimer (Gpt_ChannelType Channel)
 Gpt_StopTimer will stop the selected timer channel.This will clear all the registers corresponding to the selected channel. The state of the timer channel will be changed to "Stopped".If the channel is in state "Initialized","Expired","Stopped" before calling this function, the function will be left without any action. More...
 
void Gpt_EnableNotification (Gpt_ChannelType Channel)
 Gpt_EnableNotification will enable the interrupt notification for the selected channel. The SETINT bit in RTI Set interrupt register will be Set to enable the Compare interrupt. The interrupt is triggered when Free running counter value matches with compare register value. More...
 
void Gpt_DisableNotification (Gpt_ChannelType Channel)
 Gpt_DisableNotification will disable the compare interrupt notification for the selected channel. The SETINT bit in RTI Set interrupt register will be cleared to disable the Compare interrupt. The interrupt is triggered when Free running counter value matches with compare register value. More...
 
void Gpt_SetMode (Gpt_ModeType Mode)
 Gpt_SetMode will set the operation mode of the Gpt driver to the given set mode parameter. If the parameter mode = Normal, then the function will enable the interrupt notifications for all the channels which are configured for notification and notification is enabled. If the Mode = Sleep, the function will enable the wakeup interrupts for all channels which are configured for wakeup and disable all other channels. All the timer channels which are running will be stopped in this mode. More...
 
void Gpt_DisableWakeup (Gpt_ChannelType Channel)
 Gpt_DisableWakeup will disable the wakeup interrupt of the referenced channel. The function will save the attribute "wakeup disable" of the channel. More...
 
void Gpt_EnableWakeup (Gpt_ChannelType Channel)
 Gpt_EnableWakeup will enable the wakeup interrupt of the referenced channel. The function will save the attribute "wakeup enable" of the channel which only affects the wakeup interrupt when the driver is in Sleep mode. More...
 
void Gpt_CheckWakeup (EcuM_WakeupSourceType WakeupSource)
 Gpt_CheckWakeup will check if wakeup capable timer channel is source for a wakeup event and call EcuM_SetWakeupEvent to indicate the valid timer wakeup event to the EcuM. More...
 
Std_ReturnType Gpt_RegisterReadback (Gpt_ChannelType GptChannel, Gpt_RegisterReadbackType *RegRbPtr)
 This function reads the important registers of the hardware unit and returns the value in the structure. More...
 

Macros

#define GPT_CH_ISR_MODE_CONTINUOUS   (0U)
 GPT continuous mode index. More...
 
#define GPT_CH_ISR_MODE_ONESHOT   (1U)
 GPT oneshot mode index. More...
 
#define GPT_CH_ISR_MODE_CONT_WAKEUP   (2U)
 GPT continuous wakeup mode index. More...
 
#define GPT_CH_ISR_MODE_ONESHOT_WAKEUP   (3U)
 GPT oneshot wakeup mode index. More...
 
#define GPT_CH_GPTIMER_MAX   (30U)
 maximum GP timer channels available More...
 
#define GPT_CH_GPTIMER1   (0U)
 GP timer 1 instance. More...
 
#define GPT_CH_GPTIMER2   (1U)
 GP timer 2 instance. More...
 
#define GPT_CH_GPTIMER3   (2U)
 GP timer 3 instance. More...
 
#define GPT_CH_GPTIMER4   (3U)
 GP timer 4 instance. More...
 
#define GPT_CH_GPTIMER5   (4U)
 GP timer 5 instance. More...
 
#define GPT_CH_GPTIMER6   (5U)
 GP timer 6 instance. More...
 
#define GPT_CH_GPTIMER7   (6U)
 GP timer 7 instance. More...
 
#define GPT_CH_GPTIMER8   (7U)
 GP timer 8 instance. More...
 
#define GPT_CH_GPTIMER9   (8U)
 GP timer 9 instance. More...
 
#define GPT_CH_GPTIMER10   (9U)
 GP timer 10 instance. More...
 
#define GPT_CH_GPTIMER11   (10U)
 GP timer 11 instance. More...
 
#define GPT_CH_GPTIMER12   (11U)
 GP timer 12 instance. More...
 
#define GPT_CH_GPTIMER13   (12U)
 GP timer 13 instance. More...
 
#define GPT_CH_GPTIMER14   (13U)
 GP timer 14 instance. More...
 
#define GPT_CH_GPTIMER15   (14U)
 GP timer 15 instance. More...
 
#define GPT_CH_GPTIMER16   (15U)
 GP timer 16 instance. More...
 
#define GPT_CH_GPTIMER17   (16U)
 GP timer 17 instance. More...
 
#define GPT_CH_GPTIMER18   (17U)
 GP timer 18 instance. More...
 
#define GPT_CH_GPTIMER19   (18U)
 GP timer 19 instance. More...
 
#define GPT_CH_GPTIMER20   (19U)
 GP timer 20 instance. More...
 
#define GPT_CH_GPTIMER21   (20U)
 GP timer 21 instance. More...
 
#define GPT_CH_GPTIMER22   (21U)
 GP timer 22 instance. More...
 
#define GPT_CH_GPTIMER23   (22U)
 GP timer 23 instance. More...
 
#define GPT_CH_GPTIMER24   (23U)
 GP timer 24 instance. More...
 
#define GPT_CH_GPTIMER25   (24U)
 GP timer 25 instance. More...
 
#define GPT_CH_GPTIMER26   (25U)
 GP timer 26 instance. More...
 
#define GPT_CH_GPTIMER27   (26U)
 GP timer 27 instance. More...
 
#define GPT_CH_GPTIMER28   (27U)
 GP timer 28 instance. More...
 
#define GPT_CH_GPTIMER29   (28U)
 GP timer 29 instance. More...
 
#define GPT_CH_GPTIMER30   (29U)
 GP timer 30 instance. More...
 

GPT Driver Module SW Version Info

Defines for GPT Driver version used for compatibility checks

#define GPT_SW_MAJOR_VERSION   (1U)
 Driver Implementation Major Version. More...
 
#define GPT_SW_MINOR_VERSION   (3U)
 Driver Implementation Minor Version. More...
 
#define GPT_SW_PATCH_VERSION   (4U)
 Driver Implementation Patch Version. More...
 

GPT Driver Module AUTOSAR Version Info

Defines for GPT Driver AUTOSAR version used for compatibility checks

#define GPT_AR_RELEASE_MAJOR_VERSION   (4U)
 AUTOSAR Major version specification implemented by GPT Driver. More...
 
#define GPT_AR_RELEASE_MINOR_VERSION   (3U)
 AUTOSAR Minor version specification implemented by GPT Driver. More...
 
#define GPT_AR_RELEASE_REVISION_VERSION   (1U)
 AUTOSAR Patch version specification implemented by GPT Driver. More...
 

GPT Driver ID Info

#define GPT_VENDOR_ID   ((uint16) 44U)
 Texas Instruments Vendor ID. More...
 
#define GPT_MODULE_ID   ((uint16) 100U)
 GPT Driver Module ID. More...
 
#define GPT_INSTANCE_ID   ((uint8) 0U)
 GPT Driver Instance ID. More...
 

GPT Error Codes

Error codes returned by GPT functions

#define GPT_E_UNINIT   (0x0AU)
 API service used without module initialization. More...
 
#define GPT_E_BUSY   (0x0BU)
 API service called during ongoing process (Timer is already running) More...
 
#define GPT_E_MODE   (0x0CU)
 API service called when driver is in wrong mode. Used primarily when PreDef Timers are used. Since PreDef Timer are not supported in this implementation, this error code is not used. More...
 
#define GPT_E_ALREADY_INITIALIZED   (0x0DU)
 API Gpt_Init is called but the module is already initialized. More...
 
#define GPT_E_INIT_FAILED   (0x0EU)
 API Gpt_Init is called but the module is already initialized. More...
 
#define GPT_E_PARAM_CHANNEL   (0x14U)
 API called with invalid channel. More...
 
#define GPT_E_PARAM_VALUE   (0x15U)
 API service called with invalid start timer parameter. More...
 
#define GPT_E_PARAM_POINTER   (0x16U)
 API service called with invalid(Null_Ptr) data buffer pointer. More...
 
#define GPT_E_PARAM_PREDEF_TIMER   (0x17U)
 API service called with invalid Predef Timer. Not supported in this implementation. More...
 
#define GPT_E_PARAM_MODE   (0x1FU)
 Gpt_SetMode is called with wrong mode parameter. More...
 
#define GPT_E_INVALID_ISR   (0x80U)
 Invalid entry to ISR. More...
 

GPT Service Ids

The Service Id is one of the argument to Det_ReportError function and is used to identify the source of the error

#define GPT_SID_GET_VERSION_INFO   (0x00U)
 Gpt_GetVersionInfo() API Service ID. More...
 
#define GPT_SID_INIT   (0x01U)
 Gpt_Init() API Service ID. More...
 
#define GPT_SID_DEINIT   (0x02U)
 Gpt_DeInit() API Service ID. More...
 
#define GPT_SID_GET_TIME_ELAPSED   (0x03U)
 Gpt_GetTimeElapsed() API Service ID. More...
 
#define GPT_SID_GET_TIME_REMAINING   (0x04U)
 Gpt_GetTimeRemaining() API Service ID. More...
 
#define GPT_SID_START_TIMER   (0x05U)
 Gpt_StartTimer() API Service ID. More...
 
#define GPT_SID_STOP_TIMER   (0x06U)
 Gpt_StopTimer() API Service ID. More...
 
#define GPT_SID_ENABLE_NOTIFY   (0x07U)
 Gpt_EnableNotification() API Service ID. More...
 
#define GPT_SID_DISABLE_NOTIFY   (0x08U)
 Gpt_DisableNotification() API Service ID. More...
 
#define GPT_SID_SET_MODE   (0x09U)
 Gpt_SetMode() API Service ID. More...
 
#define GPT_SID_DISABLE_WAKEUP   (0x0AU)
 Gpt_DisableWakeup() API Service ID. More...
 
#define GPT_SID_ENABLE_WAKEUP   (0x0BU)
 Gpt_EnableWakeup() API Service ID. More...
 
#define GPT_SID_CHECK_WAKEUP   (0x0CU)
 Gpt_CheckWakeup() API Service ID. More...
 
#define GPT_SID_GET_PREDEFTIMERVALUE   (0x0DU)
 Gpt_GetPredefTimerValue() API Service ID. More...
 
#define GPT_SID_GET_GETHWUNITOBJ   (0x0EU)
 GPT Get Hw Unit Obj API Service ID. More...
 
#define GPT_SID_REGISTER_READBACK   (0x0FU)
 GPT Critical register read back API Service ID. More...
 

Macro Definition Documentation

◆ GPT_SW_MAJOR_VERSION

#define GPT_SW_MAJOR_VERSION   (1U)

Driver Implementation Major Version.

◆ GPT_SW_MINOR_VERSION

#define GPT_SW_MINOR_VERSION   (3U)

Driver Implementation Minor Version.

◆ GPT_SW_PATCH_VERSION

#define GPT_SW_PATCH_VERSION   (4U)

Driver Implementation Patch Version.

◆ GPT_AR_RELEASE_MAJOR_VERSION

#define GPT_AR_RELEASE_MAJOR_VERSION   (4U)

AUTOSAR Major version specification implemented by GPT Driver.

◆ GPT_AR_RELEASE_MINOR_VERSION

#define GPT_AR_RELEASE_MINOR_VERSION   (3U)

AUTOSAR Minor version specification implemented by GPT Driver.

◆ GPT_AR_RELEASE_REVISION_VERSION

#define GPT_AR_RELEASE_REVISION_VERSION   (1U)

AUTOSAR Patch version specification implemented by GPT Driver.

◆ GPT_VENDOR_ID

#define GPT_VENDOR_ID   ((uint16) 44U)

Texas Instruments Vendor ID.

◆ GPT_MODULE_ID

#define GPT_MODULE_ID   ((uint16) 100U)

GPT Driver Module ID.

◆ GPT_INSTANCE_ID

#define GPT_INSTANCE_ID   ((uint8) 0U)

GPT Driver Instance ID.

◆ GPT_CH_ISR_MODE_CONTINUOUS

#define GPT_CH_ISR_MODE_CONTINUOUS   (0U)

GPT continuous mode index.

◆ GPT_CH_ISR_MODE_ONESHOT

#define GPT_CH_ISR_MODE_ONESHOT   (1U)

GPT oneshot mode index.

◆ GPT_CH_ISR_MODE_CONT_WAKEUP

#define GPT_CH_ISR_MODE_CONT_WAKEUP   (2U)

GPT continuous wakeup mode index.

◆ GPT_CH_ISR_MODE_ONESHOT_WAKEUP

#define GPT_CH_ISR_MODE_ONESHOT_WAKEUP   (3U)

GPT oneshot wakeup mode index.

◆ GPT_CH_GPTIMER_MAX

#define GPT_CH_GPTIMER_MAX   (30U)

maximum GP timer channels available

◆ GPT_CH_GPTIMER1

#define GPT_CH_GPTIMER1   (0U)

GP timer 1 instance.

◆ GPT_CH_GPTIMER2

#define GPT_CH_GPTIMER2   (1U)

GP timer 2 instance.

◆ GPT_CH_GPTIMER3

#define GPT_CH_GPTIMER3   (2U)

GP timer 3 instance.

◆ GPT_CH_GPTIMER4

#define GPT_CH_GPTIMER4   (3U)

GP timer 4 instance.

◆ GPT_CH_GPTIMER5

#define GPT_CH_GPTIMER5   (4U)

GP timer 5 instance.

◆ GPT_CH_GPTIMER6

#define GPT_CH_GPTIMER6   (5U)

GP timer 6 instance.

◆ GPT_CH_GPTIMER7

#define GPT_CH_GPTIMER7   (6U)

GP timer 7 instance.

◆ GPT_CH_GPTIMER8

#define GPT_CH_GPTIMER8   (7U)

GP timer 8 instance.

◆ GPT_CH_GPTIMER9

#define GPT_CH_GPTIMER9   (8U)

GP timer 9 instance.

◆ GPT_CH_GPTIMER10

#define GPT_CH_GPTIMER10   (9U)

GP timer 10 instance.

◆ GPT_CH_GPTIMER11

#define GPT_CH_GPTIMER11   (10U)

GP timer 11 instance.

◆ GPT_CH_GPTIMER12

#define GPT_CH_GPTIMER12   (11U)

GP timer 12 instance.

◆ GPT_CH_GPTIMER13

#define GPT_CH_GPTIMER13   (12U)

GP timer 13 instance.

◆ GPT_CH_GPTIMER14

#define GPT_CH_GPTIMER14   (13U)

GP timer 14 instance.

◆ GPT_CH_GPTIMER15

#define GPT_CH_GPTIMER15   (14U)

GP timer 15 instance.

◆ GPT_CH_GPTIMER16

#define GPT_CH_GPTIMER16   (15U)

GP timer 16 instance.

◆ GPT_CH_GPTIMER17

#define GPT_CH_GPTIMER17   (16U)

GP timer 17 instance.

◆ GPT_CH_GPTIMER18

#define GPT_CH_GPTIMER18   (17U)

GP timer 18 instance.

◆ GPT_CH_GPTIMER19

#define GPT_CH_GPTIMER19   (18U)

GP timer 19 instance.

◆ GPT_CH_GPTIMER20

#define GPT_CH_GPTIMER20   (19U)

GP timer 20 instance.

◆ GPT_CH_GPTIMER21

#define GPT_CH_GPTIMER21   (20U)

GP timer 21 instance.

◆ GPT_CH_GPTIMER22

#define GPT_CH_GPTIMER22   (21U)

GP timer 22 instance.

◆ GPT_CH_GPTIMER23

#define GPT_CH_GPTIMER23   (22U)

GP timer 23 instance.

◆ GPT_CH_GPTIMER24

#define GPT_CH_GPTIMER24   (23U)

GP timer 24 instance.

◆ GPT_CH_GPTIMER25

#define GPT_CH_GPTIMER25   (24U)

GP timer 25 instance.

◆ GPT_CH_GPTIMER26

#define GPT_CH_GPTIMER26   (25U)

GP timer 26 instance.

◆ GPT_CH_GPTIMER27

#define GPT_CH_GPTIMER27   (26U)

GP timer 27 instance.

◆ GPT_CH_GPTIMER28

#define GPT_CH_GPTIMER28   (27U)

GP timer 28 instance.

◆ GPT_CH_GPTIMER29

#define GPT_CH_GPTIMER29   (28U)

GP timer 29 instance.

◆ GPT_CH_GPTIMER30

#define GPT_CH_GPTIMER30   (29U)

GP timer 30 instance.

◆ GPT_E_UNINIT

#define GPT_E_UNINIT   (0x0AU)

API service used without module initialization.

◆ GPT_E_BUSY

#define GPT_E_BUSY   (0x0BU)

API service called during ongoing process (Timer is already running)

◆ GPT_E_MODE

#define GPT_E_MODE   (0x0CU)

API service called when driver is in wrong mode. Used primarily when PreDef Timers are used. Since PreDef Timer are not supported in this implementation, this error code is not used.

◆ GPT_E_ALREADY_INITIALIZED

#define GPT_E_ALREADY_INITIALIZED   (0x0DU)

API Gpt_Init is called but the module is already initialized.

◆ GPT_E_INIT_FAILED

#define GPT_E_INIT_FAILED   (0x0EU)

API Gpt_Init is called but the module is already initialized.

◆ GPT_E_PARAM_CHANNEL

#define GPT_E_PARAM_CHANNEL   (0x14U)

API called with invalid channel.

◆ GPT_E_PARAM_VALUE

#define GPT_E_PARAM_VALUE   (0x15U)

API service called with invalid start timer parameter.

◆ GPT_E_PARAM_POINTER

#define GPT_E_PARAM_POINTER   (0x16U)

API service called with invalid(Null_Ptr) data buffer pointer.

◆ GPT_E_PARAM_PREDEF_TIMER

#define GPT_E_PARAM_PREDEF_TIMER   (0x17U)

API service called with invalid Predef Timer. Not supported in this implementation.

◆ GPT_E_PARAM_MODE

#define GPT_E_PARAM_MODE   (0x1FU)

Gpt_SetMode is called with wrong mode parameter.

◆ GPT_E_INVALID_ISR

#define GPT_E_INVALID_ISR   (0x80U)

Invalid entry to ISR.

◆ GPT_SID_GET_VERSION_INFO

#define GPT_SID_GET_VERSION_INFO   (0x00U)

Gpt_GetVersionInfo() API Service ID.

◆ GPT_SID_INIT

#define GPT_SID_INIT   (0x01U)

Gpt_Init() API Service ID.

◆ GPT_SID_DEINIT

#define GPT_SID_DEINIT   (0x02U)

Gpt_DeInit() API Service ID.

◆ GPT_SID_GET_TIME_ELAPSED

#define GPT_SID_GET_TIME_ELAPSED   (0x03U)

Gpt_GetTimeElapsed() API Service ID.

◆ GPT_SID_GET_TIME_REMAINING

#define GPT_SID_GET_TIME_REMAINING   (0x04U)

Gpt_GetTimeRemaining() API Service ID.

◆ GPT_SID_START_TIMER

#define GPT_SID_START_TIMER   (0x05U)

Gpt_StartTimer() API Service ID.

◆ GPT_SID_STOP_TIMER

#define GPT_SID_STOP_TIMER   (0x06U)

Gpt_StopTimer() API Service ID.

◆ GPT_SID_ENABLE_NOTIFY

#define GPT_SID_ENABLE_NOTIFY   (0x07U)

Gpt_EnableNotification() API Service ID.

◆ GPT_SID_DISABLE_NOTIFY

#define GPT_SID_DISABLE_NOTIFY   (0x08U)

Gpt_DisableNotification() API Service ID.

◆ GPT_SID_SET_MODE

#define GPT_SID_SET_MODE   (0x09U)

Gpt_SetMode() API Service ID.

◆ GPT_SID_DISABLE_WAKEUP

#define GPT_SID_DISABLE_WAKEUP   (0x0AU)

Gpt_DisableWakeup() API Service ID.

◆ GPT_SID_ENABLE_WAKEUP

#define GPT_SID_ENABLE_WAKEUP   (0x0BU)

Gpt_EnableWakeup() API Service ID.

◆ GPT_SID_CHECK_WAKEUP

#define GPT_SID_CHECK_WAKEUP   (0x0CU)

Gpt_CheckWakeup() API Service ID.

◆ GPT_SID_GET_PREDEFTIMERVALUE

#define GPT_SID_GET_PREDEFTIMERVALUE   (0x0DU)

Gpt_GetPredefTimerValue() API Service ID.

◆ GPT_SID_GET_GETHWUNITOBJ

#define GPT_SID_GET_GETHWUNITOBJ   (0x0EU)

GPT Get Hw Unit Obj API Service ID.

◆ GPT_SID_REGISTER_READBACK

#define GPT_SID_REGISTER_READBACK   (0x0FU)

GPT Critical register read back API Service ID.

Function Documentation

◆ Gpt_GetVersionInfo()

void Gpt_GetVersionInfo ( Std_VersionInfoType *  VersionInfoPtr)

This service returns the version information of this module.

*  Service name        : Gpt_GetVersionInfo
*  Syntax              : void Gpt_GetVersionInfo(Std_VersionInfoType*
*                                                          VersionInfoPtr)
*  Mode                : User Mode (Non-Privileged Mode)
*  Service ID[hex]     : 0x00
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant
*  Parameters (in)     : None
*  Parameters (inout)  : None
*  Parameters (out)    : VersionInfoPtr - Pointer to where to store the version
*                        information of this module
*  Return value        : None
*  Description         : Returns the version information of this module
*  

◆ Gpt_Init()

void Gpt_Init ( const Gpt_ConfigType CfgPtr)

This service initializes all the configured Gpt channels. This will set the state of the each channel to"initialized", also set the Gpt driver state to "Normal".

*  Service name        : Gpt_Init
*  Syntax              : void Gpt_Init(const Gpt_ConfigType* CfgPtr)
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x01
*  Sync/Async          : Synchronous
*  Reentrancy          : Non Reentrant
*  Parameters (in)     : Gpt_ConfigType* CfgPtr - configuration structure
*                        for initializing the module.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Initializes the GPT driver.
*  

◆ Gpt_DeInit()

void Gpt_DeInit ( void  )

This service deinitializes the RTI used by Gpt driver to the power on reset state. The Gpt driver state is changed to "Uninitialized" state". All the channel registers are cleared to stop the timer channels. API will disable all interrupt notifications, wakeup interrupts.

*  Service name        : Gpt_DeInit
*  Syntax              : void Gpt_DeInit(void)
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x02
*  Sync/Async          : Synchronous
*  Reentrancy          : Non Reentrant
*  Parameters (in)     : None
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Deinitializes the GPT driver.
*  

◆ Gpt_GetTimeElapsed()

Gpt_ValueType Gpt_GetTimeElapsed ( Gpt_ChannelType  Channel)

Gpt_GetTimeElapsed will return the time elapsed for channel which is referenced. The user can configure the channel in two modes, One-shot and Continuous mode. In one shot mode, if the timer is in stopped state, the function will return time value at the moment of stopping. If the timer is expired, the function will return the target time configured for the channel. In Continuous Mode - The elapsed time value will be the value relative to last occurrence.

*  Service name        : Gpt_GetTimeElapsed
*  Syntax              : Gpt_ValueType Gpt_GetTimeElapsed(Gpt_ChannelType
*                                                                      Channel)
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x03
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant
*  Parameters (in)     : Channel - ChannelId of the Gpt channel.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : Gpt_ValueType Elapsed timer value (in number of ticks)
*  Description         : Returns the time already elapsed.
*  

◆ Gpt_GetTimeRemaining()

Gpt_ValueType Gpt_GetTimeRemaining ( Gpt_ChannelType  Channel)

Gpt_GetTimeRemaining will return the timer value remaining until the target time will be reached next time. The remaining time is target time minus time already elapsed. In one shot mode, if the timer is in stopped state, the function will return remaining time value at the moment of stopping. If the timer is expired, the function will return 0.

*  Service name        : Gpt_GetTimeRemaining
*  Syntax              : Gpt_ValueType Gpt_GetTimeRemaining(Gpt_ChannelType
*                                                                      Channel)
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x04
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant
*  Parameters (in)     : Channel - ChannelId of the Gpt channel.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : Gpt_ValueType Remaining timer value (in number o
*                        ticks)
*  Description         : Returns the time remaining until the target time is
*                        reached.
*  

◆ Gpt_StartTimer()

void Gpt_StartTimer ( Gpt_ChannelType  Channel,
Gpt_ValueType  Value 
)

Gpt_StartTimer will start the selected timer channel with defined target time. If the timer channel is enabled for interrupt notification, then interrupt notification will be triggered after expiration of the selected timer channel. In one shot mode, if the timer is expired then the channel will be stopped in interrupt subroutine. The selected channel will be moved to "Running" state after calling this function.

*  Service name        : Gpt_StartTimer
*  Syntax              : void Gpt_StartTimer(Gpt_ChannelType Channel,
*                                            Gpt_ValueType Value)
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x05
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant
*  Parameters (in)     : Channel - ChannelId of the Gpt channel.
*                        value - Target time in number of ticks.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Starts a timer channel.
*  

◆ Gpt_StopTimer()

void Gpt_StopTimer ( Gpt_ChannelType  Channel)

Gpt_StopTimer will stop the selected timer channel.This will clear all the registers corresponding to the selected channel. The state of the timer channel will be changed to "Stopped".If the channel is in state "Initialized","Expired","Stopped" before calling this function, the function will be left without any action.

*  Service name        : Gpt_StopTimer
*  Syntax              : void Gpt_StopTimer( Gpt_ChannelType Channel )
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x06
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant (but not for the same timer channel)
*  Parameters (in)     : Channel: Numeric identifier of the GPT channel.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Stops a timer channel.
*  

◆ Gpt_EnableNotification()

void Gpt_EnableNotification ( Gpt_ChannelType  Channel)

Gpt_EnableNotification will enable the interrupt notification for the selected channel. The SETINT bit in RTI Set interrupt register will be Set to enable the Compare interrupt. The interrupt is triggered when Free running counter value matches with compare register value.

*  Service name        : Gpt_EnableNotification
*  Syntax              : void Gpt_EnableNotification( Gpt_ChannelType Channel)
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x07
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant (but not for the same timer channel)
*  Parameters (in)     : Channel: Numeric identifier of the GPT channel.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Enables the interrupt notification for a channel
*                        relevant in normal mode).
*  

◆ Gpt_DisableNotification()

void Gpt_DisableNotification ( Gpt_ChannelType  Channel)

Gpt_DisableNotification will disable the compare interrupt notification for the selected channel. The SETINT bit in RTI Set interrupt register will be cleared to disable the Compare interrupt. The interrupt is triggered when Free running counter value matches with compare register value.

*  Service name        : Gpt_DisableNotification
*  Syntax              : void Gpt_DisableNotification( Gpt_ChannelType Channel)
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x08
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant (but not for the same timer channel)
*  Parameters (in)     : Channel: Numeric identifier of the GPT channel.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Disables the interrupt notification for a channel
*                        relevant in normal mode).
*  

◆ Gpt_SetMode()

void Gpt_SetMode ( Gpt_ModeType  Mode)

Gpt_SetMode will set the operation mode of the Gpt driver to the given set mode parameter. If the parameter mode = Normal, then the function will enable the interrupt notifications for all the channels which are configured for notification and notification is enabled. If the Mode = Sleep, the function will enable the wakeup interrupts for all channels which are configured for wakeup and disable all other channels. All the timer channels which are running will be stopped in this mode.

*  Service name        : Gpt_SetMode
*  Syntax              : void Gpt_SetMode( Gpt_ModeType Mode )
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x09
*  Sync/Async          : Synchronous
*  Reentrancy          : Non Reentrant
*  Parameters (in)     : Mode GPT_MODE_NORMAL: Normal operation mode of the GPT
* driver.
*                             GPT_MODE_SLEEP: Sleep mode of the GPT driver
* (wakeup capable).
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Sets the operation mode of the GPT.
*  

◆ Gpt_DisableWakeup()

void Gpt_DisableWakeup ( Gpt_ChannelType  Channel)

Gpt_DisableWakeup will disable the wakeup interrupt of the referenced channel. The function will save the attribute "wakeup disable" of the channel.

*  Service name        : Gpt_DisableWakeup
*  Syntax              : void Gpt_DisableWakeup( Gpt_ChannelType Channel )
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x0A
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant (but not for the same timer channel)
*  Parameters (in)     : Channel - Numeric identifier of the GPT channel.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Disables the wakeup interrupt of a channel (relevant
*                        in sleep mode).
*  

◆ Gpt_EnableWakeup()

void Gpt_EnableWakeup ( Gpt_ChannelType  Channel)

Gpt_EnableWakeup will enable the wakeup interrupt of the referenced channel. The function will save the attribute "wakeup enable" of the channel which only affects the wakeup interrupt when the driver is in Sleep mode.

*  Service name        : Gpt_EnableWakeup
*  Syntax              : void Gpt_EnableWakeup( Gpt_ChannelType Channel )
*  Mode                : Supervisor Mode (Privileged Mode)
*  Service ID[hex]     : 0x0B
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant (but not for the same timer channel)
*  Parameters (in)     : Channel - Numeric identifier of the GPT channel.
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Enables the wakeup interrupt of a channel (relevant in
*                        sleep mode).
*  

◆ Gpt_CheckWakeup()

void Gpt_CheckWakeup ( EcuM_WakeupSourceType  WakeupSource)

Gpt_CheckWakeup will check if wakeup capable timer channel is source for a wakeup event and call EcuM_SetWakeupEvent to indicate the valid timer wakeup event to the EcuM.

*  Service name        : Gpt_CheckWakeup
*  Syntax              : void Gpt_CheckWakeup
*                                  ( EcuM_WakeupSourceType wakeupSource )
*  Mode                : User Mode (Non-Privileged Mode)
*  Service ID[hex]     : 0x0C
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant.
*  Parameters (in)     : WakeupSource -  Information on wakeup source to be
*                        checked. The associated GPT channel can be determined
*                        from configuration data
*  Parameters (inout)  : None
*  Parameters (out)    : None
*  Return value        : None
*  Description         : Checks if a wakeup capable GPT channel is the source
*                        for a wakeup event and calls the ECU state manager
*                        service EcuM_SetWakeupEvent in case of a valid GPT
*                        channel wakeup event.
*  

◆ Gpt_RegisterReadback()

Std_ReturnType Gpt_RegisterReadback ( Gpt_ChannelType  GptChannel,
Gpt_RegisterReadbackType RegRbPtr 
)

This function reads the important registers of the hardware unit and returns the value in the structure.

This API should be called after Gpt_Init is called. Otherwise this API will return E_NOT_OK.

This API could be used to readback the register contents after Gpt_Init and then the readback value could be compared during GPT execution to check the correctness of the HW unit. Since this API is used for this purpose, the register returned are the ones which doesn't change after init based on conv or channel config.

*  Service name        : Gpt_RegisterReadback
*  Mode                : Supervisor Mode (Privileged Mode)
*  Sync/Async          : Synchronous
*  Reentrancy          : Reentrant
*  Parameters (in)     : GptChannel - Numeric identifier of the GPT channel.
*                        If this is invalid, then the API will
*                        return E_NOT_OK.
*  Parameters (inout)  : RegRbPtr - Pointer to where to store the readback
*                        values. If this pointer is NULL_PTR, then the API
*                        will return E_NOT_OK.
*  Return value        : Std_ReturnType
*                        E_OK: Register read back has been done
*                        E_NOT_OK: Register read back failed
*