DEENESPTFRRUARHIKOZHNL

GPT Driver (Gpt)

ModulGpt (GPT Driver)
BSW-Modul-ID100
Standard-Header#include "Gpt.h"
SWS-SpezifikationAUTOSAR_CP_SWS_GPTDriver.pdf, AUTOSAR_SWS_GPTDriver.pdf, AUTOSAR_SWS_GPT_Driver.pdf
Umfang159 Records · 11 Snippets
ClusterMikrocontroller-Abstraktion (MCAL & I/O)

GPT Driver (Gpt)

AUTOSAR Classic Microcontroller Drivers-Modul GPT Driver (Gpt, Spezifikation: AUTOSAR_CP_SWS_GPTDriver.pdf, AUTOSAR_SWS_GPTDriver.pdf, AUTOSAR_SWS_GPT_Driver.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

函数 Gpt_Init [SWS_Gpt_00280] 📄 PDF

void Gpt_Init(const Gpt_ConfigType* ConfigPtr);

Initializes the GPT driver.

函数 Gpt_GetTimeElapsed [SWS_Gpt_00282] 📄 PDF

Gpt_ValueType Gpt_GetTimeElapsed(Gpt_ChannelType Channel);

Returns the time already elapsed.

函数 Gpt_GetTimeRemaining [SWS_Gpt_00283] 📄 PDF

Gpt_ValueType Gpt_GetTimeRemaining(Gpt_ChannelType Channel);

Returns the time remaining until the target time is reached.

函数 Gpt_StartTimer [SWS_Gpt_00284] 📄 PDF

void Gpt_StartTimer(Gpt_ChannelType Channel, Gpt_ValueType Value);

Starts a timer channel.

函数 Gpt_EnableNotification [SWS_Gpt_00286] 📄 PDF

void Gpt_EnableNotification(Gpt_ChannelType Channel);

Enables the interrupt notification for a channel (relevant in normal mode).

函数 Gpt_DisableNotification [SWS_Gpt_00287] 📄 PDF

void Gpt_DisableNotification(Gpt_ChannelType Channel);

Disables the interrupt notification for a channel (relevant in normal mode).

函数 Gpt_SetMode [SWS_Gpt_00288] 📄 PDF

void Gpt_SetMode(Gpt_ModeType Mode);

Sets the operation mode of the GPT.

函数 Gpt_DisableWakeup [SWS_Gpt_00289] 📄 PDF

void Gpt_DisableWakeup(Gpt_ChannelType Channel);

Disables the wakeup interrupt of a channel (relevant in sleep mode).

函数 Gpt_EnableWakeup [SWS_Gpt_00290] 📄 PDF

void Gpt_EnableWakeup(Gpt_ChannelType Channel);

Enables the wakeup interrupt of a channel (relevant in sleep mode).

函数 Gpt_CheckWakeup [SWS_Gpt_00328] 📄 PDF

void Gpt_CheckWakeup(EcuM_WakeupSourceType WakeupSource);

Checks if a wakeup capable GPT channel is the source for a wakeup event and calls the ECU state manager service Ecu M_ Set Wakeup Event in case of a valid GPT channel wakeup event.

类型 Gpt_ConfigType [SWS_Gpt_00357] 📄 PDF

This is the type of the data structure including the configuration set required for initializing the GPT timer unit.

requirement SWS_Gpt_00006 [SWS_Gpt_00006] 📄 PDF

The function Gpt_Init shall initialize the hardware timer module according to a configuration set referenced by ConfigPtr .

requirement SWS_Gpt_00008 [SWS_Gpt_00008] 📄 PDF

The function Gpt_DeInit shall deinitialize the hardware used by the GPT driver (de pending on configuration) to the power on reset state. Values of registers which are not writeable are excluded. It’s the responsibility of the hardware design that the state does not lead to undefined activities in the µC.

requirement SWS_Gpt_00010 [SWS_Gpt_00010] 📄 PDF

The function Gpt_GetTimeElapsed shall return the time already elapsed. When the channel is in mode “one - shot mode”, this is the value relative to the point in time, the channel has been started.

requirement SWS_Gpt_00013 [SWS_Gpt_00013] 📄 PDF

The function Gpt_StopTimer s hall stop the selected timer channel.

requirement SWS_Gpt_00014 [SWS_Gpt_00014] 📄 PDF

The function Gpt_EnableNotification shall enable the interrupt notification of the referenced channel configured for notification (see also SWS_Gpt_00233 ). The function shall save an att ribute like "notification enabled" of the channel.

requirement SWS_Gpt_00015 [SWS_Gpt_00015] 📄 PDF

The function Gpt_DisableNotification shall disable the interrupt notification of the referenced channel configured for notification (see also SWS_Gpt_00233 ). The function shall save an attribute like "notification disabled" of the channel.

requirement SWS_Gpt_00068 [SWS_Gpt_00068] 📄 PDF

The function Gpt_Init shall only initialize the configured resources. Resources that are not configured in the configuration file shall not be touched.

requirement SWS_Gpt_00083 [SWS_Gpt_00083] 📄 PDF

The f unction Gpt_GetTimeRemaining shall return the timer value remaining until the target time will be reached next time. The remaining time is the "target time" minus the time already elapsed.

requirement SWS_Gpt_00084 [SWS_Gpt_00084] 📄 PDF

If th e function Gpt_StartTimer is called on a channel in state "running", the function shall raise the runtime error GPT_E_BUSY .

requirement SWS_Gpt_00086 [SWS_Gpt_00086] 📄 PDF

The callback notifications Gpt_Notification_<channel> shall be configurable as pointers to user defined functions within the configuration structure.

requirement SWS_Gpt_00099 [SWS_Gpt_00099] 📄 PDF

If development error detection is enabled for GPT modul e : I f the function Gpt_StopTimer is called on a channel in state "initialized", "stopped" or "expired", the function shall not raise a development error.

requirement SWS_Gpt_00105 [SWS_Gpt_00105] 📄 PDF

The function Gpt_DeInit shall disable all interrupt notifications and wakeup interrupts, controlled by the GPT driver.

requirement SWS_Gpt_00107 [SWS_Gpt_00107] 📄 PDF

The function Gpt_Init shall disable a ll interrupt notifications, controlled by the GPT driver.

requirement SWS_Gpt_00113 [SWS_Gpt_00113] 📄 PDF

The function Gpt_GetTimeElapsed shall be fully reentrant, this means e ven for the same timer channel.

requirement SWS_Gpt_00114 [SWS_Gpt_00114] 📄 PDF

The function Gpt_GetTimeRemaining shall be fully reentrant, this means even for the same timer channel.

requirement SWS_Gpt_00115 [SWS_Gpt_00115] 📄 PDF

The function Gpt_StartTimer shall be reentrant, if the timer channels used in concurrent calls are different.

requirement SWS_Gpt_00116 [SWS_Gpt_00116] 📄 PDF

The function Gpt_StopTimer shall be reentrant, if the timer channels used in concurrent calls are different.

requirement SWS_Gpt_00117 [SWS_Gpt_00117] 📄 PDF

The function Gpt_EnableNotification shall be reentrant, if the timer channels used in concurrent calls are different.

requirement SWS_Gpt_00118 [SWS_Gpt_00118] 📄 PDF

The function Gpt_DisableNotification shall be reentrant, if the timer channels used in concurrent cal ls are different.

requirement SWS_Gpt_00127 [SWS_Gpt_00127] 📄 PDF

If supported by hardware, a timer channel shall be able to be configured as wakeup source of the ECU. If enabled, the wakeup occurs when the target time is reached (timer value = target time).

requirement SWS_Gpt_00151 [SWS_Gpt_00151] 📄 PDF

The function Gpt_SetMode shall set the operation mode of the GPT driver to the given mode parameter.

requirement SWS_Gpt_00152 [SWS_Gpt_00152] 📄 PDF

If the parameter Mode has the value GPT_MODE_NORMAL: The function Gpt_SetMode shall enable the interrupt notification for all channels which are configured for notificatio n and the notification is enabled (stored attribute) via the function Gpt_EnableNotification prior. All other interrupt notifications shall be disabled.

requirement SWS_Gpt_00153 [SWS_Gpt_00153] 📄 PDF

If the parameter Mode has the value GPT_MODE_SLEEP : The function Gp t_SetMode shall enable the wakeup interrupts for all channels which are configured for wakeup and the wakeup is enabled (stored attribute) via the function Gpt_EnableWakeup prior . All other wakeup interrupts shall be disabled.

requirement SWS_Gpt_00155 [SWS_Gpt_00155] 📄 PDF

The function Gpt_DisableWakeup shall be reentrant, if the timer channels used in concurrent calls are different.

requirement SWS_Gpt_00156 [SWS_Gpt_00156] 📄 PDF

The function Gpt_EnableWakeup shall be reentrant , if the timer channels used in concurrent calls are different.

requirement SWS_Gpt_00157 [SWS_Gpt_00157] 📄 PDF

The function Gpt_DisableWakeup is only feasible, if GptReportWakeupSource is statically configured avail able.

requirement SWS_Gpt_00158 [SWS_Gpt_00158] 📄 PDF

The function Gpt_EnableWakeup is only feasible, if GptReportWakeupSource is statically configured available.

requirement SWS_Gpt_00159 [SWS_Gpt_00159] 📄 PDF

The function Gpt_DisableWakeup shall disable the wakeup interrupt of the referenced channel configured for wakeup. The function shall save an attribute like "wakeup disabled" of the channel. Comment: This attribute affec ts the wakeup interrupt always when the driver is in "sleep mode". In "normal mode" the attribute has no influence.

requirement SWS_Gpt_00160 [SWS_Gpt_00160] 📄 PDF

The function Gpt_EnableWakeup shall ena ble the wakeup interrupt of the referenced channel configured for wakeup. The function shall save an attribute like "wakeup enabled" of the channel.

requirement SWS_Gpt_00162 [SWS_Gpt_00162] 📄 PDF

The function Gpt_DeInit shall influence only the peripherals, which are alloc ated by the static configuration.

requirement SWS_Gpt_00164 [SWS_Gpt_00164] 📄 PDF

If the function Gpt_SetMode is called with parameter Mode has the value GPT_MODE_SLEEP : All timer channels in state "running" which are not configured for wakeup or not enabled for wakeup interruption (stored attribute) via Gpt_EnableWakeup shall be stopped and t heir state shall be changed to " stopped".

requirement SWS_Gpt_00165 [SWS_Gpt_00165] 📄 PDF

If the parameter Mode has the value GPT_MODE_NORMAL , the function Gpt_SetMode shall not restart automatically the timer channels which have been stopped by entering the sleep m ode.

requirement SWS_Gpt_00185 [SWS_Gpt_00185] 📄 PDF

If a timer channel is configured in "one - shot mode": If the timer has reached the target time (timer value = target time), the timer shall stop automatically and maintain its timer val ue unchanged. The channel state shall change from "running" to "expired".

requirement SWS_Gpt_00186 [SWS_Gpt_00186] 📄 PDF

If a timer channel is configured in "continuous mode": If the timer has reache d the target time (timer value = target time), the timer shall continue running with the value "0" at next timer tick. So, the time interval of the recurrence is: target time + 1. This interval shall be independently of implementation, e.g. interrupt delay s.

requirement SWS_Gpt_00194 [SWS_Gpt_00194] 📄 PDF

The function Gpt_DeInit shall be pre compile time configurable On/Off by the configuration parameter: GptDeInitApi .

requirement SWS_Gpt_00195 [SWS_Gpt_00195] 📄 PDF

The function Gpt_GetTimeElapsed shall be pre compile time configurable On/Off by the configuration parameter: GptTimeElapsedApi .

requirement SWS_Gpt_00196 [SWS_Gpt_00196] 📄 PDF

The function Gpt_GetTimeRemaining shall be pre compile time configurable On/Off by th e configuration parameter: GptTimeRemainingApi .

requirement SWS_Gpt_00199 [SWS_Gpt_00199] 📄 PDF

The function Gpt_EnableNotification shall be pre compile time configurable On/Off by the configura tion parameter: GptEnableDisableNotificationApi .

requirement SWS_Gpt_00200 [SWS_Gpt_00200] 📄 PDF

The function Gpt_DisableNotification shall be pre compile time configurable On/Off by the configuration parameter: GptEnableDisableNotificationApi .

requirement SWS_Gpt_00201 [SWS_Gpt_00201] 📄 PDF

The function Gpt_SetMode shall be pre compile time configurable On/Off by the configur ation parameter: GptWakeupFunctionalityApi .

requirement SWS_Gpt_00202 [SWS_Gpt_00202] 📄 PDF

The function Gpt_DisableWakeup shall be pre compile time configurable On/Off by the confi guration parameter: GptWakeupFunctionalityApi .

requirement SWS_Gpt_00203 [SWS_Gpt_00203] 📄 PDF

The function Gpt_EnableWakeup shall be pre compile time configurable On/Off by the configuration parameter: GptWakeupFunctionalityApi .

requirement SWS_Gpt_00206 [SWS_Gpt_00206] 📄 PDF

The ISR´s, providing the timer events, shall be responsible for resetting the interrupt flags (if needed by hardware) and calling the according notification function.

requirement SWS_Gpt_00210 [SWS_Gpt_00210] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid ( not within the range specified by configuration) , the function Gpt_GetTimeElapsed shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00211 [SWS_Gpt_00211] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid ( not within the range specified by configuration), the function Gpt_GetTimeRemaining shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00212 [SWS_Gpt_00212] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) , the function Gpt_StartTimer shall raise the err or GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00213 [SWS_Gpt_00213] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) , the function Gpt_StopTimer shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00214 [SWS_Gpt_00214] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) , the function Gpt_EnableNotification shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00215 [SWS_Gpt_00215] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) or channel wakeup is not en abled by configuration (GptEnableWakeup), the function Gpt_DisableWakeup shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00216 [SWS_Gpt_00216] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) or channel wakeup is not enabled by configuration (GptEnableWakeup), the function Gpt_EnableWakeup shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00217 [SWS_Gpt_00217] 📄 PDF

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration), the function Gpt_DisableNotification shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00218 [SWS_Gpt_00218] 📄 PDF

