blob: 376c4b471bd5417fd37cfa8c6c50860d51e064d0 [file] [log] [blame]
b.liud440f9f2025-04-18 10:44:31 +08001/*
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
11typedef 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*/
21typedef 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*/
34extern 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*/
42extern int ql_lpm_deinit(void);
43
44#endif // __QL_LPM_H__
45