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_ACTIVATE 0x01
28 #define STM_EVT_NO_DEACTIVATE 0x02
29 #define STM_EVT_NO_TRANS_GEAR_N 0x03
30 #define STM_EVT_NO_TRANS_GEAR_NOT_N 0x04
31 #define STM_EVT_NO_PARKING_BRAKE_OFF 0x05
32 #define STM_EVT_NO_PARKING_BRAKE_ON 0x06
33 #define STM_EVT_NO_ACCEL_PEDAL_OFF 0x07
34 #define STM_EVT_NO_ACCEL_PEDAL_ON 0x08
35 #define STM_EVT_NO_TIMER_EXPIRED 0x09
36 #define STM_EVT_NO_LAMP_OFF 0x0A
37 #define STM_EVT_NO_LAMP_ON 0x0B
38 #define STM_EVT_NO_LIGHTSTATUS_BRAKE_OFF 0x0C
39 #define STM_EVT_NO_LIGHTSTATUS_BRAKE_ON 0x0D
40 #define STM_EVT_NO_RESTRICTION_MODE_OFF 0x0E
41 #define STM_EVT_NO_RESTRICTION_MODE_ON 0x0F
44 #define STM_CTG_NO_HOMESCREEN 0x0100
45 #define STM_CTG_NO_MAP 0x0200
46 #define STM_CTG_NO_GENERAL 0x0300
47 #define STM_CTG_NO_SPLITABLE 0x0400
48 #define STM_CTG_NO_POPUP 0x0500
49 #define STM_CTG_NO_SYSTEM_ALERT 0x0600
50 #define STM_CTG_NO_RESTRICTION 0x0700
53 #define STM_ARA_NO_FULL 0x010000
54 #define STM_ARA_NO_NORMAL 0x020000
55 #define STM_ARA_NO_SPLIT_MAIN 0x030000
56 #define STM_ARA_NO_SPLIT_SUB 0x040000
57 #define STM_ARA_NO_ON_SCREEN 0x050000
58 #define STM_ARA_NO_RESTRICTION_NORMAL 0x060000
59 #define STM_ARA_NO_RESTRICTION_SPLIT_MAIN 0x070000
60 #define STM_ARA_NO_RESTRICTION_SPLIT_SUB 0x080000
63 #define STM_MSK_EVT_NO 0x0000FF
64 #define STM_MSK_CTG_NO 0x00FF00
65 #define STM_MSK_ARA_NO 0xFF0000
67 // Number of events, categories and areas
68 #define STM_NUM_EVT 15
73 enum stm_trans_gear_state_ {
74 gStmTransGearStateNoN = 0,
75 gStmTransGearStateNoNotN
78 enum stm_parking_brake_state_ {
79 gStmParkingBrakeStateNoOff = 0,
80 gStmParkingBrakeStateNoOn
83 enum stm_accel_pedal_state_ {
84 gStmAccelPedalStateNoOff = 0,
85 gStmAccelPedalStateNoOn
89 gStmCarStateNoStop = 0,
93 enum stm_lamp_state_ {
94 gStmLampStateNoOff = 0,
98 enum stm_lightstatus_brake_state_ {
99 gStmLightstatusBrakeStateNoOff = 0,
100 gStmLightstatusBrakeStateNoOn
103 enum stm_restriction_mode_state_ {
104 gStmRestrictionModeStateNoOff = 0,
105 gStmRestrictionModeStateNoOn
109 gStmLayoutNoNone = 0,
119 gStmLayoutNoRestriction,
120 gStmLayoutNoRestrictionSplitMain,
121 gStmLayoutNoRestrictionSplitSub,
125 gStmLayerNoHomescreen = 0,
127 gStmLayerNoRestriction,
133 extern const char* gStmEventName[];
134 extern const int gStmEventNo[];
135 extern const char* gStmCategoryName[];
136 extern const int gStmCategoryNo[];
137 extern const char* gStmAreaName[];
138 extern const int gStmAreaNo[];
139 extern const char* gStmLayerName[];
140 extern const int gStmLayerNo[];
143 extern const char* gStmParkingBrakeStateNo2Name[];
144 extern const char* gStmAccelPedalStateNo2Name[];
145 extern const char* gStmCarStateNo2Name[];
146 extern const char* gStmLampStateNo2Name[];
147 extern const char* gStmLayoutNo2Name[];
148 extern const char* gStmLightstatusBrakeStateNo2Name[];
149 extern const char* gStmRestrictionModeStateNo2Name[];
152 typedef struct stm_base_state_ {
157 typedef struct stm_layer_state_ {
158 stm_base_state on_screen;
159 stm_base_state restriction;
161 stm_base_state homescreen;
165 stm_base_state trans_gear;
166 stm_base_state parking_brake;
167 stm_base_state accel_pedal;
170 stm_base_state lightstatus_brake;
171 stm_base_state restriction_mode;
172 stm_base_state layer[gStmLayerNoNum];
173 // stm_layer_state layer;
177 void stmInitialize();
178 int stmTransitionState(int event_no, stm_state_t* state);
181 #endif // TMCAGLWM_DUMMY_STM_HPP