MCUSW
GPT Configuration

Introduction

This files defines GPT MCAL configuration structures

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...
 

Variables

const struct Gpt_ConfigType_s GptChannelConfiguration
 GPT Configuration. More...
 
const struct Gpt_ChannelConfigType_PC_s Gpt_ChannelConfig_PC [GPT_MAX_CHANNELS]
 GPT PC Configuration struct declaration. 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...
 

Enumerations

enum  Gpt_ModeType { GPT_MODE_NORMAL = 0U, GPT_MODE_SLEEP = 1U, GPT_MODE_INVALID = 0xFFU }
 List of process modes. More...
 
enum  Gpt_PrescaleValueType {
  GPT_PRESCALER_CLK_DIV_BY_2 = 0x0U, GPT_PRESCALER_CLK_DIV_BY_4 = 0x1U, GPT_PRESCALER_CLK_DIV_BY_8 = 0x2U, GPT_PRESCALER_CLK_DIV_BY_16 = 0x3U,
  GPT_PRESCALER_CLK_DIV_BY_32 = 0x4U, GPT_PRESCALER_CLK_DIV_BY_64 = 0x5U, GPT_PRESCALER_CLK_DIV_BY_128 = 0x6U, GPT_PRESCALER_CLK_DIV_BY_256 = 0x7U,
  GPT_PRESCALER_NO_PRESCALE = 0xFFU
}
 List of Prescale values for General purpose timer channels The timer counter is prescaled with the value 2^(PTV+1). Example: PTV = 3, counter increases value (if started) after 16 functional clock periods Note: Not applicable to GPT Predef timers. More...
 
enum  Gpt_ChannelMode { GPT_CH_MODE_CONTINUOUS = 0U, GPT_CH_MODE_ONESHOT }
 GPT channel mode macros. More...
 
enum  Gpt_ChannelStateType {
  GPT_UNINITIALIZED = 0U, GPT_INITIALIZED, GPT_RUNNING, GPT_STOPPED,
  GPT_EXPIRED
}
 GPT channel state GPT will be in one of this state during its lifetime. More...
 

Macros

#define GPT_PRE_COMPILE_VARIANT   (STD_OFF)
 GPT Pre-Compile Build Variant flag. STD_ON for VariantPreCompile / STD_OFF for VariantPostBuild. More...
 
#define GPT_DEV_ERROR_DETECT   (STD_ON)
 Enable/disable GPT dev detect error. More...
 
#define GPT_ISR_TYPE   (GPT_ISR_CAT1)
 ISR type. More...
 
#define GPT_REPORT_WAKEUP_SOURCE   (STD_ON)
 Enable/disable wakeup source in wakeup related APIs. More...
 
#define GPT_MAX_CHANNELS   (5U)
 No. of channels configured for GPT driver. More...
 
#define GPT_PREDEF_TIMER_TYPE   (GPT_PREDEF_TIMER_DISABLED)
 Macro for enabling predefined timers This is in case to disable GPT Predef Timers if timers can not be supported by hardware reasons. More...
 
#define GPT_PREDEF_TIMER_1US_ENABLING_GRADE   (GPT_PREDEF_TIMER_1US_DISABLED)
 : Specifies the grade of enabling the GPT Predef Timers with 1us tick duration More...
 
#define GPT_OS_COUNTER_ID   ((CounterType)OsCounter_0)
 Counter ID for counter used to count wait ticks. More...
 
#define GPT_TIMEOUT_DURATION   (32000U)
 ETH timeout. Each tick is 31.25us (for 32K Counter). Wait for 5s which comes to below value. More...
 
#define GPT_REGISTER_READBACK_API   (STD_ON)
 Enable/disable GPT register read back API. More...
 
#define GptConf_GptChannelConfiguration_TIMER1   (11U)
 Channel ID Configured channel ID(s) More...
 
#define GptConf_GptChannelConfiguration_MCU_TIMER6   (6U)
 
#define GptConf_GptChannelConfiguration_MCU_TIMER9   (9U)
 
#define GptConf_GptChannelConfiguration_TIMER5   (15U)
 
#define GptConf_GptChannelConfiguration_TIMER19   (29U)
 

Pre-Compile Switches for API Services

