srv_2line_wakeup.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _SRV_2LINE_WAKEUP_H_
  13. #define _SRV_2LINE_WAKEUP_H_
  14. #include "srv_config.h"
  15. #include <stdint.h>
  16. #include <stdbool.h>
  17. #include <stddef.h>
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. typedef enum
  22. {
  23. SRV_2LINE_WAKEUP_WAKEUP_IN,
  24. SRV_2LINE_WAKEUP_AT_CMD,
  25. } mcuNotifySleepMode_t;
  26. /**
  27. * @brief Initialize 2line wakeup service
  28. *
  29. * @param mode 0 : notify by the gpio of wakeup_in,
  30. * 1 : notify by the at command and the gpio of wakeup_in
  31. * @param delay_ms the module should into deep sleep after the delay time.
  32. *
  33. */
  34. void srv2LineWakeUpInit(int mode, uint32_t delay_ms);
  35. /**
  36. * @brief Delete the resource when no use the service.
  37. *
  38. */
  39. void srv2LineWakeUpDelete(void);
  40. /**
  41. * @brief Check the gpio of wakeup_out if it is low level pull it up
  42. * and hold the pm_wakeup_out lock.
  43. *
  44. */
  45. void srv2LineWakeUpCheckWakeUpOutState(void);
  46. /**
  47. * @brief Set the wakeup_out sleep timer, if the tiemer out, it will
  48. * release the pm_wakeup_out lock.
  49. *
  50. */
  51. void srv2LineWakeUpOutSetSleepTimer(void);
  52. /**
  53. * @brief Mcu notify module should into sleep
  54. *
  55. * @param mode 0 : notify by the gpio of wakeup_in,
  56. * 1 : notify by the at command and the gpio of wakeup_in
  57. * @param delay_ms the module should into deep sleep after the delay time.
  58. * @return
  59. */
  60. void srv2LineWakeUpMcuNotifySleep(int mode, uint32_t delay_ms);
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #endif