lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2016, ZIXC Corporation. |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | #ifndef __ZX2975XX_KEY_H__ |
| 7 | #define __ZX2975XX_KEY_H__ |
| 8 | |
| 9 | /*µç·ÔÀíͼÉÏ£¬µÍµçƽʱ£¬reset/wifi¼ü°´Ï£¬power¼ü̧Æð£»¸ßµçƽʱ£¬reset/wifi¼ü̧Æð£¬power¼ü°´ÏÂ*/ |
| 10 | typedef enum key_status |
| 11 | { |
| 12 | KEY_PRESS = 0, //°´ÏÂ |
| 13 | KEY_RELEASE = 1, //̧Æð |
| 14 | PWR_KEY_LONG_PRESS = 2, //power¼üΪ³¤°´×´Ì¬ |
| 15 | }keys_status; |
| 16 | |
| 17 | typedef enum key_type |
| 18 | { |
| 19 | KEYS_RESET = 0, |
| 20 | KEYS_WIFI = 1, |
| 21 | KEYS_POWER_ON = 2, |
| 22 | }keys_type; |
| 23 | |
| 24 | typedef enum |
| 25 | { |
| 26 | KEY_POWER = 1, |
| 27 | KEY_VOL_UP = 2, |
| 28 | KEY_VOL_DOWER = 3, |
| 29 | UNKNOW_KEY |
| 30 | }key_t; |
| 31 | |
| 32 | /*========================================= |
| 33 | * Fun: key module initial |
| 34 | * return: 0: success |
| 35 | *=========================================*/ |
| 36 | int key_initial(void); |
| 37 | |
| 38 | /*========================================= |
| 39 | * Fun: Test key's status |
| 40 | * return: 0: KEY_PRESS, 1: KEY_RELEASE |
| 41 | *=========================================*/ |
| 42 | int key_is_pressed(keys_type key); |
| 43 | |
| 44 | #endif /* __ZX2975XX_KEY_H__ */ |