If development error detection is enabled for GPT module : The function Gpt_StartTimer shall raise the error GPT_E_PARAM_VALUE if the parameter Value is " 0 " or not within the allowed range (exceeding the maxi mum timer resolution) .

requirement SWS_Gpt_00220 [SWS_Gpt_00220] 📄 PDF

If development er ror detection is enabled for the GPT module : I f the driver is not initialized, t he function Gpt_DeInit shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00222 [SWS_Gpt_00222] 📄 PDF

If development error detection is e nabled for GPT module : I f the driver is not initialized, the function Gpt_GetTimeElapsed shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00223 [SWS_Gpt_00223] 📄 PDF

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_GetTimeRemaining shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00224 [SWS_Gpt_00224] 📄 PDF

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_StartTimer shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00225 [SWS_Gpt_00225] 📄 PDF

If development err or detection is enabled for GPT module : If the driver is not initialized, the function Gpt_StopTimer shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00226 [SWS_Gpt_00226] 📄 PDF

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_EnableNotification shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00227 [SWS_Gpt_00227] 📄 PDF

If development error detectio n is enabled for GPT module : If the driver is not initialized, the function Gpt_DisableNotification shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00228 [SWS_Gpt_00228] 📄 PDF

If development error detection is enabled for GPT modul e : If the driver is not initialized, the function Gpt_SetMode shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00229 [SWS_Gpt_00229] 📄 PDF

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_Disabl eWakeup shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00230 [SWS_Gpt_00230] 📄 PDF

If development error detectio n is enabled for GPT module : If the driver is not initialized, the function Gpt_EnableWakeup shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00231 [SWS_Gpt_00231] 📄 PDF

