AUTOSAR SWS GPTDriver
AUTOSAR SWS GPTDriver
AUTOSAR CP R22-11
Disclaimer
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR
and the companies that have contributed to it shall not be liable for any use of the
work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
The GPT driver is part of the microcontroller abstraction layer (MCAL). It initializes
and controls the internal General Purpose Timer(s) (GPT) of the microcontroller.
The tick duration of a timer channel depends on channel specific settings (part of
GPT driver) as well as on system clock and settings of the clock tree controlled by
the MCU module. The tick duration is not limited by this specification.
Not all hardware timers must be controlled by the GPT module. Some timers may be
controlled by AUTOSAR Operating System or Complex Drivers directly. The number
of timer channels controlled by the GPT driver depends on hardware, implementation
and system configuration.
Beside the possibility to configure individual timer channels with individual properties,
some free running up counters – so-called GPT Predef Timers – are defined. These
timers have predefined tick durations and predefined number of bits (physical time
units and ranges). The GPT Predef Timers are used by the Time Service module.
The GPT driver only generates time bases. Further time based functionality on driver
level is covered by other MCAL modules like:
PWM Driver (driver for pulse width modulation)
ICU Driver (driver for input capture unit)
OCU Driver (driver for output compare unit)
Only a few acronyms and abbreviations are listed here which are helpful to
understand this document or which have a local scope. Further information can be
found in the official AUTOSAR glossary [13].
Acronym / Description
Abbreviation
BSW Basic Software
DET Default Error Tracer
ECU Electronic Control Unit
GPT General Purpose Timer
ICU Input Capture Unit
MCU Micro Controller Unit
NOP, nop Null Operation
OS Operating System
The terms defined in the table below have a local scope within this document.
Term Description
Timer channel Represents a logical timer entity assigned to a timer hardware
Target time Time, something shall occur, when the value is reached. The behavior
depends on the configuration and the enabled functionality.
Tick Defines the timer resolution, the duration of a timer increment
GPT Predef Timer A GPT Predef Timer is a free running up counter provided by the GPT driver.
Which GPT Predef Timer(s) are available depends on hardware (clock,
hardware timers, prescaler, width of timer register, …) and configuration. A
GPT Predef Timer has predefined physical time unit and range.
Table 2: Terms
3 Related documentation
[13] Glossary,
AUTOSAR_TR_Glossary.pdf
Thus, the specification SWS BSW General shall be considered as additional and
required specification for GPT Driver.
4.1 Assumptions
No assumptions.
4.2 Limitations
No limitations.
6 Requirements traceability
This chapter refers to input requirements specified in the SRS documents (Software
Requirements Specifications) that are applicable for this software module.
The table below lists links to specification items of the GPT driver SWS document,
which satisfy the input requirements. Only functional requirements are referenced.
7 Functional specification
7.1 General behavior
The GPT driver provides services for starting and stopping timer channels (logical
timer instances assigned to a timer hardware), individual for each channel by calling
of:
Gpt_StartTimer
Gpt_StopTimer
The "target time" is passed as a parameter to Gpt_StartTimer. So, for each start
of a timer channel, the target time can be set individually.
The states and the state transitions of a timer channel are shown in Figure 1
Gpt_StartTimer()
Gpt_StartTimer() running
Gpt_StartTimer()
If the timer has reached the target time (timer value = target time), the timer shall
stop automatically and maintain its timer value unchanged. The channel state shall
change from "running" to "expired".⌋
timer value
target time 3
target time 1
0
t
Gpt_StartTimer 1 Gpt_StartTimer 2 Gpt_StopTimer Gpt_StartTimer 3
timer value
target time 1
target time 2
0
t
Gpt_StartTimer 1 2
Gpt_StopTimer Gpt_StartTimer
Both, the relative time elapsed and the time remaining can be queried by calling:
Gpt_GetTimeElapsed
Gpt_GetTimeRemaining
t
Time elapsed Time remaining Time elapsed Time remaining
Gpt_GetTimeElapsed Gpt_GetTimeElapsed
Gpt_GetTimeRemaining Gpt_GetTimeRemaining
Figure 4: Querying of time elapsed / time remaining for a timer channel in "continuous mode"
Interrupt notifications can be enabled and disabled at runtime individually for each
channel by calling of:
Gpt_EnableNotification
Gpt_DisableNotification
Wakeup interrupts can be enabled and disabled at runtime individually for each
channel by calling of:
Gpt_EnableWakeup
Gpt_DisableWakeup
After initialization the GPT driver is in "normal mode". A wakeup interrupt can only
occur when the driver is switched to "sleep mode". The operation mode can be set by
calling of:
Gpt_SetMode
For a detailled description on wakeup handling please refer to the ECU State
Manager specification [8].
The operation modes and the possible mode transitions of the GPT driver are shown
in Figure 5.
uninitialized
initial
Gpt_Init()
Gpt_DeInit()
Gpt_DeInit()
Gpt_SetMode(GPT_MODE_SLEEP)
GPT_MODE_SLEEP GPT_MODE_NORMAL
Gpt_SetMode(GPT_MODE_NORMAL)
[SWS_Gpt_00384] ⌈A GPT Predef Timer shall have a maximum tick tolerance of +/-
1 tick to ensure accuracy of time based functionality. ⌋ ( )
Which GPT Predef Timer(s) can be enabled depends on clock and available timer
hardware (prescaler, width of timer register). It is recommended to enable all GPT
Predef Timers to ensure compatibility of time based functionality for all platforms.
It is recommended to use one hardware timer per tick duration and to supply the
hardware timer directly with the clock source “f clock = 1 / (tick duration)” by good
choice of clock and prescaler(s). By this, the values of the timer counter register can
be used directly without any need of adaptation (computation) for performance
reasons. A lower bit timer can be derived from a higher bit timer by a simple software
mask operation.
For implementation of GPT Predef Timers, special hardware features may be used:
Timers may be cascaded asynchronously to use a timer as a prescaler
Timers may be cascaded synchronously to extend the timer range (number of
bits)
Timers with bit number greater than 32 bit may be used
Assembler code may be used to perform 64 bit arithmetic, if necessary GPT
internal, e.g. if a 48 bit timer with tick duration 250 ns or 1 µs is used for all
GPT Predef Timers
[SWS_Gpt_00385] ⌈It shall be possible to configure which GPT Predef Timers are
enabled. ⌋ (SRS_Gpt_13606)
[SWS_Gpt_00386] ⌈If a GPT Predef Timer is enabled, the timer(s) with the same tick
duration and lower bit number(s) shall be enabled also. ⌋ ( )
The current time value of the GPT Predef Timers can be got by calling of:
Gpt_GetPredefTimerValue (SWS_Gpt_00394)
[SWS_Gpt_91000]⌈
Error
Type of error Related error code
value
GPT_E_PARAM_PREDEF_
API parameter checking: invalid Predef Timer 0x17
TIMER
⌋()
[SWS_Gpt_91001]⌈
Type of error Related error code Error value
API service called when timer channel is still busy (running) GPT_E_BUSY 0x0B
⌋()
8 API specification
[SWS_Gpt_00278]⌈
Module Header File Imported Type
Std_Types.h Std_ReturnType
Std
Std_Types.h Std_VersionInfoType
⌋(SRS_BSW_00348)
8.2.1 Gpt_ConfigType
[SWS_Gpt_00357]⌈
Name Gpt_ConfigType
Kind Structure
--
Type --
Elements
Implementation specific configuration data structure, see chapter 10 for
Comment
configurable parameters.
This is the type of the data structure including the configuration set required for
Description
initializing the GPT timer unit.
Available
Gpt.h
via
8.2.2 Gpt_ChannelType
[SWS_Gpt_00358]⌈
Name Gpt_ChannelType
Kind Type
29 of 76 Document ID 30: AUTOSAR_SWS_GPTDriver
Specification of GPT Driver
AUTOSAR CP R22-11
Derived
uint
from
Implementation specific. But not all values may be valid within this type. This
Range -- -- type shall be chosen in order to have the most efficient implementation on a
specific micro controller platform.
Available
Gpt.h
via
⌋(SRS_BSW_00305)
8.2.3 Gpt_ValueType
[SWS_Gpt_00359]⌈
Name Gpt_ValueType
Kind Type
Derived
uint
from
The range of this type is µC dependent (width of the timer register) and has to
Range -- --
be described by the supplier.
Description Type for reading and setting the timer values (in number of ticks).
Available
Gpt.h
via
8.2.4 Gpt_ModeType
[SWS_Gpt_00360]⌈
Name Gpt_ModeType
Kind Enumeration
GPT_MODE_
0x00 Normal operation mode of the GPT
NORMAL
Range
GPT_MODE_ Operation for reduced power operation mode. In sleep
0x01
SLEEP mode only wakeup capable channels are available.
Available
Gpt.h
via
⌋(SRS_BSW_00441, SRS_BSW_00305)
8.2.5 Gpt_PredefTimerType
[SWS_Gpt_00389]⌈
Name Gpt_PredefTimerType
Kind Enumeration
Available
Gpt.h
via
⌋(SRS_Gpt_13605)
8.3.1 Gpt_GetVersionInfo
[SWS_Gpt_00279]⌈
Service Name Gpt_GetVersionInfo
void Gpt_GetVersionInfo (
Syntax Std_VersionInfoType* VersionInfoPtr
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
None
(inout)
⌋(SRS_BSW_00407)
[SWS_Gpt_00338] ⌈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. ⌋
(SRS_BSW_00323)
8.3.2 Gpt_Init
[SWS_Gpt_00280]⌈
Service Name Gpt_Init
void Gpt_Init (
Syntax const Gpt_ConfigType* ConfigPtr
)
Sync/Async Synchronous
The following rules regarding initialization of controller registers shall apply to this
driver implementation:
[SWS_Gpt_00352] ⌈If the hardware allows for only one usage of the register,
the driver module implementing that functionality is responsible for initializing
the register. ⌋ (SRS_SPAL_12461)
[SWS_Gpt_00353] ⌈If the register can affect several hardware modules and if it
is an I/O register it shall be initialized by the PORT driver. ⌋ (SRS_SPAL_12461)
[SWS_Gpt_00354] ⌈If the register can affect several hardware modules and if it
is not an I/O register it shall be initialized by the MCU driver. ⌋
(SRS_SPAL_12461)
[SWS_Gpt_00355] ⌈One-time writable registers that require initialization directly
after reset shall be initialized by the startup code. ⌋ (SRS_SPAL_12461)
[SWS_Gpt_00356] ⌈All other registers shall be initialized by the startup code. ⌋
(SRS_SPAL_12461)
[SWS_Gpt_00307] ⌈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_00339] ⌈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_00390] ⌈The function Gpt_Init shall start all enabled GPT Predef
Timers at value “0”. ⌋ (SRS_Gpt_13607)
8.3.3 Gpt_DeInit
[SWS_Gpt_00281]⌈
Service Name Gpt_DeInit
void Gpt_DeInit (
Syntax void
)
Sync/Async Synchronous
[SWS_Gpt_00363] ⌈The function Gpt_DeInit shall set the operation mode of the
GPT driver to "uninitialized". ⌋ ( )
[SWS_Gpt_00220] ⌈If development error detection is enabled for the GPT module:
If the driver is not initialized, the function Gpt_DeInit shall raise the error
GPT_E_UNINIT. ⌋ (SRS_BSW_00406)
[SWS_Gpt_00391] ⌈The function Gpt_DeInit shall stop all enabled GPT Predef
Timers. ⌋ (SRS_Gpt_13607)
8.3.4 Gpt_GetTimeElapsed
[SWS_Gpt_00282]⌈
Service Name Gpt_GetTimeElapsed
Gpt_ValueType Gpt_GetTimeElapsed (
Syntax Gpt_ChannelType Channel
)
Sync/Async Synchronous
Reentrancy Reentrant
⌋(SRS_Gpt_12117)
[SWS_Gpt_00010] ⌈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. ⌋ (SRS_Gpt_12117)
8.3.5 Gpt_GetTimeRemaining
[SWS_Gpt_00283]⌈
Service Name Gpt_GetTimeRemaining
Gpt_ValueType Gpt_GetTimeRemaining (
Syntax Gpt_ChannelType Channel
)
Sync/Async Synchronous
Reentrancy Reentrant
Description Returns the time remaining until the target time is reached.
⌋(SRS_Gpt_12117)
[SWS_Gpt_00083] ⌈The function 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. ⌋ (SRS_Gpt_12117)
8.3.6 Gpt_StartTimer
[SWS_Gpt_00284]⌈
Service Name Gpt_StartTimer
void Gpt_StartTimer (
Gpt_ChannelType Channel,
Syntax
Gpt_ValueType Value
)
Sync/Async Synchronous
⌋(SRS_Gpt_12128)
[SWS_Gpt_00274] ⌈The function Gpt_StartTimer shall start the selected timer
channel with a defined target time. ⌋ (SRS_Gpt_12128)
8.3.7 Gpt_StopTimer
[SWS_Gpt_00285]⌈
Service Name Gpt_StopTimer
void Gpt_StopTimer (
Syntax Gpt_ChannelType Channel
)
Sync/Async Synchronous
⌋(SRS_Gpt_12119)
[SWS_Gpt_00013] ⌈The function Gpt_StopTimer shall stop the selected timer
channel. ⌋ (SRS_Gpt_12119)
8.3.8 Gpt_EnableNotification
[SWS_Gpt_00286]⌈
Service Name Gpt_EnableNotification
void Gpt_EnableNotification (
Syntax Gpt_ChannelType Channel
)
Sync/Async Synchronous
Description Enables the interrupt notification for a channel (relevant in normal mode).
⌋(SRS_Gpt_12121)
[SWS_Gpt_00014] ⌈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 attribute like "notification enabled" of
the channel. ⌋ (SRS_SPAL_00157, SRS_SPAL_12067, SRS_Gpt_12121)
Comment: This attribute affects the interrupt notification always when the driver is in
"normal mode". In "sleep mode" the attribute has no influence.
8.3.9 Gpt_DisableNotification
[SWS_Gpt_00287]⌈
Service Name Gpt_DisableNotification
void Gpt_DisableNotification (
Syntax Gpt_ChannelType Channel
)
Sync/Async Synchronous
Description Disables the interrupt notification for a channel (relevant in normal mode).
⌋(SRS_Gpt_12122)
[SWS_Gpt_00015] ⌈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. ⌋ (SRS_SPAL_00157, SRS_Gpt_12122, SRS_SPAL_12067)
Comment: This attribute affects the interrupt notification always when the driver is in
"normal mode". In "sleep mode" the attribute has no influence.
8.3.10 Gpt_SetMode
[SWS_Gpt_00288]⌈
Service Name Gpt_SetMode
void Gpt_SetMode (
Syntax Gpt_ModeType Mode
)
Sync/Async Synchronous
Parameters
None
(inout)
⌋(SRS_SPAL_12169, SRS_Gpt_13603)
[SWS_Gpt_00151] ⌈The function Gpt_SetMode shall set the operation mode of the
GPT driver to the given mode parameter. ⌋ (SRS_SPAL_12169, SRS_Gpt_13603)
[SWS_Gpt_00165] ⌈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 mode. ⌋ ( )
[SWS_Gpt_00341] ⌈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. ⌋ ( )
8.3.11 Gpt_DisableWakeup
[SWS_Gpt_00289]⌈
Service Name Gpt_DisableWakeup
void Gpt_DisableWakeup (
Syntax Gpt_ChannelType Channel
)
Sync/Async Synchronous
⌋(SRS_Gpt_13602)
[SWS_Gpt_00159] ⌈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.
45 of 76 Document ID 30: AUTOSAR_SWS_GPTDriver
Specification of GPT Driver
AUTOSAR CP R22-11
Comment: This attribute affects the wakeup interrupt always when the driver is in
"sleep mode". In "normal mode" the attribute has no influence. ⌋ (SRS_Gpt_13602)
8.3.12 Gpt_EnableWakeup
[SWS_Gpt_00290]⌈
Service Name Gpt_EnableWakeup
void Gpt_EnableWakeup (
Syntax Gpt_ChannelType Channel
)
Sync/Async Synchronous
⌋(SRS_Gpt_13602)
[SWS_Gpt_00160] ⌈The function Gpt_EnableWakeup shall enable the wakeup
interrupt of the referenced channel configured for wakeup. The function shall save an
attribute like "wakeup enabled" of the channel. ⌋ (SRS_Gpt_13602)
Comment: This attribute affects the wakeup interrupt always when the driver is in
"sleep mode". In "normal mode" the attribute has no influence.
8.3.13 Gpt_CheckWakeup
[SWS_Gpt_00328]⌈
Service Name Gpt_CheckWakeup
void Gpt_CheckWakeup (
Syntax EcuM_WakeupSourceType WakeupSource
)
Service ID
0x0c
[hex]
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
None
(inout)
Parameters
None
(out)
Checks if a wakeup capable GPT channel is the source for a wakeup event and
Description calls the ECU state manager service EcuM_SetWakeupEvent in case of a valid
GPT channel wakeup event.
⌋()
[SWS_Gpt_00321] ⌈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]. ⌋ ( )
8.3.14 Gpt_GetPredefTimerValue
[SWS_Gpt_00394]⌈
Service Name Gpt_GetPredefTimerValue
Std_ReturnType Gpt_GetPredefTimerValue (
Gpt_PredefTimerType PredefTimer,
Syntax
uint32* TimeValuePtr
)
Sync/Async Synchronous
Reentrancy Reentrant
Description Delivers the current value of the desired GPT Predef Timer.
⌋(SRS_Gpt_13608)
Note:
It is strongly recommended to check the return value of the function
Gpt_GetPredefTimerValue on user software level. When E_NOT_OK is
returned the time value - pointed by TimeValuePtr - may be invalid and must not
be used.
[SWS_Gpt_00402] ⌈If the GPT driver is not initialized, in “sleep mode” or the GPT
Predef Timer is not enabled, the function Gpt_GetPredefTimerValue shall
return E_NOT_OK. ⌋ (SRS_BSW_00406)
Note:
This is to inform user software if the hardware timer is not running, independent of
development error detection is enabled for GPT module enabled/disabled for the
GPT module. The function Gpt_GetPredefTimerValue is used by the Time
Service module which is part of the Services Layer. The user of the Time Service
module shall have a chance to cope with missed timer support.
[SWS_Gpt_00398] ⌈If development error detection is enabled for GPT module: If the
driver is not initialized, the function Gpt_GetPredefTimerValue shall raise the
error GPT_E_UNINIT. ⌋ (SRS_BSW_00406)
[SWS_Gpt_00399] ⌈If development error detection is enabled for GPT module: If the
parameter PredefTimer is invalid, the function Gpt_GetPredefTimerValue
shall raise the development error GPT_E_PARAM_PREDEF_TIMER. ⌋
(SRS_BSW_00323)
[SWS_Gpt_00400] ⌈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_GetPredefTimerValue shall raise the development error
GPT_E_PARAM_PREDEF_TIMER. ⌋ ( )
[SWS_Gpt_00403] ⌈If development error detection 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.⌋
(SRS_BSW_00369, SRS_BSW_00323)
This chapter defines all interfaces, which are required to fulfill the core functionality of
the module.
50 of 76 Document ID 30: AUTOSAR_SWS_GPTDriver
Specification of GPT Driver
AUTOSAR CP R22-11
[SWS_Gpt_00405]⌈
API function Description
Det_ReportRuntimeError Service to report runtime errors.
⌋(SRS_SPAL_00157 , SRS_SPAL_12064)
This chapter defines all interfaces, which are required to fulfill an optional
functionality of the module.
[SWS_Gpt_00406]⌈[]⌈
API Header
Description
Function File
Det_Report-
Det.h Service to report development errors.
Error
This function can be called to check the given wakeup sources. It will pass
EcuM_-
the argument to the integrator function EcuM_CheckWakeupHook. It can
Check- EcuM.h
also be called by the ISR of a wakeup source to set up the PLL and check
Wakeup
other wakeup sources that may be connected to the same interrupt.
EcuM_Set-
Wakeup- EcuM.h Sets the wakeup event.
Event
⌋()⌋(SRS_SPAL_00157)
In this chapter all interfaces are listed where the target function could be configured.
The target function is usually a call-back function. The names of these kinds of
interfaces is not fixed because they are configurable.
[SWS_Gpt_00292]⌈
void Gpt_Notification_<channel> (
Syntax void
)
Sync/Async Synchronous
Description --
⌋(SRS_BSW_00375, SRS_SPAL_12069)
The GPT module’s environment shall declare a separate notification for each channel
to avoid parameters in notification services and to improve run time efficiency.
[SWS_Gpt_00233] ⌈The GPT Driver shall invoke a notification whenever the defined
target time of the channel is reached. ⌋ (SRS_SPAL_12067, SRS_Gpt_12120)
[SWS_Gpt_00206] ⌈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. ⌋ (SRS_SPAL_12129)
9 Sequence diagrams
All functions except Gpt_Init, Gpt_DeInit, Gpt_GetVersionInfo and
Gpt_SetMode are synchronous and re-entrant.
9.1 Gpt_Init
The ECU State Manager (EcuM) is responsible for calling the init function.
«module» «module»
EcuM Gpt
Gpt_Init(const
Gpt_ConfigType*)
Gpt_Init()
Gpt_EnableNotification(Gpt_ChannelType)
Gpt_EnableNotification()
Gpt_StartTimer(Gpt_ChannelType,
Gpt_ValueType)
start Channel2
Gpt_StartTimer()
Timer has reached
target time (set by
Gpt_StartTimer) and
continuous running.
Gpt_Notification_Channel2()
Gpt_Notification_Channel2()
Gpt_GetTimeElapsed(Gpt_ValueType,
Gpt_ChannelType): Gpt_ValueType read Channel2
Gpt_GetTimeElapsed()
Timer has reached
target time (set by
Gpt_StartTimer) and
continuous running.
Gpt_Notification_Channel2()
Gpt_Notification_Channel2()
Gpt_Notification_Channel2()
Gpt_StopTimer(Gpt_ChannelType)
stop Channel2
Gpt_StopTimer()
Description:
Timer is stopped by the user.
Gpt_EnableNotification(Gpt_ChannelType)
Gpt_EnableNotification()
Gpt_StartTimer(Gpt_ChannelType,
Gpt_ValueType) start Channel1
Gpt_StartTimer()
Timer has reached target time
(set by Gpt_StartTimer)
timer expired
Gpt_Notification_Channel1()
Gpt_Notification_Channel1()
Note:
Notification can be used to start the timer again
Gpt_StartTimer(Gpt_ChannelType,
Gpt_ValueType)
start Channel1
Gpt_StartTimer()
Gpt_GetTimeRemaining(Gpt_ValueType,
Gpt_ChannelType): Gpt_ValueType
read Channel1
Gpt_GetTimeRemaining()
Gpt_StopTimer(Gpt_ChannelType)
stop Channel1
Gpt_StopTimer()
Description:
Timer is stopped by the user
Gpt_DeInit()
before the timer has expired
Gpt_DeInit()
the notification is disabled, the user will not be informed, when the timer reaches the
target time the 2nd time (period 2).
This notification is discarded and not made up again, when the notification is re-
enabled.
Gpt_EnableNotification(Gpt_ChannelType)
Gpt_EnableNotification()
Gpt_StartTimer(Gpt_ChannelType,
Gpt_ValueType)
start Channel
Gpt_StartTimer()
Gpt_Notification_<channel>()
Gpt_DisableNotification(Gpt_ChannelType)
Timer has reached
target time (set by
Description: Gpt_DisableNotification() Gpt_StartTimer) and
Notification is disabled, no
continuous running.
notification is performed.
Description:
Gpt_EnableNotification(Gpt_ChannelType)
Notification for period 2 is discarded.
Timer has reached
Gpt_EnableNotification() target time (set by
Gpt_StartTimer) and
continuous running.
Gpt_Notification_<channel>()
Description:
Notification is re-enabled.
Notification for period 3 will be
performed.
9.5 Wakeup
Note: Sequence charts on timer wakeup can be found in the ECU state manager
specification [8].
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into
containers. In order to support the specification Chapter 10.1 describes
fundamentals. It also specifies a template (table) you shall use for the parameter
specification. We intend to leave Chapter 10.1 in the specification to guarantee
comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
GPT
10.2.1 Gpt
Included Containers
10.2.2 GptDriverConfiguration
Parent
Gpt
Container
Configuration Parameters
Multiplicity 1
Type EcucBooleanParamDef
Post-build time --
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-build time --
Specifies the grade of enabling the GPT Predef Timers with 1µs tick
Description
duration.
Multiplicity 1
Type EcucEnumerationParamDef
GPT_PREDEF_TIMER_1US_DISABLED disabled
Post-Build Variant
false
Value
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-build time --
Description Maps the GPT driver to zero or multiple ECUC partitions to make the driver
62 of 76 Document ID 30: AUTOSAR_SWS_GPTDriver
Specification of GPT Driver
AUTOSAR CP R22-11
Multiplicity 0..*
Post-Build Variant
true
Multiplicity
Post-Build Variant
true
Value
Scope /
scope: ECU
Dependency
Maps the GPT kernel to zero or one ECUC partitions to assign the driver
kernel to a certain core. The ECUC partition referenced is a subset of the
Description ECUC partitions where the GPT driver is mapped to.
Note: The kernel reference shall not be set in case the GPT driver is
implemented without a kernel (refer to definition of GptEcucPartitionRef).
Multiplicity 0..1
Post-Build Variant
true
Multiplicity
Post-Build Variant
true
Value
Scope /
scope: ECU
Dependency
Included Containers
Container
Multiplicity Scope / Dependency
Name
HW
Configurator 1 Tick x s
Description
I/O Hardware
OS
Prescaler value Abstraction
Ticks
Configuration of Configuration of
shared resources GPT resources
Init
µC
Module1 HW
GPT
PLL Prescaler GPT HW
Prescaler
Module2 HW
10.2.3 GptClockReferencePoint
Container
GptClockReferencePoint
Name
Parent
GptDriverConfiguration
Container
Configuration Parameters
Parameter
GptClockReference
Name
Parent
GptClockReferencePoint
Container
Multiplicity 1
Post-Build
false
Variant Value
Scope /
scope: local
Dependency
No Included Containers
10.2.4 GptChannelConfigSet
Container
GptChannelConfigSet
Name
Parent
Gpt
Container
This container is the base of a Configuration Set which contains the configured GPT
Description channels. This way, different configuration sets can be defined for post-build
process.
Configuration Parameters
Included Containers
10.2.5 GptChannelConfiguration
Configuration Parameters
Channel Id of the GPT channel. This value will be assigned to the symbolic
Description
name derived of the GptChannelConfiguration container short name.
Multiplicity 1
Range 0 .. 4294967295
Default value --
Post-Build Variant
false
Value
Scope /
scope: ECU
Dependency
Description Specifies the behavior of the timer channel after the target time is reached.
Multiplicity 1
Type EcucEnumerationParamDef
Post-Build Variant
true
Value
Scope /
scope: ECU
Dependency
Multiplicity 1
Type EcucFloatParamDef
Range [0 .. INF]
Default value --
Maximum value in ticks, the timer channel is able to count. With the next tick,
Description
the timer rolls over to zero.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 18446744073709551615
Default value --
Post-Build Variant
true
Value
Multiplicity 1
68 of 76 Document ID 30: AUTOSAR_SWS_GPTDriver
Specification of GPT Driver
AUTOSAR CP R22-11
Type EcucBooleanParamDef
Default value --
Multiplicity 0..1
Type EcucFunctionNameDef
Default value --
Regular Expression --
Multiplicity 1
Post-Build Variant
true
Value
Maps a GPT channel to zero or multiple ECUC partitions to limit the access to
Description this channel group. The ECUC partitions referenced are a subset of the ECUC
partitions where the GPT driver is mapped to.
Multiplicity 0..*
Post-Build Variant
true
Multiplicity
Post-Build Variant
true
Value
Scope /
scope: ECU
Dependency
Included Containers
10.2.6 GptWakeupConfiguration
Configuration Parameters
Multiplicity 1
Post-Build Variant
true
Value
No Included Containers
10.2.7 GptConfigurationOfOptApiServices
Container
GptConfigurationOfOptApiServices
Name
Parent
Gpt
Container
This container contains all configuration switches for configuring optional API
Description
services of the GPT driver.
Configuration Parameters
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-build time --
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-Build Variant
false
Value
Post-build time --
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-build time --
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-build time --
Multiplicity 1
Type EcucBooleanParamDef
Post-build time --
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-Build Variant
false
Value
Scope /
scope: local
Dependency
No Included Containers
Module Description. The according module abbreviation can be found in the List of
Basic Software Modules [1]. ⌋ ( )