Functions
IO operation functions
Peripheral Driver » HAL Driver » CALENDAR » Functions

IO operation functions. More...

## Functions
hal_status_t | hal_calendar_init_time (calendar_handle_t *p_calendar, calendar_time_t *p_time)
| Initialize the CALENDAR time. More...
hal_status_t | hal_calendar_get_time (calendar_handle_t *p_calendar, calendar_time_t *p_time)
| Get current CALENDAR time. More...
hal_status_t | hal_calendar_set_alarm (calendar_handle_t *p_calendar, calendar_alarm_t *p_alarm)
| Set a CALENDAR date alarm. More...
hal_status_t | hal_calendar_set_tick (calendar_handle_t *p_calendar, uint32_t interval)
| Set a CALENDAR tick alarm. More...
hal_status_t | hal_calendar_disable_event (calendar_handle_t *p_calendar, uint32_t disable_mode)
| Disable CALENDAR alarm event. More...

## Detailed Description

IO operation functions.

      ==============================================================================
                          ##### IO operation functions #####
      ==============================================================================
      [..]
        This section provides functions allowing to:
        (+) Init the CALENDAR time.
        (+) Get the CALENDAR time.
        (+) Set the CALENDAR alarm.
        (+) Disable the CALENDAR alarm.
        (+) Handle CALENDAR interrupt request and associated function callback.

## Function Documentation

## ◆ hal_calendar_disable_event()

hal_status_t hal_calendar_disable_event | ( | calendar_handle_t * | p_calendar,
|  | uint32_t | disable_mode
| ) |  |

Disable CALENDAR alarm event.

Parameters

  [in] | p_calendar | Pointer to a CALENDAR handle which contains the configuration information for the specified CALENDAR module.
  [in] | disable_mode | Disable specified CALENDAR alarm mode. This parameter can be the following values: CALENDAR_ALARM_DISABLE_DATE CALENDAR_ALARM_DISABLE_TICK CALENDAR_ALARM_DISABLE_ALL

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_calendar_get_time()

hal_status_t hal_calendar_get_time | ( | calendar_handle_t * | p_calendar,
|  | calendar_time_t * | p_time
| ) |  |

Get current CALENDAR time.

Parameters

  [in] | p_calendar | Pointer to a CALENDAR handle which contains the configuration information for the specified CALENDAR module.
  [in] | p_time | Pointer to a CALENDAR time struction.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_calendar_init_time()

hal_status_t hal_calendar_init_time | ( | calendar_handle_t * | p_calendar,
|  | calendar_time_t * | p_time
| ) |  |

Initialize the CALENDAR time.

Parameters

  [in] | p_calendar | Pointer to a CALENDAR handle which contains the configuration information for the specified CALENDAR module.
  [in] | p_time | Pointer to a CALENDAR time struction.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_calendar_set_alarm()

hal_status_t hal_calendar_set_alarm | ( | calendar_handle_t * | p_calendar,
|  | calendar_alarm_t * | p_alarm
| ) |  |

Set a CALENDAR date alarm.

Parameters

  [in] | p_calendar | Pointer to a CALENDAR handle which contains the configuration information for the specified CALENDAR module.
  [in] | p_alarm | After seconds will generate an date alarm interrupt.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_calendar_set_tick()

hal_status_t hal_calendar_set_tick | ( | calendar_handle_t * | p_calendar,
|  | uint32_t | interval
| ) |  |

Set a CALENDAR tick alarm.

Parameters

  [in] | p_calendar | Pointer to a CALENDAR handle which contains the configuration information for the specified CALENDAR module.
  [in] | interval | After milliseconds will generate an milliseconds alarm interrupt. The value of interval is greater than or equal to 5ms.(Max: 3600*1000 ms)

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.