If developm ent error detection is enabled for GPT modul e : The function Gpt_SetMode shall raise the error GPT_E_PARAM_MODE if the parameter Mode is invalid .

requirement SWS_Gpt_00233 [SWS_Gpt_00233] 📄 PDF

The GP T Driver shall invoke a notification whenever the defined target time of the channel is reached.

requirement SWS_Gpt_00234 [SWS_Gpt_00234] 📄 PDF

I f any timer channel is in state "running", t he function Gpt_DeInit shall raise the runtime error GPT_E_BUSY .

requirement SWS_Gpt_00255 [SWS_Gpt_00255] 📄 PDF

The function Gpt_SetMode is only available if t he configuration parameter GptReportWakeupSource is enabled.

requirement SWS_Gpt_00258 [SWS_Gpt_00258] 📄 PDF

The function Gpt_Init shall disable all wakeup interrupts, controlled by the GPT driver.

requirement SWS_Gpt_00261 [SWS_Gpt_00261] 📄 PDF

Gpt_Irq.c shall include Gpt.h for the prototype declaration of the notification functions.

requirement SWS_Gpt_00270 [SWS_Gpt_00270] 📄 PDF

Within one container it shall not be possible to mix parameters assigned to different configuration classes.

requirement SWS_Gpt_00274 [SWS_Gpt_00274] 📄 PDF

The function Gpt_StartTimer shall start the selected timer channel with a defined target time.

requirement SWS_Gpt_00275 [SWS_Gpt_00275] 📄 PDF

If configured and enabled, an interrupt notification or a wakeup interrupt occurs, when th e target time is reached .

requirement SWS_Gpt_00278 [SWS_Gpt_00278] 📄 PDF

Module Header File Imported Type Ecu M Ecu M.h Ecu M _ Wakeup Source Type Std Std_ Types.h Std _ Return Type Std_ Types.h Std _ Version Info Type

requirement SWS_Gpt_00295 [SWS_Gpt_00295] 📄 PDF

If the function Gpt_GetTimeElapsed is called on a timer channel in state "initialized" (channel started never before), the functio n shall return the value " 0 ".

requirement SWS_Gpt_00297 [SWS_Gpt_00297] 📄 PDF

If the function Gpt_GetTimeElapsed is called on a timer channel in state "stopped", the function shall return the time value at the moment of stopping.

requirement SWS_Gpt_00299 [SWS_Gpt_00299] 📄 PDF

If the function Gpt_GetTim eElapsed is called on a channel configured for "one - shot mode" in state "expired" (timer has reached the target time), the function shall return the target time .

requirement SWS_Gpt_00301 [SWS_Gpt_00301] 📄 PDF

If the function Gpt_GetTimeRema ining is called on a timer channel in state "initialized" (channel started never before), the function shall return the value " 0 ".

requirement SWS_Gpt_00303 [SWS_Gpt_00303] 📄 PDF

If the function Gpt_GetTimeRemaining is called on a timer channel in state "stopped", the function sh all return the remaining time value at the moment of stopping .

requirement SWS_Gpt_00305 [SWS_Gpt_00305] 📄 PDF

If the function Gpt_GetTimeRemaining is called on a channel configured for "one - shot mode" in state "expired" (timer has reached the target time), the function shall ret urn the value “ 0 ”.

requirement SWS_Gpt_00307 [SWS_Gpt_00307] 📄 PDF

If development error detection is enabled for the GPT module : If the GPT driver is not in operation mode "uninitialized", the function Gpt_Init shall raise the error GPT_E_ALREADY_INITIALIZED .

requirement SWS_Gpt_00308 [SWS_Gpt_00308] 📄 PDF

If a postbuild multiple selectable configuration variant was used, the function Gpt_DeInit shall further influence only the peripherals, which are allocated by the runtime configuration set passed by the previous call of the function Gpt_Init .

requirement SWS_Gpt_00309 [SWS_Gpt_00309] 📄 PDF

A re - initialization of the GPT driver by executing the Gpt_Init function requires a de - initialization before by executing a Gpt_DeInit .

requirement SWS_Gpt_00321 [SWS_Gpt_00321] 📄 PDF

The function Gpt_CheckWakeup shall check if a wakeup capable GPT channel is the source for a wakeup event and call EcuM_SetWakeupEvent to indicate a valid timer wakeup event to the ECU State Manager [8] .

requirement SWS_Gpt_00322 [SWS_Gpt_00322] 📄 PDF

The function Gpt_CheckWakeup is only feasible, if GptReportWakeupSource is statically configured available.

requirement SWS_Gpt_00323 [SWS_Gpt_00323] 📄 PDF

The function Gpt_CheckWakeup shall be reentrant, by reason of possible usage in concurren t interrupt service routines.

requirement SWS_Gpt_00324 [SWS_Gpt_00324] 📄 PDF

The function Gpt_CheckWakeup shall be pre compile time configurable On/Off by the configuration parameter: GptWakeupFunctionalityApi .

requirement SWS_Gpt_00325 [SWS_Gpt_00325] 📄 PDF

If development error detection is enabled f or GPT module : If the driver is not initialized, the function Gpt_CheckWakeup shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00326 [SWS_Gpt_00326] 📄 PDF

EcuM_CheckWakeup shall be called within the Interrupt Service Routi ne, servicing the GPT channel wakeup event on wakeup - capable channels.

requirement SWS_Gpt_00327 [SWS_Gpt_00327] 📄 PDF

The ISR´s, providing the wakeup events, shall be responsible for resetting the interrupt flags (if needed by hardware).

requirement SWS_Gpt_00330 [SWS_Gpt_00330] 📄 PDF

If a timer channel is configured in "continuous mode": If supported by hardware, it shall be possible to realize a free running timer. This means: A timer which rolls over automatically by hardware, if the target time is set to the max imum value the timer is able to count (max value = 2 n - 1, n=number of bits).

requirement SWS_Gpt_00331 [SWS_Gpt_00331] 📄 PDF

I f supported by hardware, a timer channel shall be able to be configure d to call a notification function. If enabled, the function is called when the target time is reached (timer value = target time) .

requirement SWS_Gpt_00332 [SWS_Gpt_00332] 📄 PDF

If the GptDevErrorDetect switch is enabled: When a development error occurs the corresponding GPT function shall skip the desired functionality (leave service without any action).

requirement SWS_Gpt_00338 [SWS_Gpt_00338] 📄 PDF

If development error detection is enabled for the GPT module: If the parameter VersionInfoPtr is a null pointer, the function Gpt_GetVersionInfo shall raise the error GPT_E_PARAM_POINTER .

requirement SWS_Gpt_00339 [SWS_Gpt_00339] 📄 PDF

The function Gpt_Init shall set the operation mode of the GPT driver to "normal mode". This leads to a behavior like Gpt_SetMode is called with parameter GPT_MODE_NORMAL .

requirement SWS_Gpt_00341 [SWS_Gpt_00341] 📄 PDF

If the parameter has the value GPT_MODE_SLEEP the function Gpt_SetMode shall not start a wakeup timer automatically. First, the user shall call Gpt_StartTimer to start a wakeup timer, after this the user shall call Gpt_SetMode with parameter GPT_MODE_SLEEP .

requirement SWS_Gpt_00343 [SWS_Gpt_00343] 📄 PDF

The state of the selected timer channel shall be changed to "stopped" if Gpt_StopTimer is called.

requirement SWS_Gpt_00344 [SWS_Gpt_00344] 📄 PDF

If the function Gpt_StopTimer is called on a channel in state "initialized", "stop ped" or "expired", the function shall leave without any action (no change of the channel state).

requirement SWS_Gpt_00352 [SWS_Gpt_00352] 📄 PDF

If the hardware allows for only one usage of the register, the driver module implementing that functionality is responsible for initializing the register.

requirement SWS_Gpt_00353 [SWS_Gpt_00353] 📄 PDF

