Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
110
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

HAL RTC Generic Driver

UM1725

48.2.16HAL_RTC_GetTime

Function Name

HAL_StatusTypeDef HAL_RTC_GetTime (RTC_HandleTypeDef

 

* hrtc, RTC_TimeTypeDef * sTime, uint32_t Format)

Function Description

Gets RTC current time.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

sTime: Pointer to Time structure

 

Format: Specifies the format of the entered parameters. This

 

 

parameter can be one of the following values:

 

 

RTC_FORMAT_BIN: Binary data

 

 

formatRTC_FORMAT_BCD: BCD data format

Return values

 

HAL status

Notes

You must call HAL_RTC_GetDate() after

 

 

HAL_RTC_GetTime() to unlock the values in the higher-order

calendar shadow registers to ensure consistency between the time and date values. Reading RTC current time locks the values in calendar shadow registers until Current date is read.

48.2.17HAL_RTC_SetDate

Function Name

HAL_StatusTypeDef HAL_RTC_SetDate (RTC_HandleTypeDef

 

* hrtc, RTC_DateTypeDef * sDate, uint32_t Format)

Function Description

Sets RTC current date.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

sDate: Pointer to date structure

 

Format: specifies the format of the entered parameters. This

 

 

parameter can be one of the following values:

 

 

RTC_FORMAT_BIN: Binary data

 

 

formatRTC_FORMAT_BCD: BCD data format

Return values

 

HAL status

48.2.18HAL_RTC_GetDate

Function Name

HAL_StatusTypeDef HAL_RTC_GetDate (RTC_HandleTypeDef

 

* hrtc, RTC_DateTypeDef * sDate, uint32_t Format)

Function Description

Gets RTC current date.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

sDate: Pointer to Date structure

 

Format: Specifies the format of the entered parameters. This

 

 

parameter can be one of the following values:

 

 

RTC_FORMAT_BIN: Binary data

 

 

formatRTC_FORMAT_BCD: BCD data format

Return values

 

HAL status

Notes

You must call HAL_RTC_GetDate() after

 

 

HAL_RTC_GetTime() to unlock the values in the higher-order

 

 

calendar shadow registers to ensure consistency between the

620/900

 

DOCID025834 Rev 2

UM1725 HAL RTC Generic Driver

time and date values. Reading RTC current time locks the values in calendar shadow registers until Current date is read.

48.2.19HAL_RTC_SetAlarm

Function Name

HAL_StatusTypeDef HAL_RTC_SetAlarm

 

(RTC_HandleTypeDef * hrtc, RTC_AlarmTypeDef * sAlarm,

 

uint32_t Format)

Function Description

Sets the specified RTC Alarm.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

sAlarm: Pointer to Alarm structure

 

Format: Specifies the format of the entered parameters. This

 

 

parameter can be one of the following values:

 

 

RTC_FORMAT_BIN: Binary data

 

 

formatRTC_FORMAT_BCD: BCD data format

Return values

 

HAL status

48.2.20HAL_RTC_SetAlarm_IT

Function Name

HAL_StatusTypeDef HAL_RTC_SetAlarm_IT

 

(RTC_HandleTypeDef * hrtc, RTC_AlarmTypeDef * sAlarm,

 

uint32_t Format)

Function Description

Sets the specified RTC Alarm with Interrupt.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

sAlarm: Pointer to Alarm structure

 

Format: Specifies the format of the entered parameters. This

 

 

parameter can be one of the following values:

 

 

RTC_FORMAT_BIN: Binary data

 

 

formatRTC_FORMAT_BCD: BCD data format

Return values

 

HAL status

48.2.21HAL_RTC_DeactivateAlarm

Function Name

HAL_StatusTypeDef HAL_RTC_DeactivateAlarm

 

(RTC_HandleTypeDef * hrtc, uint32_t Alarm)

Function Description

Deactivate the specified RTC Alarm.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

Alarm: Specifies the Alarm. This parameter can be one of

 

 

the following values: RTC_ALARM_A:

 

 

AlarmARTC_ALARM_B: AlarmB

Return values

 

HAL status

48.2.22HAL_RTC_GetAlarm

Function Name

HAL_StatusTypeDef HAL_RTC_GetAlarm

 

 

(RTC_HandleTypeDef * hrtc, RTC_AlarmTypeDef * sAlarm,

 

DOCID025834 Rev 2

621/900

HAL RTC Generic Driver

 

UM1725

 

uint32_t Alarm, uint32_t Format)

Function Description

Gets the RTC Alarm value and masks.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

sAlarm: Pointer to Date structure

 

Alarm: Specifies the Alarm. This parameter can be one of

 

 

the following values: RTC_ALARM_A:

 

 

AlarmARTC_ALARM_B: AlarmB

 

Format: Specifies the format of the entered parameters. This

 

 

parameter can be one of the following values:

 

 

RTC_FORMAT_BIN: Binary data

 

 

formatRTC_FORMAT_BCD: BCD data format

Return values

 

HAL status

48.2.23HAL_RTC_AlarmIRQHandler

Function Name

void HAL_RTC_AlarmIRQHandler (RTC_HandleTypeDef * hrtc)

Function Description

This function handles Alarm interrupt request.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

Return values

 

None

48.2.24HAL_RTC_AlarmAEventCallback

Function Name

void HAL_RTC_AlarmAEventCallback (RTC_HandleTypeDef *

 

hrtc)

Function Description

Alarm A callback.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

Return values

 

None

48.2.25HAL_RTC_PollForAlarmAEvent

Function Name

HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent

 

(RTC_HandleTypeDef * hrtc, uint32_t Timeout)

Function Description

This function handles AlarmA Polling request.

Parameters

 

hrtc: pointer to a RTC_HandleTypeDef structure that

 

 

contains the configuration information for RTC.

 

 

Timeout: Timeout duration

Return values

 

HAL status

48.2.26HAL_RTC_WaitForSynchro

Function Name

HAL_StatusTypeDef HAL_RTC_WaitForSynchro

 

(RTC_HandleTypeDef * hrtc)

Function Description

Waits until the RTC Time and Date registers (RTC_TR and

 

RTC_DR) are synchronized with RTC APB clock.

622/900

DOCID025834 Rev 2

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]