/**************************************************************************** * * Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED. * * This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT * be copied by any method or incorporated into another program without * the express written consent of Aerospace C.Power. This Information or any portion * thereof remains the property of Aerospace C.Power. The Information contained herein * is believed to be accurate and Aerospace C.Power assumes no responsibility or * liability for its use in any way and conveys no license or title under * any patent or copyright and makes no representation or warranty that this * Information is free from patent or copyright infringement. * * ****************************************************************************/ #ifndef IOT_RTC_EXT_API_H #define IOT_RTC_EXT_API_H #ifdef __cplusplus extern "C" { #endif /* iot common header files */ #include "iot_rtc_api.h" /* @brief iot_rtc_ext_get_time() - get time from extern RTC. * @tm: return the time info of the extern RTC * @retval: ERR_OK - set successfully, otherwise - error code */ uint32_t iot_rtc_ext_get_time(iot_time_tm_t *tm); /* @brief iot_rtc_ext_set_time() - set time to extern RTC. * @tm: pointer to the time to be set * @week: week to be set, 0 - sunday, 1 ~ 6 - monday ~ saturday * @retval: ERR_OK - set successfully, otherwise - error code */ uint32_t iot_rtc_ext_set_time(iot_time_tm_t *tm, uint8_t week); /* @brief iot_rtc_ext_is_startup() - check whether extern startup * @tm: if started, return the time info of the extern rtc * @retval: 1 - started, 0 - not startup */ uint32_t iot_rtc_ext_is_startup(iot_time_tm_t *tm); /* @brief iot_rtc_ext_init() - initialize extern RTC. * @tm: set the initial time infor of the extern RTC, if the chip is * powerup. otherwise return the extern RTC time info. * @done: 1 - extern RTC has been started, 0 - not started * @retval: ERR_OK - set successfully, otherwise - error code */ uint32_t iot_rtc_ext_init(iot_time_tm_t *tm, uint32_t *done); /** * @brief iot_rtc_ext_deinit() - deinit extern RTC. */ void iot_rtc_ext_deinit(void); #ifdef __cplusplus } #endif #endif //_IOT_RTC_EXT_API_H_