If the register can affect several hardware modules and if it is an I/O register it shall be initialized by the PORT driver.

requirement SWS_Gpt_00354 [SWS_Gpt_00354] 📄 PDF

If the register can affect sever al hardware modules and if it is not an I/O register it shall be initialized by the MCU driver.

requirement SWS_Gpt_00355 [SWS_Gpt_00355] 📄 PDF

One - time writable registers that require initialization directly after reset shall be initialized by the startup code.

requirement SWS_Gpt_00361 [SWS_Gpt_00361] 📄 PDF

When the channel is in mode "continuous mode", the return value of Gpt_GetTimeElapsed is the value relative to the las t recurrence (target time reached) or to the start of the channel before the first recurrence occurs.

requirement SWS_Gpt_00362 [SWS_Gpt_00362] 📄 PDF

For all available channels, callback functions have to be declared by the configuration tool.

requirement SWS_Gpt_00363 [SWS_Gpt_00363] 📄 PDF

The functi on Gpt_DeInit shall set the operation mode of the GPT driver to "uninitialized".

requirement SWS_Gpt_00364 [SWS_Gpt_00364] 📄 PDF

The state of the selected timer channel shall be changed to "running" if Gpt_StartTimer is called.

requirement SWS_Gpt_00375 [SWS_Gpt_00375] 📄 PDF

Gpt.c shall include Det.h in any case to be able to raise runtime error.

requirement SWS_Gpt_00377 [SWS_Gpt_00377] 📄 PDF

If development error detection is enabled for GPT module : If no valid notification function is configured (GptNotification) , the function Gpt_EnableNotification shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00379 [SWS_Gpt_00379] 📄 PDF

If development error detection is enabled for GPT module : If no valid notification funct ion is configured (GptNotification), the function Gpt_DisableNotification shall raise the error GPT_E_PARAM_CHANNEL .

requirement SWS_Gpt_00380 [SWS_Gpt_00380] 📄 PDF

The standardized common published parameters as required by SRS_BSW_00402 in the SRS General on Basic Software Modules [3] shall be published within the header file of this module and need to be provided in the BSW Module De scription. The according module abbreviation can be found in the List of Basic Software Modules [1] .

requirement SWS_Gpt_00382 [SWS_Gpt_00382] 📄 PDF

A GPT Predef Timer is a free running up counter (user point of view). If the timer has reached the maximum value (max value = 2 n - 1, n=number of bits), the timer shall continue running with the value "0" at next timer tick .

requirement SWS_Gpt_00384 [SWS_Gpt_00384] 📄 PDF

A GPT Predef Timer shall have a maximum tick tolerance of +/ - 1 tick to ensure accuracy of time based function ality.

requirement SWS_Gpt_00385 [SWS_Gpt_00385] 📄 PDF

It shall be possible to configure which GPT Predef Timers are enabled.

requirement SWS_Gpt_00386 [SWS_Gpt_00386] 📄 PDF

If a GPT Predef Timer is enabled, the timer(s) with the same tick duration and lower bit number(s) shall be enabled also .

requirement SWS_Gpt_00390 [SWS_Gpt_00390] 📄 PDF

The function Gpt_Init shall start all enabled GPT Predef Timers at value “0”.

requirement SWS_Gpt_00391 [SWS_Gpt_00391] 📄 PDF

The function Gpt_DeInit shall stop all enabled GPT Predef Timers.

requirement SWS_Gpt_00392 [SWS_Gpt_00392] 📄 PDF

If the parameter Mode has the value GPT_MODE_NORMAL: If the driver is in “sleep mode”, the function Gpt_SetMode shall restart all enabled GPT Predef Timers at value “0” .

requirement SWS_Gpt_00393 [SWS_Gpt_00393] 📄 PDF

If the parameter Mode has the value GPT_MODE_SLEEP: The function Gpt_SetMode shall stop all enabled GPT Predef Timers.

requirement SWS_Gpt_00395 [SWS_Gpt_00395] 📄 PDF

The function Gpt_GetPredefTimerValue shall return the current value of the GPT Predef Timer pa ssed by PredefTimer .

requirement SWS_Gpt_00396 [SWS_Gpt_00396] 📄 PDF

If the timer value of the function Gpt_GetPredefTimerValue is less than 32 bit (16bit or 24bit timer), the upper bits shall be filled with zero.

requirement SWS_Gpt_00397 [SWS_Gpt_00397] 📄 PDF

The function Gpt_GetPredefTime rValue shall be fully reentrant, this means even for the same GPT Predef Timer.

requirement SWS_Gpt_00398 [SWS_Gpt_00398] 📄 PDF

If development error detection is enabled for GPT module : I f the driver is not initialized, the function Gpt_ GetPredefTimerValue shall raise the error GPT_E_UNINIT .

requirement SWS_Gpt_00399 [SWS_Gpt_00399] 📄 PDF

If development error detection is enabled for GPT module : If the parameter PredefTimer is invalid, the function Gpt_GetPredefTimerValu e shall raise the development error GPT_E_PARAM_PREDEF_TIMER .

requirement SWS_Gpt_00400 [SWS_Gpt_00400] 📄 PDF

If development error detection is enabled for GPT module : If the GPT Predef Timer passed by the parameter PredefTimer is not enabled, the function Gpt_GetPred efTimerValue shall raise the development error GPT_E_PARAM_PREDEF_TIMER .

requirement SWS_Gpt_00401 [SWS_Gpt_00401] 📄 PDF

If the driver is in "sleep mode", the function Gpt_ GetPredefTimerValue shall raise the runtime error GPT_E_MODE .

requirement SWS_Gpt_00402 [SWS_Gpt_00402] 📄 PDF

I f the GPT driver is not initialized, in “sleep mode” or the GPT Predef Timer is not enabled, the function Gpt_ GetPredefTimerValue shall ret urn E_NOT_OK .

requirement SWS_Gpt_00403 [SWS_Gpt_00403] 📄 PDF

If development error de tection is enabled for GPT module : If the parameter TimeValuePtr is a null pointer, the function Gpt_GetPredefTimerValue shall raise the error GPT_E_PARAM_POINTER .

requirement SWS_Gpt_00406 [SWS_Gpt_00406] 📄 PDF

Det_ReportError Det.h Service to report development errors. EcuM_CheckWakeup EcuM.h This function can be called to check the given wakeup sources. It will pass the argument to the integrator function EcuM_CheckWakeupHook. It can also be called by the ISR of a wakeup source to set up the PLL and check other wakeup sources that may be connected to the same interrupt. EcuM_SetWakeupEvent EcuM.h Sets the wakeup event. ⌋(SRS_SPAL_00157)

requirement SWS_Gpt_00407 [SWS_Gpt_00407] 📄 PDF

The G PT module shall reject configurations with partition mappings which are not supported by the implementation .

requirement SWS_Gpt_91000 [SWS_Gpt_91000] 📄 PDF

Type of error Related error code Error value API service called without module initialization GPT_ E_ UNINIT 0x0A API service for initialization called when already initialized GPT_ E_ ALREADY_ INITIALIZED 0x0D API error return code: Init function failed GPT_ E_ INIT_ FAILED 0x0E API parameter checking: invalid channel GPT_ E_ PARAM_ CHANNEL 0x14 API parameter checking: invalid value GPT_ E_ PARAM_ VALUE 0x15 API parameter checking: invalid pointer GPT_ E_ PARAM_ POINTER 0x16 API parameter checking: invalid Predef Timer GPT_ E_ PARAM_ PREDEF_ TIMER 0x17 API parameter checking: invalid mode GPT_ E_ PARAM_ MODE 0x1F

requirement SWS_Gpt_91001 [SWS_Gpt_91001] 📄 PDF

Type of error Related error code Error value API service called when timer channel is still busy (running) GPT_ E_ BUSY 0x0B API service called when driver is in wrong mode GPT_ E_ MODE 0x0C

requirement SWS_Gpt_CONSTR_00001 [SWS_Gpt_CONSTR_00001] 📄 PDF

