1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
18 * Include structure:
\r
24 * `---------- Gpt_xxx.c ---> Memmap.h
\r
29 /** @addtogroup Gpt GPT Driver
\r
33 * API and type definitions for GPT Driver.
\r
39 #include "Std_Types.h"
\r
42 /** @name Error Codes */
\r
44 #define GPT_E_UNINIT 0x0a
\r
45 #define GPT_E_BUSY 0x0b
\r
46 #define GPT_E_NOT_STARTED 0x0c
\r
47 #define GPT_E_ALREADY_INITIALIZED 0x0d
\r
48 #define GPT_E_PARAM_CHANNEL 0x14
\r
49 #define GPT_E_PARAM_VALUE 0x15
\r
50 #define GPT_E_PARAM_MODE 0x1f
\r
51 #define GPT_E_PARAM_CONFIG 0x0e // TODO: Not in spec. Find real value
\r
54 /** @name Service id's */
\r
56 #define GPT_INIT_SERVICE_ID 0x01
\r
57 #define GPT_DEINIT_SERVICE_ID 0x02
\r
58 #define GPT_GETTIMEELAPSED_SERVICE_ID 0x03
\r
59 #define GPT_GETTIMEREMAINING_SERVICE_ID 0x04
\r
60 #define GPT_STARTTIMER_SERVICE_ID 0x05
\r
61 #define GPT_STOPTIMER_SERVICE_ID 0x06
\r
62 #define GPT_ENABLENOTIFICATION_SERVICE_ID 0x07
\r
63 #define GPT_DISABLENOTIFICATION_SERVICE_ID 0x08
\r
64 #define GPT_SETMODE_SERVIVCE_ID 0x09
\r
65 #define GPT_DISABLEWAKEUP_SERVICE_ID 0x0a
\r
66 #define GPT_ENABLEWAKEUP_SERVICE_ID 0x0b
\r
67 #define GPT_CBK_CHECKWAKEUP_SERVICE_ID 0x0c
\r
70 /** Channel time value type */
\r
71 typedef uint32_t Gpt_ValueType;
\r
73 /** Channel behavior */
\r
86 /** Channel id type */
\r
87 typedef uint8_t Gpt_ChannelType;
\r
89 #define GPT_VENDOR_ID 1
\r
90 #define GPT_MODULE_ID 1
\r
92 #define GPT_SW_MAJOR_VERSION 1
\r
93 #define GPT_SW_MINOR_VERSION 0
\r
94 #define GPT_SW_PATCH_VERSION 1
\r
96 #define GPT_AR_MAJOR_VERSION 2
\r
97 #define GPT_AR_MINOR_VERSION 2
\r
98 #define GPT_AR_PATCH_VERSION 1
\r
100 /* Needs Gpt_ConfigType */
\r
101 #include "Gpt_Cfg.h" /* @req 4.0.3/GPT259 */
\r
103 /* The config needs EcuM_WakeupSourceType from EcuM */
\r
105 #if (GPT_VERSION_INFO_API == STD_ON)
\r
106 #define Gpt_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,GPT)
\r
109 void Gpt_Init( const Gpt_ConfigType * );
\r
111 #if GPT_DEINIT_API == STD_ON
\r
112 void Gpt_DeInit( void );
\r
115 #if ( GPT_TIME_ELAPSED_API == STD_ON )
\r
116 Gpt_ValueType Gpt_GetTimeElapsed(Gpt_ChannelType channel);
\r
119 #if ( GPT_TIME_REMAINING_API == STD_ON )
\r
120 Gpt_ValueType Gpt_GetTimeRemaining( Gpt_ChannelType channel );
\r
123 void Gpt_StartTimer(Gpt_ChannelType channel, Gpt_ValueType value);
\r
125 void Gpt_StopTimer(Gpt_ChannelType channel);
\r
127 #if ( GPT_ENABLE_DISABLE_NOTIFICATION_API == STD_ON )
\r
128 void Gpt_EnableNotification( Gpt_ChannelType channel);
\r
130 void Gpt_DisableNotification( Gpt_ChannelType channel);
\r
133 #if ( GPT_WAKEUP_FUNCTIONALITY_API == STD_ON )
\r
134 void Gpt_SetMode( Gpt_ModeType mode );
\r
136 void Gpt_DisableWakeup( Gpt_ChannelType channel );
\r
138 void Gpt_EnableWakeup( Gpt_ChannelType channel );
\r
140 void Gpt_Cbk_CheckWakeup( EcuM_WakeupSourceType wakeupSource );
\r
144 extern void Gpt_Notification_0( void );
\r
145 extern void Gpt_Notification_1( void );
\r
146 extern void Gpt_Notification_2( void );
\r
147 extern void Gpt_Notification_3( void );
\r