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
21 #define IOHWAB_SW_MAJOR_VERSION 1
\r
22 #define IOHWAB_SW_MINOR_VERSION 0
\r
23 #define IOHWAB_SW_PATCH_VERSION 0
\r
25 #define IOHWAB_MODULE_ID 0xAB
\r
26 #define IOHWAB_VENDOR_ID 1
\r
28 #if defined(CFG_IOHWAB_USE_SERVICE_COMPONENT)
\r
29 #include "Rte_Type.h"
\r
32 #include "IoHwAb_Cfg.h"
\r
33 #include "IoHwAb_Types.h"
\r
34 #include "IoHwAb_Analog.h"
\r
35 #include "IoHwAb_Digital.h"
\r
36 #include "IoHwAb_Pwm.h"
\r
39 //#include "IoHwAb_Cbk.h"
\r
42 #define IOHWAB_UNLOCKED 0
\r
43 #define IOHWAB_LOCKED 1
\r
45 /******************************************** API ids *********************************************/
\r
47 #define IOHWAB_INIT_ID 0x10
\r
49 #define IOHWAB_ANALOG_GET_ID 0x20
\r
51 #define IOHWAB_DIGITAL_GET_ID 0x30
\r
52 #define IOHWAB_DIGITAL_SET_ID 0x31
\r
54 #define IOHWAB_PWMDUTY_SET_ID 0x40
\r
55 #define IOHWAB_PWMFREQUENCYANDDUTY_SET_ID 0x41
\r
57 #define IOHWAB_CAPTURE_GET_ID 0x50
\r
59 /***************************************** DET error ids ******************************************/
\r
61 #define IOHWAB_E_INIT 0x01
\r
63 #define IOHWAB_E_PARAM_SIGNAL 0x11
\r
64 #define IOHWAB_E_PARAM_DUTY 0x12
\r
66 /******************************************* DET macros *******************************************/
\r
68 #if (IOHWAB_DEV_ERROR_DETECT == STD_ON)
\r
70 #define IOHWAB_DET_REPORT_ERROR(api, error) \
\r
72 Det_ReportError(IOHWAB_MODULE_ID, 0, api, error); \
\r
75 #define IOHWAB_VALIDATE(expression, api, error) \
\r
77 if ( !(expression) ) { \
\r
78 IOHWAB_DET_REPORT_ERROR(api, error); \
\r
82 #define IOHWAB_VALIDATE_RETURN(expression, api, error, rv) \
\r
84 if ( !(expression) ) { \
\r
85 IOHWAB_DET_REPORT_ERROR(api, error); \
\r
90 #else /* IOHWAB_DEV_ERROR_DETECT */
\r
92 #define IOHWAB_DET_REPORT_ERROR(api, error)
\r
93 #define IOHWAB_VALIDATE(expression, api, error)
\r
94 #define IOHWAB_VALIDATE_RETURN(expression, api, error, rv)
\r
96 #endif /* IOHWAB_DEV_ERROR_DETECT */
\r
99 #define IoHwAb_LockSave(_x) Irq_Save(_x)
\r
100 #define IoHwAb_LockRestore(_x) Irq_Restore(_x)
\r
102 void IoHwAb_Init( void );
\r
105 #endif /* IOHWAB_H_ */
\r