The ECUC partitions referenced by GptKernelEcucPartitionRef shall be a subset of the ECUC partitions referenced by GptEcucPartitionRef.

requirement SWS_Gpt_CONSTR_00002 [SWS_Gpt_CONSTR_00002] 📄 PDF

The ECUC partitions referenced by GptGroupEcuc PartitionRef shall be a subset of the ECUC partitions referenced by GptEcucPartition Ref.

requirement SWS_Gpt_CONSTR_00003 [SWS_Gpt_CONSTR_00003] 📄 PDF

If GptEcucPartitionRef references one or more ECUC partitions, GptKernelEcucPartitionRef shall have a multiplicity of one and reference one of these ECUC partitions as well.

requirement SWS_Gpt_CONSTR_00004 [SWS_Gpt_CONSTR_00004] 📄 PDF

If GptEcucPartitionRef references one or more ECUC partitions, GptKernelEcucPartitionRef shal l have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

requirement SWS_Gpt_CONSTR_00005 [SWS_Gpt_CONSTR_00005] 📄 PDF

In case of partition local timer resources, the module will operate as an independent instance in each of the partitions, means the called API w ill only target the partition it is called in.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_Gpt
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Gpt@rel:R20-11#818b1b44
Content hash
818b1b44
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_GPTDriver.pdf#nameddest=SWS_Gpt_00279

主题图

需求

139
SWS_Gpt_00006SWS_Gpt_00008SWS_Gpt_00010SWS_Gpt_00013SWS_Gpt_00014SWS_Gpt_00015SWS_Gpt_00068SWS_Gpt_00083SWS_Gpt_00084SWS_Gpt_00086SWS_Gpt_00093SWS_Gpt_00099SWS_Gpt_00105SWS_Gpt_00107SWS_Gpt_00113SWS_Gpt_00114SWS_Gpt_00115SWS_Gpt_00116SWS_Gpt_00117SWS_Gpt_00118SWS_Gpt_00127SWS_Gpt_00151SWS_Gpt_00152SWS_Gpt_00153SWS_Gpt_00155SWS_Gpt_00156SWS_Gpt_00157SWS_Gpt_00158SWS_Gpt_00159SWS_Gpt_00160SWS_Gpt_00162SWS_Gpt_00164SWS_Gpt_00165SWS_Gpt_00185SWS_Gpt_00186SWS_Gpt_00194SWS_Gpt_00195SWS_Gpt_00196SWS_Gpt_00199SWS_Gpt_00200SWS_Gpt_00201SWS_Gpt_00202SWS_Gpt_00203SWS_Gpt_00206SWS_Gpt_00209SWS_Gpt_00210SWS_Gpt_00211SWS_Gpt_00212SWS_Gpt_00213SWS_Gpt_00214SWS_Gpt_00215SWS_Gpt_00216SWS_Gpt_00217SWS_Gpt_00218SWS_Gpt_00220SWS_Gpt_00222SWS_Gpt_00223SWS_Gpt_00224SWS_Gpt_00225SWS_Gpt_00226SWS_Gpt_00227SWS_Gpt_00228SWS_Gpt_00229SWS_Gpt_00230SWS_Gpt_00231SWS_Gpt_00233SWS_Gpt_00234SWS_Gpt_00255SWS_Gpt_00258SWS_Gpt_00261SWS_Gpt_00270SWS_Gpt_00274SWS_Gpt_00275SWS_Gpt_00278SWS_Gpt_00295SWS_Gpt_00297SWS_Gpt_00299SWS_Gpt_00301SWS_Gpt_00303SWS_Gpt_00305SWS_Gpt_00307SWS_Gpt_00308SWS_Gpt_00309SWS_Gpt_00321SWS_Gpt_00322SWS_Gpt_00323SWS_Gpt_00324SWS_Gpt_00325SWS_Gpt_00326SWS_Gpt_00327SWS_Gpt_00329SWS_Gpt_00330SWS_Gpt_00331SWS_Gpt_00332SWS_Gpt_00338SWS_Gpt_00339SWS_Gpt_00341SWS_Gpt_00343SWS_Gpt_00344SWS_Gpt_00352SWS_Gpt_00353SWS_Gpt_00354SWS_Gpt_00355SWS_Gpt_00356SWS_Gpt_00361SWS_Gpt_00362SWS_Gpt_00363SWS_Gpt_00364SWS_Gpt_00375SWS_Gpt_00377SWS_Gpt_00379SWS_Gpt_00380SWS_Gpt_00382SWS_Gpt_00384SWS_Gpt_00385SWS_Gpt_00386SWS_Gpt_00390SWS_Gpt_00391SWS_Gpt_00392SWS_Gpt_00393SWS_Gpt_00395SWS_Gpt_00396SWS_Gpt_00397SWS_Gpt_00398SWS_Gpt_00399SWS_Gpt_00400SWS_Gpt_00401SWS_Gpt_00402SWS_Gpt_00403SWS_Gpt_00405SWS_Gpt_00406SWS_Gpt_00407SWS_Gpt_91000SWS_Gpt_91001SWS_Gpt_CONSTR_00001SWS_Gpt_CONSTR_00002SWS_Gpt_CONSTR_00003SWS_Gpt_CONSTR_00004SWS_Gpt_CONSTR_00005

详细视图

请在大纲中选择一个条目。

初始化与状态

Gpt_DeInit 函数

Deinitializes the GPT driver.

void Gpt_DeInit(void);

Returns the version information of this module.

void Gpt_GetVersionInfo(Std_VersionInfoType* VersionInfoPtr);
Gpt_Init 函数

Initializes the GPT driver.

void Gpt_Init(const Gpt_ConfigType* ConfigPtr);

服务

Checks if a wakeup capable GPT channel is the source for a wakeup event and calls the ECU state manager service Ecu M_ Set Wakeup Event in case of a valid GPT channel wakeup event.

void Gpt_CheckWakeup(EcuM_WakeupSourceType WakeupSource);

Disables the interrupt notification for a channel (relevant in normal mode).

void Gpt_DisableNotification(Gpt_ChannelType Channel);

Disables the wakeup interrupt of a channel (relevant in sleep mode).

void Gpt_DisableWakeup(Gpt_ChannelType Channel);

Enables the interrupt notification for a channel (relevant in normal mode).

void Gpt_EnableNotification(Gpt_ChannelType Channel);

Enables the wakeup interrupt of a channel (relevant in sleep mode).

void Gpt_EnableWakeup(Gpt_ChannelType Channel);

Delivers the current value of the desired GPT Predef Timer.

Std_ReturnType Gpt_GetPredefTimerValue(Gpt_PredefTimerType PredefTimer, uint32* TimeValuePtr);

Returns the time already elapsed.

Gpt_ValueType Gpt_GetTimeElapsed(Gpt_ChannelType Channel);

Returns the time remaining until the target time is reached.

Gpt_ValueType Gpt_GetTimeRemaining(Gpt_ChannelType Channel);

-

void Gpt_Notification_<channel>(void);

Sets the operation mode of the GPT.

void Gpt_SetMode(Gpt_ModeType Mode);

Starts a timer channel.

void Gpt_StartTimer(Gpt_ChannelType Channel, Gpt_ValueType Value);

Stops a timer channel.

void Gpt_StopTimer(Gpt_ChannelType Channel);

类型

Numeric ID of a GPT channel.

This is the type of the data structure including the configuration set required for initializing the GPT timer unit.

Modes of the GPT driver.

Type for GPT Predef Timers

Type for reading and setting the timer values (in number of ticks).

需求

SWS_Gpt_00006 requirement

The function Gpt_Init shall initialize the hardware timer module according to a configuration set referenced by ConfigPtr .

SWS_Gpt_00008 requirement

The function Gpt_DeInit shall deinitialize the hardware used by the GPT driver (de pending on configuration) to the power on reset state. Values of registers which are not writeable are excluded. It’s the responsibility of the hardware design that the state does not lead to undefined activities in the µC.

SWS_Gpt_00010 requirement

