Initialization and de-initialization Functions

Initialization and Configuration functions. More...

Functions

hal_status_t hal_rtc_init (rtc_handle_t *p_rtc)
 Initialize the RTC according to the specified parameters in the rtc_init_t of associated handle.counter start after hal_rtc_init. More...
 
hal_status_t hal_rtc_deinit (rtc_handle_t *p_rtc)
 DeInitialize the RTC according to the specified parameters in the rtc_init_t of associated handle.counter stop after hal_rtc_deinit. More...
 
hal_status_t hal_rtc_set_tick_and_start (rtc_handle_t *p_rtc, uint8_t mode, uint32_t value)
 Start counting down for tick module. More...
 
hal_status_t hal_rtc_stop_tick (rtc_handle_t *p_rtc)
 Stop counting down for tick module. More...
 
hal_status_t hal_rtc_restart_tick (rtc_handle_t *p_rtc)
 Restart tick module and continue run with the previous settings. This function need be called after hal_rtc_stop_tick. More...
 
hal_status_t hal_rtc_set_alarm (rtc_handle_t *p_rtc, uint32_t value)
 Compare counter with alarm_value for alarm module. More...
 
hal_status_t hal_rtc_stop_alarm (rtc_handle_t *p_rtc)
 Stop counting up and compare with alarm_value for alarm module. More...
 
hal_status_t hal_rtc_clear_wrap (rtc_handle_t *p_rtc)
 Clear wrap count. More...
 
uint32_t hal_rtc_get_wrap_count (const rtc_handle_t *p_rtc)
 Get the times of overflow. More...
 
uint32_t hal_rtc_get_cur_count (const rtc_handle_t *p_rtc)
 Get_cur_count_value. More...
 
uint32_t hal_rtc_get_cur_tick (const rtc_handle_t *p_rtc)
 Get_cur_tick_value. More...
 
uint32_t hal_rtc_get_alarm_value (const rtc_handle_t *p_rtc)
 Get_alarm_value. More...
 
hal_rtc_state_t hal_rtc_get_state (const rtc_handle_t *p_rtc)
 Get_cur_rtc_state. More...
 

Detailed Description

Initialization and Configuration functions.

Function Documentation

◆ hal_rtc_clear_wrap()

hal_status_t hal_rtc_clear_wrap ( rtc_handle_t p_rtc)

Clear wrap count.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_deinit()

hal_status_t hal_rtc_deinit ( rtc_handle_t p_rtc)

DeInitialize the RTC according to the specified parameters in the rtc_init_t of associated handle.counter stop after hal_rtc_deinit.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_get_alarm_value()

uint32_t hal_rtc_get_alarm_value ( const rtc_handle_t p_rtc)

Get_alarm_value.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
::uint32_t

◆ hal_rtc_get_cur_count()

uint32_t hal_rtc_get_cur_count ( const rtc_handle_t p_rtc)

Get_cur_count_value.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
::uint32_t

◆ hal_rtc_get_cur_tick()

uint32_t hal_rtc_get_cur_tick ( const rtc_handle_t p_rtc)

Get_cur_tick_value.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
::uint32_t

◆ hal_rtc_get_state()

hal_rtc_state_t hal_rtc_get_state ( const rtc_handle_t p_rtc)

Get_cur_rtc_state.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_get_wrap_count()

uint32_t hal_rtc_get_wrap_count ( const rtc_handle_t p_rtc)

Get the times of overflow.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
::uint32_t

◆ hal_rtc_init()

hal_status_t hal_rtc_init ( rtc_handle_t p_rtc)

Initialize the RTC according to the specified parameters in the rtc_init_t of associated handle.counter start after hal_rtc_init.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_restart_tick()

hal_status_t hal_rtc_restart_tick ( rtc_handle_t p_rtc)

Restart tick module and continue run with the previous settings. This function need be called after hal_rtc_stop_tick.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_set_alarm()

hal_status_t hal_rtc_set_alarm ( rtc_handle_t p_rtc,
uint32_t  value 
)

Compare counter with alarm_value for alarm module.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
[in]valueset alarm_value
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_set_tick_and_start()

hal_status_t hal_rtc_set_tick_and_start ( rtc_handle_t p_rtc,
uint8_t  mode,
uint32_t  value 
)

Start counting down for tick module.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
[in]modeONE_TIME/AUTO_RELOAD
[in]valuethe tick start which start counting down
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_stop_alarm()

hal_status_t hal_rtc_stop_alarm ( rtc_handle_t p_rtc)

Stop counting up and compare with alarm_value for alarm module.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rtc_stop_tick()

hal_status_t hal_rtc_stop_tick ( rtc_handle_t p_rtc)

Stop counting down for tick module.

Parameters
[in]p_rtcPointer to a RTC handle which contains the configuration information for the specified RTC module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.