b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame^] | 1 | /* |
| 2 | *@file ql_lpm.h |
| 3 | *@date 2020-04-01 |
| 4 | *@author gale |
| 5 | *@brief the function is suitable for this product: |
| 6 | */ |
| 7 | |
| 8 | #ifndef __QL_LPM_H__ |
| 9 | #define __QL_LPM_H__ |
| 10 | |
| 11 | typedef enum |
| 12 | { |
| 13 | E_QL_LPM_FALLING = 0, /* Falling, Means wakeupin falling to wakeup the module, or wakeupout falling to wakeup mcu. */ |
| 14 | E_QL_LPM_RISING = 1, /* Rising, Means wakeupin rising to wakeup the module, or wakeupout rising to wakeup mcu. */ |
| 15 | }ql_lpm_edge_t; |
| 16 | |
| 17 | /* Callback function registered via QL_Lpm_Init(); |
| 18 | * It will be called when wakeup_in state changed. |
| 19 | * lpm_edge: report the wakeup_in state. |
| 20 | */ |
| 21 | typedef void (*ql_lpm_handler_t) |
| 22 | ( |
| 23 | ql_lpm_edge_t lpm_edge |
| 24 | ); |
| 25 | |
| 26 | /* Init QL LPM Init function. |
| 27 | * Para: |
| 28 | * ql_lpm_handler: the callback handler. |
| 29 | * |
| 30 | * Return value: |
| 31 | * 0 --> success |
| 32 | * -1 --> failed |
| 33 | */ |
| 34 | extern int ql_lpm_init(ql_lpm_handler_t ql_lpm_handler); |
| 35 | |
| 36 | /* Deinit QL LPM function |
| 37 | * Rmmod ql_lpm kmod, remove lpm handler. |
| 38 | * Return value: |
| 39 | * 0 --> success |
| 40 | * -1 --> failed |
| 41 | */ |
| 42 | extern int ql_lpm_deinit(void); |
| 43 | |
| 44 | #endif // __QL_LPM_H__ |
| 45 | |