2 * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef TMCAGLWM_DUMMY_STM_HPP
18 #define TMCAGLWM_DUMMY_STM_HPP
20 // TODO: This file should be existed in STM
27 #define STM_EVT_NO_NONE 0x01
28 #define STM_EVT_NO_ACTIVATE 0x02
29 #define STM_EVT_NO_DEACTIVATE 0x03
30 #define STM_EVT_NO_TRANS_GEAR_N 0x04
31 #define STM_EVT_NO_TRANS_GEAR_NOT_N 0x05
32 #define STM_EVT_NO_PARKING_BRAKE_OFF 0x06
33 #define STM_EVT_NO_PARKING_BRAKE_ON 0x07
34 #define STM_EVT_NO_ACCEL_PEDAL_OFF 0x08
35 #define STM_EVT_NO_ACCEL_PEDAL_ON 0x09
36 #define STM_EVT_NO_TIMER_EXPIRED 0x0A
37 #define STM_EVT_NO_LAMP_OFF 0x0B
38 #define STM_EVT_NO_LAMP_ON 0x0C
39 #define STM_EVT_NO_LIGHTSTATUS_BRAKE_OFF 0x0D
40 #define STM_EVT_NO_LIGHTSTATUS_BRAKE_ON 0x0E
41 #define STM_EVT_NO_RESTRICTION_MODE_OFF 0x0F
42 #define STM_EVT_NO_RESTRICTION_MODE_ON 0x10
45 #define STM_CTG_NO_NONE 0x0100
46 #define STM_CTG_NO_HOMESCREEN 0x0200
47 #define STM_CTG_NO_MAP 0x0300
48 #define STM_CTG_NO_GENERAL 0x0400
49 #define STM_CTG_NO_SPLITABLE 0x0500
50 #define STM_CTG_NO_POPUP 0x0600
51 #define STM_CTG_NO_SYSTEM_ALERT 0x0700
52 #define STM_CTG_NO_RESTRICTION 0x0800
53 #define STM_CTG_NO_SYSTEM 0x0900
56 #define STM_ARA_NO_NONE 0x010000
57 #define STM_ARA_NO_FULL 0x020000
58 #define STM_ARA_NO_NORMAL 0x030000
59 #define STM_ARA_NO_SPLIT_MAIN 0x040000
60 #define STM_ARA_NO_SPLIT_SUB 0x050000
61 #define STM_ARA_NO_ON_SCREEN 0x060000
62 #define STM_ARA_NO_RESTRICTION_NORMAL 0x070000
63 #define STM_ARA_NO_RESTRICTION_SPLIT_MAIN 0x080000
64 #define STM_ARA_NO_RESTRICTION_SPLIT_SUB 0x090000
67 #define STM_MSK_EVT_NO 0x0000FF
68 #define STM_MSK_CTG_NO 0x00FF00
69 #define STM_MSK_ARA_NO 0xFF0000
72 enum stm_trans_gear_state_ {
73 gStmTransGearStateNoN = 0,
74 gStmTransGearStateNoNotN
77 enum stm_parking_brake_state_ {
78 gStmParkingBrakeStateNoOff = 0,
79 gStmParkingBrakeStateNoOn
82 enum stm_accel_pedal_state_ {
83 gStmAccelPedalStateNoOff = 0,
84 gStmAccelPedalStateNoOn
88 gStmRunningNoStop = 0,
92 enum stm_lamp_state_ {
93 gStmLampStateNoOff = 0,
97 enum stm_lightstatus_brake_state_ {
98 gStmLightstatusBrakeStateNoOff = 0,
99 gStmLightstatusBrakeStateNoOn
102 enum stm_restriction_mode_state_ {
103 gStmRestrictionModeStateNoOff = 0,
104 gStmRestrictionModeStateNoOn
108 gStmLayoutNoNone = 0,
118 gStmLayoutNoRestriction,
119 gStmLayoutNoRestrictionSplitMain,
120 gStmLayoutNoRestrictionSplitSub,
128 gStmEventNoTransGearN,
129 gStmEventNoTransGearNotN,
130 gStmEventNoParkingBrakeOff,
131 gStmEventNoParkingBrakeOn,
132 gStmEventNoAccelPedalOff,
133 gStmEventNoAccelPedalOn,
134 gStmEventNoTimerExpired,
137 gStmEventNoLightstatusBrakeOff,
138 gStmEventNoLightstatusBrakeOn,
139 gStmEventNoRestrictionModeOff,
140 gStmEventNoRestrictionModeOn,
144 gStmEventNoMin = gStmEventNoNone,
145 gStmEventNoMax = gStmEventNoNum - 1,
149 gStmCategoryNoNone = 0,
150 gStmCategoryNoHomescreen,
152 gStmCategoryNoGeneral,
153 gStmCategoryNoSplitable,
155 gStmCategoryNoSystemAlert,
156 gStmCategoryNoRestriction,
160 gStmCategoryNoMin = gStmCategoryNoNone,
161 gStmCategoryNoMax = gStmCategoryNoNum - 1,
166 gStmAreaNoFullscreen,
171 gStmAreaNoRestrictionNormal,
172 gStmAreaNoRestrictionSplitMain,
173 gStmAreaNoRestrictionSplitSub,
177 gStmAreaNoMin = gStmAreaNoNone,
178 gStmAreaNoMax = gStmAreaNoNum - 1,
183 gStmLayerNoHomescreen,
185 gStmLayerNoRestriction,
190 gStmLayerNoMin = gStmLayerNoNone,
191 gStmLayerNoMax = gStmLayerNoNum - 1,
194 enum stm_car_element_ {
195 gStmCarElementNoTransGear = 0,
196 gStmCarElementNoParkingBrake,
197 gStmCarElementNoAccelPedal,
198 gStmCarElementNoRunning,
199 gStmCarElementNoLamp,
200 gStmCarElementNoLightstatusBrake,
201 gStmCarElementNoRestrictionMode,
205 gStmCarElementNoMin = gStmCarElementNoTransGear,
206 gStmCarElementNoMax = gStmCarElementNoNum - 1,
209 extern const char* gStmEventName[];
210 extern const int gStmEventNo[];
211 extern const char* gStmCategoryName[];
212 extern const int gStmCategoryNo[];
213 extern const char* gStmAreaName[];
214 extern const int gStmAreaNo[];
215 extern const char* gStmLayerName[];
216 extern const char* gStmCarElementName[];
219 extern const char* gStmLayoutNo2Name[];
220 extern const char** gStmCarStateNameList[];
223 typedef struct stm_base_state_ {
229 stm_base_state car_element[gStmCarElementNoNum];
230 stm_base_state layer[gStmLayerNoNum];
234 void stmInitialize();
235 int stmTransitionState(int event_no, stm_state_t* state);
239 #endif // TMCAGLWM_DUMMY_STM_HPP