1 /* 2 * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef __COMESSAGE_H__ 16 #define __COMESSAGE_H__ 17 18 #define KEY_ID_BUILD(name, func) ((uint32_t)((name) | (func))) 19 #define KEY_NAME_GET(key_id) (key_id & 0xFFFF0000) 20 #define KEY_FUNC_GET(key_id) ((key_id) & 0xFFFF) 21 22 //key name 23 #define APP_KEY_NUM0 (0<<16) 24 #define APP_KEY_NUM1 (1<<16) 25 #define APP_KEY_NUM2 (2<<16) 26 #define APP_KEY_NUM3 (3<<16) 27 #define APP_KEY_NUM4 (4<<16) 28 #define APP_KEY_NUM5 (5<<16) 29 #define APP_KEY_NUM6 (6<<16) 30 #define APP_KEY_NUM7 (7<<16) 31 #define APP_KEY_NUM8 (8<<16) 32 #define APP_KEY_NUM9 (9<<16) 33 34 #define APP_KEY_POWER (10<<16) 35 #define APP_KEY_PLAY (11<<16) 36 #define APP_KEY_NEXT (12<<16) 37 #define APP_KEY_PREV (13<<16) 38 #define APP_KEY_VOLADD (14<<16) 39 #define APP_KEY_VOLSUB (15<<16) 40 #define APP_KEY_EQ (16<<16) 41 #define APP_KEY_MUTE (17<<16) 42 #define APP_KEY_GSENSOR (18<<16) 43 #define APP_KEY_NULL (19<<16) 44 //msg 45 #define APP_MSG_RTC (32<<16) 46 #define APP_MSG_WAIT_TIMEOUT (33<<16) 47 #define APP_MSG_SLEEP (34<<16) 48 #define APP_MSG_WAKE_UP (35<<16) 49 #define APP_MSG_CHARGING (36<<16) 50 #define APP_MSG_BATT (37<<16) 51 #define APP_MSG_LOW_POWER (38<<16) 52 #define APP_MSG_POWER_DOWN (39<<16) 53 54 //key function 55 #define APP_KEY_REPEAT (1) 56 #define APP_KEY_HOLD (2) 57 #define APP_KEY_DOWN (3) 58 #define APP_KEY_UP (4) 59 #define APP_KEY_PRESS (5) 60 #define APP_KEY_HOLD_2S (6) 61 #define APP_KEY_HOLD_3S (7) 62 #define APP_KEY_HOLD_5S (8) 63 #define APP_KEY_DOUBLE_CLICK (9) 64 #define APP_KEY_TRIPLE_CLICK (10) 65 66 #endif 67