diff options
author | Joey Castillo <jose.castillo@gmail.com> | 2021-08-03 18:00:07 -0400 |
---|---|---|
committer | Joey Castillo <jose.castillo@gmail.com> | 2021-08-03 18:09:58 -0400 |
commit | fc31739eb6fdf230a26930e8d42de7a26558aeae (patch) | |
tree | dcd629420799cba11304d0d4184f15c5f12f3e6e /watch-library/hal/include/hpl_calendar.h | |
parent | 8a06636833e007675c150532035588bc1bf7749a (diff) | |
download | Sensor-Watch-fc31739eb6fdf230a26930e8d42de7a26558aeae.tar.gz Sensor-Watch-fc31739eb6fdf230a26930e8d42de7a26558aeae.tar.bz2 Sensor-Watch-fc31739eb6fdf230a26930e8d42de7a26558aeae.zip |
WIP deep sleep mode
Diffstat (limited to 'watch-library/hal/include/hpl_calendar.h')
-rw-r--r-- | watch-library/hal/include/hpl_calendar.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/watch-library/hal/include/hpl_calendar.h b/watch-library/hal/include/hpl_calendar.h index 16601d3a..87b1a5a8 100644 --- a/watch-library/hal/include/hpl_calendar.h +++ b/watch-library/hal/include/hpl_calendar.h @@ -77,12 +77,7 @@ enum calendar_alarm_mode { ONESHOT = 1, REPEAT }; /** * \brief Prototype of callback on alarm match */ -typedef void (*calendar_drv_cb_alarm_t)(struct calendar_dev *const dev); - -/** - * \brief Prototype of callback on tamper detect - */ -typedef void (*tamper_drv_cb_t)(struct calendar_dev *const dev); +typedef void (*calendar_drv_cb_t)(struct calendar_dev *const dev); /** * \brief Structure of Calendar instance @@ -91,9 +86,11 @@ struct calendar_dev { /** Pointer to the hardware base */ void *hw; /** Alarm match callback */ - calendar_drv_cb_alarm_t callback; + calendar_drv_cb_t callback_alarm; /** Tamper callback */ - tamper_drv_cb_t callback_tamper; + calendar_drv_cb_t callback_tamper; + /** Tamper callback */ + calendar_drv_cb_t callback_tick; /** IRQ struct */ struct _irq_descriptor irq; }; @@ -236,7 +233,7 @@ uint32_t _calendar_get_comp(struct calendar_dev *const dev); * * \return ERR_NONE on success, or an error code on failure. */ -int32_t _calendar_register_callback(struct calendar_dev *const dev, calendar_drv_cb_alarm_t callback); +int32_t _calendar_register_callback(struct calendar_dev *const dev, calendar_drv_cb_t callback); /** * \brief Set calendar IRQ @@ -246,6 +243,16 @@ int32_t _calendar_register_callback(struct calendar_dev *const dev, calendar_drv void _calendar_set_irq(struct calendar_dev *const dev); /** + * \brief Register callback for 1Hz tick from prescaler + * + * \param[in] dev The pointer to calendar device struct + * \param[in] callback The pointer to callback function + * + * \return ERR_NONE on success, or an error code on failure. + */ +int32_t _prescaler_register_callback(struct calendar_dev *const dev, calendar_drv_cb_t callback); + +/** * \brief Register callback for tamper detection * * \param[in] dev The pointer to calendar device struct @@ -253,7 +260,7 @@ void _calendar_set_irq(struct calendar_dev *const dev); * * \return ERR_NONE on success, or an error code on failure. */ -int32_t _tamper_register_callback(struct calendar_dev *const dev, tamper_drv_cb_t callback_tamper); +int32_t _extwake_register_callback(struct calendar_dev *const dev, calendar_drv_cb_t callback); /** * \brief Find tamper is detected on specified pin |