Skip to content

AliOS Things API HAL SOC RTC Guide

librae8226 edited this page Mar 1, 2018 · 1 revision

API INDEX


1-hal_rtc_init

void hal_rtc_init(rtc_dev_t *rtc)
  • Description

    This function will initialize the on board CPU real time clock

  • Parameters

    IN/OUT NAME DESC
    [in] rtc rtc device
  • Returns

    0 : on success, EIO : if an error occurred with any step

2-hal_rtc_get_time

int32_t hal_rtc_get_time(rtc_dev_t *rtc, rtc_time_t *time)
  • Description

    This function will return the value of time read from the on board CPU real time clock.

  • Parameters

    IN/OUT NAME DESC
    [in] rtc rtc device
    [out] time pointer to a time structure
  • Returns

    0 : on success, EIO : if an error occurred with any step

3-hal_rtc_set_time

int32_t hal_rtc_set_time(rtc_dev_t *rtc, const rtc_time_t *time)
  • Description

    This function will set MCU RTC time to a new value.

  • Parameters

    IN/OUT NAME DESC
    [in] rtc rtc device
    [out] time pointer to a time structure
  • Returns

    0 : on success, EIO : if an error occurred with any step

4-hal_rtc_finalize

void hal_rtc_finalize(rtc_dev_t *rtc)
  • Description

    This function will finalize the on board CPU real time clock

  • Parameters

    IN/OUT NAME DESC
    [in] rtc rtc device
  • Returns

    0 : on success, EIO : if an error occurred with any step

Clone this wiki locally