The function Gpt_GetTimeElapsed shall return the time already elapsed. When the channel is in mode “one - shot mode”, this is the value relative to the point in time, the channel has been started.

SWS_Gpt_00013 requirement

The function Gpt_StopTimer s hall stop the selected timer channel.

SWS_Gpt_00014 requirement

The function Gpt_EnableNotification shall enable the interrupt notification of the referenced channel configured for notification (see also SWS_Gpt_00233 ). The function shall save an att ribute like "notification enabled" of the channel.

SWS_Gpt_00015 requirement

The function Gpt_DisableNotification shall disable the interrupt notification of the referenced channel configured for notification (see also SWS_Gpt_00233 ). The function shall save an attribute like "notification disabled" of the channel.

SWS_Gpt_00068 requirement

The function Gpt_Init shall only initialize the configured resources. Resources that are not configured in the configuration file shall not be touched.

SWS_Gpt_00083 requirement

The f unction Gpt_GetTimeRemaining shall return the timer value remaining until the target time will be reached next time. The remaining time is the "target time" minus the time already elapsed.

SWS_Gpt_00084 requirement

If th e function Gpt_StartTimer is called on a channel in state "running", the function shall raise the runtime error GPT_E_BUSY .

SWS_Gpt_00086 requirement

The callback notifications Gpt_Notification_<channel> shall be configurable as pointers to user defined functions within the configuration structure.

SWS_Gpt_00093 requirement

When disabled, the GPT Driver will send no notification.

SWS_Gpt_00099 requirement

If development error detection is enabled for GPT modul e : I f the function Gpt_StopTimer is called on a channel in state "initialized", "stopped" or "expired", the function shall not raise a development error.

SWS_Gpt_00105 requirement

The function Gpt_DeInit shall disable all interrupt notifications and wakeup interrupts, controlled by the GPT driver.

SWS_Gpt_00107 requirement

The function Gpt_Init shall disable a ll interrupt notifications, controlled by the GPT driver.

SWS_Gpt_00113 requirement

The function Gpt_GetTimeElapsed shall be fully reentrant, this means e ven for the same timer channel.

SWS_Gpt_00114 requirement

The function Gpt_GetTimeRemaining shall be fully reentrant, this means even for the same timer channel.

SWS_Gpt_00115 requirement

The function Gpt_StartTimer shall be reentrant, if the timer channels used in concurrent calls are different.

SWS_Gpt_00116 requirement

The function Gpt_StopTimer shall be reentrant, if the timer channels used in concurrent calls are different.

SWS_Gpt_00117 requirement

The function Gpt_EnableNotification shall be reentrant, if the timer channels used in concurrent calls are different.

SWS_Gpt_00118 requirement

The function Gpt_DisableNotification shall be reentrant, if the timer channels used in concurrent cal ls are different.

SWS_Gpt_00127 requirement

If supported by hardware, a timer channel shall be able to be configured as wakeup source of the ECU. If enabled, the wakeup occurs when the target time is reached (timer value = target time).

SWS_Gpt_00151 requirement

The function Gpt_SetMode shall set the operation mode of the GPT driver to the given mode parameter.

SWS_Gpt_00152 requirement

If the parameter Mode has the value GPT_MODE_NORMAL: The function Gpt_SetMode shall enable the interrupt notification for all channels which are configured for notificatio n and the notification is enabled (stored attribute) via the function Gpt_EnableNotification prior. All other interrupt notifications shall be disabled.

SWS_Gpt_00153 requirement

If the parameter Mode has the value GPT_MODE_SLEEP : The function Gp t_SetMode shall enable the wakeup interrupts for all channels which are configured for wakeup and the wakeup is enabled (stored attribute) via the function Gpt_EnableWakeup prior . All other wakeup interrupts shall be disabled.

SWS_Gpt_00155 requirement

The function Gpt_DisableWakeup shall be reentrant, if the timer channels used in concurrent calls are different.

SWS_Gpt_00156 requirement

The function Gpt_EnableWakeup shall be reentrant , if the timer channels used in concurrent calls are different.

SWS_Gpt_00157 requirement

The function Gpt_DisableWakeup is only feasible, if GptReportWakeupSource is statically configured avail able.

SWS_Gpt_00158 requirement

The function Gpt_EnableWakeup is only feasible, if GptReportWakeupSource is statically configured available.

SWS_Gpt_00159 requirement

The function Gpt_DisableWakeup shall disable the wakeup interrupt of the referenced channel configured for wakeup. The function shall save an attribute like "wakeup disabled" of the channel. Comment: This attribute affec ts the wakeup interrupt always when the driver is in "sleep mode". In "normal mode" the attribute has no influence.

SWS_Gpt_00160 requirement

The function Gpt_EnableWakeup shall ena ble the wakeup interrupt of the referenced channel configured for wakeup. The function shall save an attribute like "wakeup enabled" of the channel.

SWS_Gpt_00162 requirement

The function Gpt_DeInit shall influence only the peripherals, which are alloc ated by the static configuration.

SWS_Gpt_00164 requirement

If the function Gpt_SetMode is called with parameter Mode has the value GPT_MODE_SLEEP : All timer channels in state "running" which are not configured for wakeup or not enabled for wakeup interruption (stored attribute) via Gpt_EnableWakeup shall be stopped and t heir state shall be changed to " stopped".

SWS_Gpt_00165 requirement

If the parameter Mode has the value GPT_MODE_NORMAL , the function Gpt_SetMode shall not restart automatically the timer channels which have been stopped by entering the sleep m ode.

SWS_Gpt_00185 requirement

If a timer channel is configured in "one - shot mode": If the timer has reached the target time (timer value = target time), the timer shall stop automatically and maintain its timer val ue unchanged. The channel state shall change from "running" to "expired".

SWS_Gpt_00186 requirement

If a timer channel is configured in "continuous mode": If the timer has reache d the target time (timer value = target time), the timer shall continue running with the value "0" at next timer tick. So, the time interval of the recurrence is: target time + 1. This interval shall be independently of implementation, e.g. interrupt delay s.

SWS_Gpt_00194 requirement

The function Gpt_DeInit shall be pre compile time configurable On/Off by the configuration parameter: GptDeInitApi .

SWS_Gpt_00195 requirement

The function Gpt_GetTimeElapsed shall be pre compile time configurable On/Off by the configuration parameter: GptTimeElapsedApi .

SWS_Gpt_00196 requirement

The function Gpt_GetTimeRemaining shall be pre compile time configurable On/Off by th e configuration parameter: GptTimeRemainingApi .

SWS_Gpt_00199 requirement

The function Gpt_EnableNotification shall be pre compile time configurable On/Off by the configura tion parameter: GptEnableDisableNotificationApi .

SWS_Gpt_00200 requirement

The function Gpt_DisableNotification shall be pre compile time configurable On/Off by the configuration parameter: GptEnableDisableNotificationApi .

SWS_Gpt_00201 requirement

The function Gpt_SetMode shall be pre compile time configurable On/Off by the configur ation parameter: GptWakeupFunctionalityApi .

SWS_Gpt_00202 requirement

The function Gpt_DisableWakeup shall be pre compile time configurable On/Off by the confi guration parameter: GptWakeupFunctionalityApi .

SWS_Gpt_00203 requirement

The function Gpt_EnableWakeup shall be pre compile time configurable On/Off by the configuration parameter: GptWakeupFunctionalityApi .

SWS_Gpt_00206 requirement

The ISR´s, providing the timer events, shall be responsible for resetting the interrupt flags (if needed by hardware) and calling the according notification function.

SWS_Gpt_00209 requirement

Each channel shall provide its own notification if configured.

SWS_Gpt_00210 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid ( not within the range specified by configuration) , the function Gpt_GetTimeElapsed shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00211 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid ( not within the range specified by configuration), the function Gpt_GetTimeRemaining shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00212 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) , the function Gpt_StartTimer shall raise the err or GPT_E_PARAM_CHANNEL .

