FreeCalypso > hg > freecalypso-citrine
comparison services/dar/dar_api.h @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /****************************************************************************/ | |
2 /* */ | |
3 /* File Name: dar_api.h */ | |
4 /* */ | |
5 /* Purpose: This file contains data structures and functions prototypes */ | |
6 /* used to send events to the DAR SWE. */ | |
7 /* */ | |
8 /* Version 0.1 */ | |
9 /* */ | |
10 /* Date Modification */ | |
11 /* ------------------------------------ */ | |
12 /* 26 September 2001 Create */ | |
13 /* */ | |
14 /* Author Stephanie Gerthoux */ | |
15 /* */ | |
16 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved*/ | |
17 /****************************************************************************/ | |
18 | |
19 #include "../../riviera/rv/rv_defined_swe.h" | |
20 #include "../../riviera/rvm/rvm_api.h" | |
21 | |
22 /* file used in recovery case */ | |
23 #include "../../include/sys_types.h" | |
24 | |
25 #include "dar_gen.h" | |
26 | |
27 #ifdef RVM_DAR_SWE | |
28 | |
29 #ifndef __DAR_API_H_ | |
30 #define __DAR_API_H_ | |
31 | |
32 #ifdef __cplusplus | |
33 extern "C" | |
34 { | |
35 #endif | |
36 | |
37 /***** Events *****/ | |
38 #define DAR_EVENTS_MASK (0x5000) | |
39 #define DAR_EVENT_EXTERN (0x0C00) | |
40 | |
41 /***** Definitions *****/ | |
42 /*Define DAR use parameters */ | |
43 typedef struct | |
44 { | |
45 UINT16 group_nb; | |
46 UINT16 mask; | |
47 }T_DAR_USE_ID; | |
48 | |
49 typedef struct | |
50 { | |
51 T_RV_HDR os_hdr; | |
52 INT8 status; | |
53 } T_DAR_STATUS; | |
54 | |
55 /************************************************************************/ | |
56 /* RECOVERY */ | |
57 /************************************************************************/ | |
58 | |
59 /***** Events *****/ | |
60 #define DAR_RECOVERY_CONFIG (0x0001|DAR_EVENT_EXTERN) | |
61 | |
62 /***** Definitions ******/ | |
63 /* Define return parameters. */ | |
64 typedef UINT16 T_DAR_RECOVERY_STATUS; | |
65 /* possible values */ | |
66 #define DAR_POWER_ON_OFF (0x0) /* Power ON/OFF */ | |
67 #define DAR_WATCHDOG (0xDD11) /* Watchdog reset */ | |
68 #define DAR_NORMAL_SCUTTLING (0xDD22) /* Recovery module has | |
69 decided to active the | |
70 reset */ | |
71 #define DAR_EMERGENCY_SCUTTLING (0xDD33) /* Emergency detection */ | |
72 | |
73 /* Define Recovery configuration parameters */ | |
74 typedef struct{ | |
75 UINT16 msg_id; /* id of the message */ | |
76 T_DAR_BUFFER buffer_p; /* pointer on the buffer */ | |
77 UINT8 length; /* buffer length */ | |
78 } T_DAR_RECOVERY_CONFIG; | |
79 | |
80 /* Define register parameters */ | |
81 #define DAR_NAME_MAX_LEN (15) | |
82 typedef char T_DAR_NAME[DAR_NAME_MAX_LEN]; | |
83 | |
84 /***** Prototype *****/ | |
85 /* Get and reset the status of the DAR entity */ | |
86 T_RV_RET dar_recovery_get_status(T_DAR_RECOVERY_STATUS* status); | |
87 T_RV_RET dar_recovery_config(T_RV_RET (*dar_store_recovery_data)( | |
88 T_DAR_BUFFER buffer_p, | |
89 UINT16 length)); | |
90 T_RV_RET dar_get_recovery_data(T_DAR_BUFFER buffer_p,UINT16 length ); | |
91 | |
92 /*************************************************************************/ | |
93 /* WATCHDOG */ | |
94 /*************************************************************************/ | |
95 | |
96 /***** Prototype *****/ | |
97 T_RV_RET dar_start_watchdog_timer(UINT16 timer); | |
98 T_RV_RET dar_reload_watchdog_timer(void); | |
99 T_RV_RET dar_stop_watchdog_timer(void); | |
100 | |
101 | |
102 /*************************************************************************/ | |
103 /* RESET */ | |
104 /*************************************************************************/ | |
105 | |
106 /***** Prototype *****/ | |
107 T_RV_RET dar_reset_system(void); | |
108 | |
109 | |
110 /*************************************************************************/ | |
111 /* DIAGNOSE */ | |
112 /*************************************************************************/ | |
113 | |
114 /***** Definitions *****/ | |
115 | |
116 /* DAR level messages value ( Error, Warning or debug ) */ | |
117 /* define with 8 bits: - the first for Error level */ | |
118 /* - the second for Warning level */ | |
119 /* - the other bits for debug level*/ | |
120 | |
121 /* Error level : 1000 0000 in binary*/ | |
122 #define DAR_ERROR (0x80) | |
123 /* Warning level : 0100 0000 in binary*/ | |
124 #define DAR_WARNING (0x40) | |
125 /* Debug level : 0000 0001 in binary*/ | |
126 #define DAR_DEBUG (0x01) | |
127 /* None level : 0000 0000 in binary*/ | |
128 #define DAR_NO_DIAGNOSE (0x00) | |
129 /* Exception level 1111 1111 in binary*/ | |
130 #define DAR_EXCEPTION (0xFF) | |
131 /* Causes a reset, if set when calling dar_diagnose_write_emergency() */ | |
132 #define DAR_EMERGENCY_RESET (0x00000001) | |
133 /* New data is appended to last entry, if set when calling | |
134 dar_diagnose_write_emergency() */ | |
135 #define DAR_NEW_ENTRY (0x00000002) | |
136 | |
137 /***** Prototype *****/ | |
138 /* Diagnose prototypes */ | |
139 T_RV_RET dar_diagnose_swe_filter ( T_RVM_USE_ID dar_use_id, | |
140 T_DAR_LEVEL dar_level); | |
141 | |
142 T_RV_RET dar_diagnose_write( T_DAR_INFO *buffer_p, | |
143 T_DAR_FORMAT format, | |
144 T_DAR_LEVEL diagnose_info_level, | |
145 T_RVM_USE_ID dar_use_id); | |
146 | |
147 T_RV_RET dar_diagnose_write_emergency( T_DAR_INFO *buffer_p, | |
148 T_DAR_FORMAT format, | |
149 T_RVM_USE_ID dar_use_id, | |
150 UINT32 flags); | |
151 | |
152 T_RV_RET dar_diagnose_generate_emergency( T_DAR_INFO *buffer_p, | |
153 T_DAR_FORMAT format, | |
154 T_RVM_USE_ID dar_use_id); | |
155 | |
156 #ifdef __cplusplus | |
157 } | |
158 #endif | |
159 | |
160 #endif /* __DAR_API_H_ */ | |
161 #endif /* #ifdef RVM_DAR_SWE */ |