#define GPT_VERSION_INFO_API   (STD_ON)
 Enable/disable GPT get version info API. More...
 
#define GPT_DEINIT_API   (STD_ON)
 Enable/disable GPT deinit API. More...
 
#define GPT_TIME_ELAPSED_API   (STD_ON)
 Enable/disable GPT get time elapsed API. More...
 
#define GPT_TIME_REMAINING_API   (STD_ON)
 Enable/disable GPT time remaining API. More...
 
#define GPT_ENABLE_DISABLE_NOTIFICATION_API   (STD_ON)
 Enable/disable GPT enable/disable GPT API. More...
 
#define GPT_WAKEUP_FUNCTIONALITY_API   (STD_ON)
 Enable/disable GPT wakeup functionality API. More...
 

GPT DEM Error codes to report

Pre-compile switches for enabling/disabling DEM events

#define DemConf_DemEventParameter_GPT_DEM_NO_EVENT   (0xFFFFU)
 
#define GPT_DEM_NO_EVENT   DemConf_DemEventParameter_GPT_DEM_NO_EVENT
 
#define GPT_E_HARDWARE_ERROR   (DemConf_DemEventParameter_GPT_E_HARDWARE_ERROR)
 Hardware failed. More...
 

Macro Definition Documentation

◆ GPT_PRE_COMPILE_VARIANT

#define GPT_PRE_COMPILE_VARIANT   (STD_OFF)

GPT Pre-Compile Build Variant flag. STD_ON for VariantPreCompile / STD_OFF for VariantPostBuild.

◆ GPT_DEV_ERROR_DETECT

#define GPT_DEV_ERROR_DETECT   (STD_ON)

Enable/disable GPT dev detect error.

◆ GPT_ISR_TYPE

#define GPT_ISR_TYPE   (GPT_ISR_CAT1)

ISR type.

◆ GPT_REPORT_WAKEUP_SOURCE

#define GPT_REPORT_WAKEUP_SOURCE   (STD_ON)

Enable/disable wakeup source in wakeup related APIs.

◆ GPT_VERSION_INFO_API

#define GPT_VERSION_INFO_API   (STD_ON)

Enable/disable GPT get version info API.

◆ GPT_DEINIT_API

#define GPT_DEINIT_API   (STD_ON)

Enable/disable GPT deinit API.

◆ GPT_TIME_ELAPSED_API

#define GPT_TIME_ELAPSED_API   (STD_ON)

Enable/disable GPT get time elapsed API.

◆ GPT_TIME_REMAINING_API

#define GPT_TIME_REMAINING_API   (STD_ON)

Enable/disable GPT time remaining API.

◆ GPT_ENABLE_DISABLE_NOTIFICATION_API

#define GPT_ENABLE_DISABLE_NOTIFICATION_API   (STD_ON)

Enable/disable GPT enable/disable GPT API.

◆ GPT_WAKEUP_FUNCTIONALITY_API

#define GPT_WAKEUP_FUNCTIONALITY_API   (STD_ON)

Enable/disable GPT wakeup functionality API.

◆ GPT_MAX_CHANNELS

#define GPT_MAX_CHANNELS   (5U)

No. of channels configured for GPT driver.

◆ GPT_PREDEF_TIMER_TYPE

#define GPT_PREDEF_TIMER_TYPE   (GPT_PREDEF_TIMER_DISABLED)

Macro for enabling predefined timers This is in case to disable GPT Predef Timers if timers can not be supported by hardware reasons.

◆ GPT_PREDEF_TIMER_1US_ENABLING_GRADE

#define GPT_PREDEF_TIMER_1US_ENABLING_GRADE   (GPT_PREDEF_TIMER_1US_DISABLED)

: Specifies the grade of enabling the GPT Predef Timers with 1us tick duration

◆ GPT_OS_COUNTER_ID

#define GPT_OS_COUNTER_ID   ((CounterType)OsCounter_0)

Counter ID for counter used to count wait ticks.

◆ GPT_TIMEOUT_DURATION

#define GPT_TIMEOUT_DURATION   (32000U)

ETH timeout. Each tick is 31.25us (for 32K Counter). Wait for 5s which comes to below value.

◆ DemConf_DemEventParameter_GPT_DEM_NO_EVENT