SWS_Gpt_00213 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) , the function Gpt_StopTimer shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00214 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) , the function Gpt_EnableNotification shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00215 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) or channel wakeup is not en abled by configuration (GptEnableWakeup), the function Gpt_DisableWakeup shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00216 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration) or channel wakeup is not enabled by configuration (GptEnableWakeup), the function Gpt_EnableWakeup shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00217 requirement

If development error detection is enabled for GPT module : If the parameter Channel is invalid (not within the range specified by configuration), the function Gpt_DisableNotification shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00218 requirement

If development error detection is enabled for GPT module : The function Gpt_StartTimer shall raise the error GPT_E_PARAM_VALUE if the parameter Value is " 0 " or not within the allowed range (exceeding the maxi mum timer resolution) .

SWS_Gpt_00220 requirement

If development er ror detection is enabled for the GPT module : I f the driver is not initialized, t he function Gpt_DeInit shall raise the error GPT_E_UNINIT .

SWS_Gpt_00222 requirement

If development error detection is e nabled for GPT module : I f the driver is not initialized, the function Gpt_GetTimeElapsed shall raise the error GPT_E_UNINIT .

SWS_Gpt_00223 requirement

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_GetTimeRemaining shall raise the error GPT_E_UNINIT .

SWS_Gpt_00224 requirement

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_StartTimer shall raise the error GPT_E_UNINIT .

SWS_Gpt_00225 requirement

If development err or detection is enabled for GPT module : If the driver is not initialized, the function Gpt_StopTimer shall raise the error GPT_E_UNINIT .

SWS_Gpt_00226 requirement

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_EnableNotification shall raise the error GPT_E_UNINIT .

SWS_Gpt_00227 requirement

If development error detectio n is enabled for GPT module : If the driver is not initialized, the function Gpt_DisableNotification shall raise the error GPT_E_UNINIT .

SWS_Gpt_00228 requirement

If development error detection is enabled for GPT modul e : If the driver is not initialized, the function Gpt_SetMode shall raise the error GPT_E_UNINIT .

SWS_Gpt_00229 requirement

If development error detection is enabled for GPT module : If the driver is not initialized, the function Gpt_Disabl eWakeup shall raise the error GPT_E_UNINIT .

SWS_Gpt_00230 requirement

If development error detectio n is enabled for GPT module : If the driver is not initialized, the function Gpt_EnableWakeup shall raise the error GPT_E_UNINIT .

SWS_Gpt_00231 requirement

If developm ent error detection is enabled for GPT modul e : The function Gpt_SetMode shall raise the error GPT_E_PARAM_MODE if the parameter Mode is invalid .

SWS_Gpt_00233 requirement

The GP T Driver shall invoke a notification whenever the defined target time of the channel is reached.

SWS_Gpt_00234 requirement

I f any timer channel is in state "running", t he function Gpt_DeInit shall raise the runtime error GPT_E_BUSY .

SWS_Gpt_00255 requirement

The function Gpt_SetMode is only available if t he configuration parameter GptReportWakeupSource is enabled.

SWS_Gpt_00258 requirement

The function Gpt_Init shall disable all wakeup interrupts, controlled by the GPT driver.

SWS_Gpt_00261 requirement

Gpt_Irq.c shall include Gpt.h for the prototype declaration of the notification functions.

SWS_Gpt_00270 requirement

Within one container it shall not be possible to mix parameters assigned to different configuration classes.

SWS_Gpt_00274 requirement

The function Gpt_StartTimer shall start the selected timer channel with a defined target time.

SWS_Gpt_00275 requirement

If configured and enabled, an interrupt notification or a wakeup interrupt occurs, when th e target time is reached .

SWS_Gpt_00278 requirement

Module Header File Imported Type Ecu M Ecu M.h Ecu M _ Wakeup Source Type Std Std_ Types.h Std _ Return Type Std_ Types.h Std _ Version Info Type

SWS_Gpt_00295 requirement

If the function Gpt_GetTimeElapsed is called on a timer channel in state "initialized" (channel started never before), the functio n shall return the value " 0 ".

SWS_Gpt_00297 requirement

If the function Gpt_GetTimeElapsed is called on a timer channel in state "stopped", the function shall return the time value at the moment of stopping.

SWS_Gpt_00299 requirement

If the function Gpt_GetTim eElapsed is called on a channel configured for "one - shot mode" in state "expired" (timer has reached the target time), the function shall return the target time .

SWS_Gpt_00301 requirement

If the function Gpt_GetTimeRema ining is called on a timer channel in state "initialized" (channel started never before), the function shall return the value " 0 ".

SWS_Gpt_00303 requirement

If the function Gpt_GetTimeRemaining is called on a timer channel in state "stopped", the function sh all return the remaining time value at the moment of stopping .

SWS_Gpt_00305 requirement

If the function Gpt_GetTimeRemaining is called on a channel configured for "one - shot mode" in state "expired" (timer has reached the target time), the function shall ret urn the value “ 0 ”.

SWS_Gpt_00307 requirement

If development error detection is enabled for the GPT module : If the GPT driver is not in operation mode "uninitialized", the function Gpt_Init shall raise the error GPT_E_ALREADY_INITIALIZED .

SWS_Gpt_00308 requirement

If a postbuild multiple selectable configuration variant was used, the function Gpt_DeInit shall further influence only the peripherals, which are allocated by the runtime configuration set passed by the previous call of the function Gpt_Init .

SWS_Gpt_00309 requirement

A re - initialization of the GPT driver by executing the Gpt_Init function requires a de - initialization before by executing a Gpt_DeInit .

SWS_Gpt_00321 requirement

The function Gpt_CheckWakeup shall check if a wakeup capable GPT channel is the source for a wakeup event and call EcuM_SetWakeupEvent to indicate a valid timer wakeup event to the ECU State Manager [8] .

SWS_Gpt_00322 requirement

The function Gpt_CheckWakeup is only feasible, if GptReportWakeupSource is statically configured available.

SWS_Gpt_00323 requirement

The function Gpt_CheckWakeup shall be reentrant, by reason of possible usage in concurren t interrupt service routines.

SWS_Gpt_00324 requirement

The function Gpt_CheckWakeup shall be pre compile time configurable On/Off by the configuration parameter: GptWakeupFunctionalityApi .

SWS_Gpt_00325 requirement

If development error detection is enabled f or GPT module : If the driver is not initialized, the function Gpt_CheckWakeup shall raise the error GPT_E_UNINIT .

SWS_Gpt_00326 requirement

EcuM_CheckWakeup shall be called within the Interrupt Service Routi ne, servicing the GPT channel wakeup event on wakeup - capable channels.

SWS_Gpt_00327 requirement

The ISR´s, providing the wakeup events, shall be responsible for resetting the interrupt flags (if needed by hardware).

SWS_Gpt_00329 requirement

A timer channel starts counting at value zero.

SWS_Gpt_00330 requirement

If a timer channel is configured in "continuous mode": If supported by hardware, it shall be possible to realize a free running timer. This means: A timer which rolls over automatically by hardware, if the target time is set to the max imum value the timer is able to count (max value = 2 n - 1, n=number of bits).

SWS_Gpt_00331 requirement

I f supported by hardware, a timer channel shall be able to be configure d to call a notification function. If enabled, the function is called when the target time is reached (timer value = target time) .

SWS_Gpt_00332 requirement

If the GptDevErrorDetect switch is enabled: When a development error occurs the corresponding GPT function shall skip the desired functionality (leave service without any action).

SWS_Gpt_00338 requirement

If development error detection is enabled for the GPT module: If the parameter VersionInfoPtr is a null pointer, the function Gpt_GetVersionInfo shall raise the error GPT_E_PARAM_POINTER .

SWS_Gpt_00339 requirement

The function Gpt_Init shall set the operation mode of the GPT driver to "normal mode". This leads to a behavior like Gpt_SetMode is called with parameter GPT_MODE_NORMAL .

SWS_Gpt_00341 requirement

