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
24 * Development Error Tracer driver
\r
30 * General requirements
\r
37 #define DET_MODULE_ID MODULE_ID_DET
\r
38 #define DET_VENDOR_ID 1
\r
40 /* Implementation version */
\r
41 #define DET_SW_MAJOR_VERSION 1
\r
42 #define DET_SW_MINOR_VERSION 0
\r
43 #define DET_SW_PATCH_VERSION 0
\r
45 /* AUTOSAR specification document version */
\r
46 #define DET_AR_MAJOR_VERSION 2
\r
47 #define DET_AR_MINOR_VERSION 2
\r
48 #define DET_AR_PATCH_VERSION 2
\r
50 #include "Std_Types.h"
\r
51 #include "Det_Cfg.h"
\r
52 #include "Modules.h"
\r
55 #define DET_E_CBK_REGISTRATION_FAILED 0x01
\r
56 #define DET_E_INDEX_OUT_OF_RANGE 0x02
\r
58 #define DET_CALLBACK_API 0xFF
\r
60 #define DET_CBK_REGISTRATION_FAILED_INDEX 0xFF
\r
62 // Type used to store errors
\r
71 #if ( DET_ENABLE_CALLBACKS == STD_ON )
\r
72 typedef void (*detCbk_t)( uint16 ModuleId, uint8 InstanceId , uint8 ApiId, uint8 ErrorId);
\r
75 * Add a callback function to the array of callback. After a call to Det_ReportError the callback
\r
76 * is called. This can be used in for instance unit tests to verify that correct errors are
\r
77 * reported when sending invalid parameters to a function.
\r
78 * This function returns the index of the callback in the array when registration is successful. If
\r
79 * not DET_CBK_REGISTRATION_FAILED_INDEX is returned.
\r
80 * The index can be used to remove a callback with the Det_RemoveCbk.
\r
82 uint8 Det_AddCbk ( detCbk_t detCbk);
\r
83 void Det_RemoveCbk ( uint8 detCbkIndex);
\r
86 void Det_Init( void ); /** @req DET008 */
\r
87 #if DET_DEINIT_API == STD_ON
\r
88 void Det_DeInit( void );
\r
90 void Det_ReportError( uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId); /** @req DET009 */
\r
91 void Det_Start( void ); /** @req DET010 */
\r
92 #define Det_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,DET) /** @req DET011 */ /** @req DET012 */
\r