MCUSW
|
This file contains interface header for GPT MCAL driver.
Go to the source code of this file.
Data Structures | |
struct | Gpt_ChannelConfigType |
Configuration per channel. More... | |
struct | Gpt_ChannelConfigType_PC |
SPI sequence config structure parameters Pre-Compile only. More... | |
struct | Gpt_ConfigType |
global configuration of the driver More... | |
struct | Gpt_RegisterReadbackType |
GPT register readback 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... | |
GPT Driver Module SW Version Info | |
Defines for GPT Driver version used for compatibility checks | |
#define | GPT_SW_MAJOR_VERSION (9U) |
Driver Implementation Major Version. More... | |
#define | GPT_SW_MINOR_VERSION (0U) |
Driver Implementation Minor Version. More... | |
#define | GPT_SW_PATCH_VERSION (1U) |
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... | |
Typedefs | |
typedef uint32 | Gpt_ChannelType |
Type describing the Gpt channel. More... | |
typedef uint32 | Gpt_ValueType |
Type describing the timeout value. More... | |
typedef void(* | Gpt_NotifyType) (void) |
Notification callback function pointer. More... | |
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... | |
Std_ReturnType | Gpt_GetPredefTimerValue (Gpt_PredefTimerType PredefTimer, uint32 *TimeValuePtr) |