If the parameter has the value GPT_MODE_SLEEP the function Gpt_SetMode shall not start a wakeup timer automatically. First, the user shall call Gpt_StartTimer to start a wakeup timer, after this the user shall call Gpt_SetMode with parameter GPT_MODE_SLEEP .

SWS_Gpt_00343 requirement

The state of the selected timer channel shall be changed to "stopped" if Gpt_StopTimer is called.

SWS_Gpt_00344 requirement

If the function Gpt_StopTimer is called on a channel in state "initialized", "stop ped" or "expired", the function shall leave without any action (no change of the channel state).

SWS_Gpt_00352 requirement

If the hardware allows for only one usage of the register, the driver module implementing that functionality is responsible for initializing the register.

SWS_Gpt_00353 requirement

If the register can affect several hardware modules and if it is an I/O register it shall be initialized by the PORT driver.

SWS_Gpt_00354 requirement

If the register can affect sever al hardware modules and if it is not an I/O register it shall be initialized by the MCU driver.

SWS_Gpt_00355 requirement

One - time writable registers that require initialization directly after reset shall be initialized by the startup code.

SWS_Gpt_00356 requirement

All other registers shall be initialized by the startup code.

SWS_Gpt_00361 requirement

When the channel is in mode "continuous mode", the return value of Gpt_GetTimeElapsed is the value relative to the las t recurrence (target time reached) or to the start of the channel before the first recurrence occurs.

SWS_Gpt_00362 requirement

For all available channels, callback functions have to be declared by the configuration tool.

SWS_Gpt_00363 requirement

The functi on Gpt_DeInit shall set the operation mode of the GPT driver to "uninitialized".

SWS_Gpt_00364 requirement

The state of the selected timer channel shall be changed to "running" if Gpt_StartTimer is called.

SWS_Gpt_00375 requirement

Gpt.c shall include Det.h in any case to be able to raise runtime error.

SWS_Gpt_00377 requirement

If development error detection is enabled for GPT module : If no valid notification function is configured (GptNotification) , the function Gpt_EnableNotification shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00379 requirement

If development error detection is enabled for GPT module : If no valid notification funct ion is configured (GptNotification), the function Gpt_DisableNotification shall raise the error GPT_E_PARAM_CHANNEL .

SWS_Gpt_00380 requirement

The standardized common published parameters as required by SRS_BSW_00402 in the SRS General on Basic Software Modules [3] shall be published within the header file of this module and need to be provided in the BSW Module De scription. The according module abbreviation can be found in the List of Basic Software Modules [1] .

SWS_Gpt_00382 requirement

A GPT Predef Timer is a free running up counter (user point of view). If the timer has reached the maximum value (max value = 2 n - 1, n=number of bits), the timer shall continue running with the value "0" at next timer tick .

SWS_Gpt_00384 requirement

A GPT Predef Timer shall have a maximum tick tolerance of +/ - 1 tick to ensure accuracy of time based function ality.

SWS_Gpt_00385 requirement

It shall be possible to configure which GPT Predef Timers are enabled.

SWS_Gpt_00386 requirement

If a GPT Predef Timer is enabled, the timer(s) with the same tick duration and lower bit number(s) shall be enabled also .

SWS_Gpt_00390 requirement

The function Gpt_Init shall start all enabled GPT Predef Timers at value “0”.

SWS_Gpt_00391 requirement

The function Gpt_DeInit shall stop all enabled GPT Predef Timers.

SWS_Gpt_00392 requirement

If the parameter Mode has the value GPT_MODE_NORMAL: If the driver is in “sleep mode”, the function Gpt_SetMode shall restart all enabled GPT Predef Timers at value “0” .

SWS_Gpt_00393 requirement

If the parameter Mode has the value GPT_MODE_SLEEP: The function Gpt_SetMode shall stop all enabled GPT Predef Timers.

SWS_Gpt_00395 requirement

The function Gpt_GetPredefTimerValue shall return the current value of the GPT Predef Timer pa ssed by PredefTimer .

SWS_Gpt_00396 requirement

If the timer value of the function Gpt_GetPredefTimerValue is less than 32 bit (16bit or 24bit timer), the upper bits shall be filled with zero.

SWS_Gpt_00397 requirement

The function Gpt_GetPredefTime rValue shall be fully reentrant, this means even for the same GPT Predef Timer.

SWS_Gpt_00398 requirement

If development error detection is enabled for GPT module : I f the driver is not initialized, the function Gpt_ GetPredefTimerValue shall raise the error GPT_E_UNINIT .

SWS_Gpt_00399 requirement

If development error detection is enabled for GPT module : If the parameter PredefTimer is invalid, the function Gpt_GetPredefTimerValu e shall raise the development error GPT_E_PARAM_PREDEF_TIMER .

SWS_Gpt_00400 requirement

If development error detection is enabled for GPT module : If the GPT Predef Timer passed by the parameter PredefTimer is not enabled, the function Gpt_GetPred efTimerValue shall raise the development error GPT_E_PARAM_PREDEF_TIMER .

SWS_Gpt_00401 requirement

If the driver is in "sleep mode", the function Gpt_ GetPredefTimerValue shall raise the runtime error GPT_E_MODE .

SWS_Gpt_00402 requirement

I f the GPT driver is not initialized, in “sleep mode” or the GPT Predef Timer is not enabled, the function Gpt_ GetPredefTimerValue shall ret urn E_NOT_OK .

SWS_Gpt_00403 requirement

If development error de tection is enabled for GPT module : If the parameter TimeValuePtr is a null pointer, the function Gpt_GetPredefTimerValue shall raise the error GPT_E_PARAM_POINTER .

SWS_Gpt_00405 requirement

Det_ Report Run t imeError Service to report runtime errors.

SWS_Gpt_00406 requirement

Det_ReportError Det.h Service to report development errors. EcuM_CheckWakeup EcuM.h This function can be called to check the given wakeup sources. It will pass the argument to the integrator function EcuM_CheckWakeupHook. It can also be called by the ISR of a wakeup source to set up the PLL and check other wakeup sources that may be connected to the same interrupt. EcuM_SetWakeupEvent EcuM.h Sets the wakeup event. ⌋(SRS_SPAL_00157)

SWS_Gpt_00407 requirement

The G PT module shall reject configurations with partition mappings which are not supported by the implementation .

SWS_Gpt_91000 requirement

Type of error Related error code Error value API service called without module initialization GPT_ E_ UNINIT 0x0A API service for initialization called when already initialized GPT_ E_ ALREADY_ INITIALIZED 0x0D API error return code: Init function failed GPT_ E_ INIT_ FAILED 0x0E API parameter checking: invalid channel GPT_ E_ PARAM_ CHANNEL 0x14 API parameter checking: invalid value GPT_ E_ PARAM_ VALUE 0x15 API parameter checking: invalid pointer GPT_ E_ PARAM_ POINTER 0x16 API parameter checking: invalid Predef Timer GPT_ E_ PARAM_ PREDEF_ TIMER 0x17 API parameter checking: invalid mode GPT_ E_ PARAM_ MODE 0x1F

SWS_Gpt_91001 requirement

Type of error Related error code Error value API service called when timer channel is still busy (running) GPT_ E_ BUSY 0x0B API service called when driver is in wrong mode GPT_ E_ MODE 0x0C

The ECUC partitions referenced by GptKernelEcucPartitionRef shall be a subset of the ECUC partitions referenced by GptEcucPartitionRef.

The ECUC partitions referenced by GptGroupEcuc PartitionRef shall be a subset of the ECUC partitions referenced by GptEcucPartition Ref.

If GptEcucPartitionRef references one or more ECUC partitions, GptKernelEcucPartitionRef shall have a multiplicity of one and reference one of these ECUC partitions as well.

If GptEcucPartitionRef references one or more ECUC partitions, GptKernelEcucPartitionRef shal l have a multiplicity of greater than zero and reference one or several of these ECUC partitions as well.

In case of partition local timer resources, the module will operate as an independent instance in each of the partitions, means the called API w ill only target the partition it is called in.