#define DemConf_DemEventParameter_GPT_DEM_NO_EVENT   (0xFFFFU)

◆ GPT_DEM_NO_EVENT

#define GPT_DEM_NO_EVENT   DemConf_DemEventParameter_GPT_DEM_NO_EVENT

◆ GPT_E_HARDWARE_ERROR

#define GPT_E_HARDWARE_ERROR   (DemConf_DemEventParameter_GPT_E_HARDWARE_ERROR)

Hardware failed.

◆ GPT_REGISTER_READBACK_API

#define GPT_REGISTER_READBACK_API   (STD_ON)

Enable/disable GPT register read back API.

◆ GptConf_GptChannelConfiguration_TIMER1

#define GptConf_GptChannelConfiguration_TIMER1   (11U)

Channel ID Configured channel ID(s)

Channel identifiers

◆ GptConf_GptChannelConfiguration_MCU_TIMER6

#define GptConf_GptChannelConfiguration_MCU_TIMER6   (6U)

Channel identifiers

◆ GptConf_GptChannelConfiguration_MCU_TIMER9

#define GptConf_GptChannelConfiguration_MCU_TIMER9   (9U)

Channel identifiers

◆ GptConf_GptChannelConfiguration_TIMER5

#define GptConf_GptChannelConfiguration_TIMER5   (15U)

Channel identifiers

◆ GptConf_GptChannelConfiguration_TIMER19

#define GptConf_GptChannelConfiguration_TIMER19   (29U)

Channel identifiers

Typedef Documentation

◆ Gpt_ChannelType

typedef uint32 Gpt_ChannelType

Type describing the Gpt channel.

◆ Gpt_ValueType

typedef uint32 Gpt_ValueType

Type describing the timeout value.

◆ Gpt_NotifyType

typedef void(* Gpt_NotifyType) (void)

Notification callback function pointer.

Enumeration Type Documentation

◆ Gpt_ModeType

List of process modes.

Enumerator
GPT_MODE_NORMAL 

Normal operation mode of the GPT

GPT_MODE_SLEEP 

Operation for reduced power operation mode. In sleep mode only wakeup capable channels are available.

GPT_MODE_INVALID 

Mode end marker

◆ Gpt_PrescaleValueType

List of Prescale values for General purpose timer channels The timer counter is prescaled with the value 2^(PTV+1). Example: PTV = 3, counter increases value (if started) after 16 functional clock periods Note: Not applicable to GPT Predef timers.

Enumerator
GPT_PRESCALER_CLK_DIV_BY_2 

Value used to divide timer clock by 2

GPT_PRESCALER_CLK_DIV_BY_4 

Value used to divide timer clock by 4

GPT_PRESCALER_CLK_DIV_BY_8 

Value used to divide timer clock by 8

GPT_PRESCALER_CLK_DIV_BY_16 

Value used to divide timer clock by 16

GPT_PRESCALER_CLK_DIV_BY_32 

Value used to divide timer clock by 32

GPT_PRESCALER_CLK_DIV_BY_64 

Value used to divide timer clock by 64

GPT_PRESCALER_CLK_DIV_BY_128 

Value used to divide timer clock by 128

GPT_PRESCALER_CLK_DIV_BY_256 

Value used to divide timer clock by 256

GPT_PRESCALER_NO_PRESCALE 

Prescale disabled

◆ Gpt_ChannelMode

GPT channel mode macros.

Enumerator
GPT_CH_MODE_CONTINUOUS 

GPT initialized

GPT_CH_MODE_ONESHOT 

Normal operation mode of the GPT

◆ Gpt_ChannelStateType

GPT channel state GPT will be in one of this state during its lifetime.

Enumerator
GPT_UNINITIALIZED 

GPT is uninitialized

GPT_INITIALIZED 

GPT is initialized

GPT_RUNNING 

GPT is running

GPT_STOPPED 

GPT is stopped

GPT_EXPIRED 

GPT is expired

Variable Documentation

◆ GptChannelConfiguration

const struct Gpt_ConfigType_s GptChannelConfiguration

GPT Configuration.

◆ Gpt_ChannelConfig_PC

const struct Gpt_ChannelConfigType_PC_s Gpt_ChannelConfig_PC[GPT_MAX_CHANNELS]

GPT PC Configuration struct declaration.