![]() |
STM32F0 Standard Peripheral bibliotheek
1.0
ST Microelectronics standard peripheral bibliotheek documentatie voor de STM32F0 familie
|
RTC driver modules. More...
Modules | |
| RTC_Exported_Constants | |
| RTC_Private_Functions | |
Data Structures | |
| struct | RTC_InitTypeDef |
| RTC Init structures definition. More... | |
| struct | RTC_TimeTypeDef |
| RTC Time structure definition. More... | |
| struct | RTC_DateTypeDef |
| RTC Date structure definition. More... | |
| struct | RTC_AlarmTypeDef |
| RTC Alarm structure definition. More... | |
Functions | |
| ErrorStatus | RTC_DeInit (void) |
| Deinitializes the RTC registers to their default reset values. More... | |
| ErrorStatus | RTC_Init (RTC_InitTypeDef *RTC_InitStruct) |
| Initializes the RTC registers according to the specified parameters in RTC_InitStruct. More... | |
| void | RTC_StructInit (RTC_InitTypeDef *RTC_InitStruct) |
| Fills each RTC_InitStruct member with its default value. More... | |
| void | RTC_WriteProtectionCmd (FunctionalState NewState) |
| Enables or disables the RTC registers write protection. More... | |
| ErrorStatus | RTC_EnterInitMode (void) |
| Enters the RTC Initialization mode. More... | |
| void | RTC_ExitInitMode (void) |
| Exits the RTC Initialization mode. More... | |
| ErrorStatus | RTC_WaitForSynchro (void) |
| Waits until the RTC Time and Date registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock. More... | |
| ErrorStatus | RTC_RefClockCmd (FunctionalState NewState) |
| Enables or disables the RTC reference clock detection. More... | |
| void | RTC_BypassShadowCmd (FunctionalState NewState) |
| Enables or Disables the Bypass Shadow feature. More... | |
| ErrorStatus | RTC_SetTime (uint32_t RTC_Format, RTC_TimeTypeDef *RTC_TimeStruct) |
| Set the RTC current time. More... | |
| void | RTC_TimeStructInit (RTC_TimeTypeDef *RTC_TimeStruct) |
| Fills each RTC_TimeStruct member with its default value (Time = 00h:00min:00sec). More... | |
| void | RTC_GetTime (uint32_t RTC_Format, RTC_TimeTypeDef *RTC_TimeStruct) |
| Get the RTC current Time. More... | |
| uint32_t | RTC_GetSubSecond (void) |
| Gets the RTC current Calendar Subseconds value. More... | |
| ErrorStatus | RTC_SetDate (uint32_t RTC_Format, RTC_DateTypeDef *RTC_DateStruct) |
| Set the RTC current date. More... | |
| void | RTC_DateStructInit (RTC_DateTypeDef *RTC_DateStruct) |
| Fills each RTC_DateStruct member with its default value (Monday, January 01 xx00). More... | |
| void | RTC_GetDate (uint32_t RTC_Format, RTC_DateTypeDef *RTC_DateStruct) |
| Get the RTC current date. More... | |
| void | RTC_SetAlarm (uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef *RTC_AlarmStruct) |
| Set the specified RTC Alarm. More... | |
| void | RTC_AlarmStructInit (RTC_AlarmTypeDef *RTC_AlarmStruct) |
| Fills each RTC_AlarmStruct member with its default value (Time = 00h:00mn:00sec / Date = 1st day of the month/Mask = all fields are masked). More... | |
| void | RTC_GetAlarm (uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef *RTC_AlarmStruct) |
| Get the RTC Alarm value and masks. More... | |
| ErrorStatus | RTC_AlarmCmd (uint32_t RTC_Alarm, FunctionalState NewState) |
| Enables or disables the specified RTC Alarm. More... | |
| void | RTC_AlarmSubSecondConfig (uint32_t RTC_Alarm, uint32_t RTC_AlarmSubSecondValue, uint8_t RTC_AlarmSubSecondMask) |
| Configure the RTC AlarmA/B Subseconds value and mask. More... | |
| uint32_t | RTC_GetAlarmSubSecond (uint32_t RTC_Alarm) |
| Gets the RTC Alarm Subseconds value. More... | |
| void | RTC_DayLightSavingConfig (uint32_t RTC_DayLightSaving, uint32_t RTC_StoreOperation) |
| Adds or substract one hour from the current time. More... | |
| uint32_t | RTC_GetStoreOperation (void) |
| Returns the RTC Day Light Saving stored operation. More... | |
| void | RTC_OutputConfig (uint32_t RTC_Output, uint32_t RTC_OutputPolarity) |
| Configures the RTC output source (AFO_ALARM). More... | |
| void | RTC_CalibOutputCmd (FunctionalState NewState) |
| Enables or disables the RTC clock to be output through the relative pin. More... | |
| void | RTC_CalibOutputConfig (uint32_t RTC_CalibOutput) |
| Configure the Calibration Pinout (RTC_CALIB) Selection (1Hz or 512Hz). More... | |
| ErrorStatus | RTC_SmoothCalibConfig (uint32_t RTC_SmoothCalibPeriod, uint32_t RTC_SmoothCalibPlusPulses, uint32_t RTC_SmouthCalibMinusPulsesValue) |
| Configures the Smooth Calibration Settings. More... | |
| void | RTC_TimeStampCmd (uint32_t RTC_TimeStampEdge, FunctionalState NewState) |
| Enables or Disables the RTC TimeStamp functionality with the specified time stamp pin stimulating edge. More... | |
| void | RTC_GetTimeStamp (uint32_t RTC_Format, RTC_TimeTypeDef *RTC_StampTimeStruct, RTC_DateTypeDef *RTC_StampDateStruct) |
| Get the RTC TimeStamp value and masks. More... | |
| uint32_t | RTC_GetTimeStampSubSecond (void) |
| Get the RTC timestamp Subseconds value. More... | |
| void | RTC_TamperTriggerConfig (uint32_t RTC_Tamper, uint32_t RTC_TamperTrigger) |
| Configures the select Tamper pin edge. More... | |
| void | RTC_TamperCmd (uint32_t RTC_Tamper, FunctionalState NewState) |
| Enables or Disables the Tamper detection. More... | |
| void | RTC_TamperFilterConfig (uint32_t RTC_TamperFilter) |
| Configures the Tampers Filter. More... | |
| void | RTC_TamperSamplingFreqConfig (uint32_t RTC_TamperSamplingFreq) |
| Configures the Tampers Sampling Frequency. More... | |
| void | RTC_TamperPinsPrechargeDuration (uint32_t RTC_TamperPrechargeDuration) |
| Configures the Tampers Pins input Precharge Duration. More... | |
| void | RTC_TimeStampOnTamperDetectionCmd (FunctionalState NewState) |
| Enables or Disables the TimeStamp on Tamper Detection Event. More... | |
| void | RTC_TamperPullUpCmd (FunctionalState NewState) |
| Enables or Disables the Precharge of Tamper pin. More... | |
| void | RTC_WriteBackupRegister (uint32_t RTC_BKP_DR, uint32_t Data) |
| Writes a data in a specified RTC Backup data register. More... | |
| uint32_t | RTC_ReadBackupRegister (uint32_t RTC_BKP_DR) |
| Reads data from the specified RTC Backup data Register. More... | |
| void | RTC_OutputTypeConfig (uint32_t RTC_OutputType) |
| Configures the RTC Output Pin mode. More... | |
| ErrorStatus | RTC_SynchroShiftConfig (uint32_t RTC_ShiftAdd1S, uint32_t RTC_ShiftSubFS) |
| Configures the Synchronization Shift Control Settings. More... | |
| void | RTC_ITConfig (uint32_t RTC_IT, FunctionalState NewState) |
| Enables or disables the specified RTC interrupts. More... | |
| FlagStatus | RTC_GetFlagStatus (uint32_t RTC_FLAG) |
| Checks whether the specified RTC flag is set or not. More... | |
| void | RTC_ClearFlag (uint32_t RTC_FLAG) |
| Clears the RTC's pending flags. More... | |
| ITStatus | RTC_GetITStatus (uint32_t RTC_IT) |
| Checks whether the specified RTC interrupt has occurred or not. More... | |
| void | RTC_ClearITPendingBit (uint32_t RTC_IT) |
| Clears the RTC's interrupt pending bits. More... | |
RTC driver modules.
| #define RTC_FLAGS_MASK |
| ErrorStatus RTC_AlarmCmd | ( | uint32_t | RTC_Alarm, |
| FunctionalState | NewState | ||
| ) |
Enables or disables the specified RTC Alarm.
| RTC_Alarm,: | specifies the alarm to be configured. This parameter can be any combination of the following values:
|
| NewState,: | new state of the specified alarm. This parameter can be: ENABLE or DISABLE. |
| An | ErrorStatus enumeration value:
|
| void RTC_AlarmStructInit | ( | RTC_AlarmTypeDef * | RTC_AlarmStruct | ) |
Fills each RTC_AlarmStruct member with its default value (Time = 00h:00mn:00sec / Date = 1st day of the month/Mask = all fields are masked).
| RTC_AlarmStruct,: | pointer to a RTC_AlarmTypeDef structure which will be initialized. |
| None |
| void RTC_AlarmSubSecondConfig | ( | uint32_t | RTC_Alarm, |
| uint32_t | RTC_AlarmSubSecondValue, | ||
| uint8_t | RTC_AlarmSubSecondMask | ||
| ) |
Configure the RTC AlarmA/B Subseconds value and mask.
| RTC_Alarm,: | specifies the alarm to be configured. This parameter can be one of the following values:
|
| RTC_AlarmSubSecondValue,: | specifies the Subseconds value. This parameter can be a value from 0 to 0x00007FFF. |
| RTC_AlarmSubSecondMask,: | specifies the Subseconds Mask. This parameter can be any combination of the following values:
|
| None |
| void RTC_BypassShadowCmd | ( | FunctionalState | NewState | ) |
Enables or Disables the Bypass Shadow feature.
| NewState,: | new state of the Bypass Shadow feature. This parameter can be: ENABLE or DISABLE. |
| None |
| void RTC_CalibOutputCmd | ( | FunctionalState | NewState | ) |
Enables or disables the RTC clock to be output through the relative pin.
| NewState,: | new state of the digital calibration Output. This parameter can be: ENABLE or DISABLE. |
| None |
| void RTC_CalibOutputConfig | ( | uint32_t | RTC_CalibOutput | ) |
Configure the Calibration Pinout (RTC_CALIB) Selection (1Hz or 512Hz).
| RTC_CalibOutput,: | Select the Calibration output Selection . This parameter can be one of the following values:
|
| None |
| void RTC_ClearFlag | ( | uint32_t | RTC_FLAG | ) |
Clears the RTC's pending flags.
| RTC_FLAG,: | specifies the RTC flag to clear. This parameter can be any combination of the following values:
|
| None |
| void RTC_ClearITPendingBit | ( | uint32_t | RTC_IT | ) |
Clears the RTC's interrupt pending bits.
| RTC_IT,: | specifies the RTC interrupt pending bit to clear. This parameter can be any combination of the following values:
|
| None |
| void RTC_DateStructInit | ( | RTC_DateTypeDef * | RTC_DateStruct | ) |
Fills each RTC_DateStruct member with its default value (Monday, January 01 xx00).
| RTC_DateStruct,: | pointer to a RTC_DateTypeDef structure which will be initialized. |
| None |
| void RTC_DayLightSavingConfig | ( | uint32_t | RTC_DayLightSaving, |
| uint32_t | RTC_StoreOperation | ||
| ) |
Adds or substract one hour from the current time.
| RTC_DayLightSaveOperation,: | the value of hour adjustment. This parameter can be one of the following values:
|
| RTC_StoreOperation,: | Specifies the value to be written in the BCK bit in CR register to store the operation. This parameter can be one of the following values:
|
| None |
| ErrorStatus RTC_DeInit | ( | void | ) |
Deinitializes the RTC registers to their default reset values.
| None |
| An | ErrorStatus enumeration value:
|
| ErrorStatus RTC_EnterInitMode | ( | void | ) |
Enters the RTC Initialization mode.
| None |
| An | ErrorStatus enumeration value:
|
| void RTC_ExitInitMode | ( | void | ) |
Exits the RTC Initialization mode.
| None |
| None |
| void RTC_GetAlarm | ( | uint32_t | RTC_Format, |
| uint32_t | RTC_Alarm, | ||
| RTC_AlarmTypeDef * | RTC_AlarmStruct | ||
| ) |
Get the RTC Alarm value and masks.
| RTC_Format,: | specifies the format of the output parameters. This parameter can be one of the following values:
|
| RTC_Alarm,: | specifies the alarm to be read. This parameter can be one of the following values:
|
| RTC_AlarmStruct,: | pointer to a RTC_AlarmTypeDef structure that will contains the output alarm configuration values. |
| None |
| uint32_t RTC_GetAlarmSubSecond | ( | uint32_t | RTC_Alarm | ) |
Gets the RTC Alarm Subseconds value.
| RTC_Alarm,: | specifies the alarm to be read. This parameter can be one of the following values:
|
| None |
| RTC | Alarm Subseconds value. |
| void RTC_GetDate | ( | uint32_t | RTC_Format, |
| RTC_DateTypeDef * | RTC_DateStruct | ||
| ) |
Get the RTC current date.
| RTC_Format,: | specifies the format of the returned parameters. This parameter can be one of the following values:
|
| RTC_DateStruct,: | pointer to a RTC_DateTypeDef structure that will contain the returned current date configuration. |
| None |
| FlagStatus RTC_GetFlagStatus | ( | uint32_t | RTC_FLAG | ) |
Checks whether the specified RTC flag is set or not.
| RTC_FLAG,: | specifies the flag to check. This parameter can be one of the following values:
|
| The | new state of RTC_FLAG (SET or RESET). |
| ITStatus RTC_GetITStatus | ( | uint32_t | RTC_IT | ) |
Checks whether the specified RTC interrupt has occurred or not.
| RTC_IT,: | specifies the RTC interrupt source to check. This parameter can be one of the following values:
|
| The | new state of RTC_IT (SET or RESET). |
| uint32_t RTC_GetStoreOperation | ( | void | ) |
Returns the RTC Day Light Saving stored operation.
| None |
| RTC | Day Light Saving stored operation.
|
| uint32_t RTC_GetSubSecond | ( | void | ) |
Gets the RTC current Calendar Subseconds value.
| None |
| RTC | current Calendar Subseconds value. |
| void RTC_GetTime | ( | uint32_t | RTC_Format, |
| RTC_TimeTypeDef * | RTC_TimeStruct | ||
| ) |
Get the RTC current Time.
| RTC_Format,: | specifies the format of the returned parameters. This parameter can be one of the following values:
|
| RTC_TimeStruct,: | pointer to a RTC_TimeTypeDef structure that will contain the returned current time configuration. |
| None |
| void RTC_GetTimeStamp | ( | uint32_t | RTC_Format, |
| RTC_TimeTypeDef * | RTC_StampTimeStruct, | ||
| RTC_DateTypeDef * | RTC_StampDateStruct | ||
| ) |
Get the RTC TimeStamp value and masks.
| RTC_Format,: | specifies the format of the output parameters. This parameter can be one of the following values:
|
| RTC_StampTimeStruct,: | pointer to a RTC_TimeTypeDef structure that will contains the TimeStamp time values. |
| RTC_StampDateStruct,: | pointer to a RTC_DateTypeDef structure that will contains the TimeStamp date values. |
| None |
| uint32_t RTC_GetTimeStampSubSecond | ( | void | ) |
Get the RTC timestamp Subseconds value.
| None |
| RTC | current timestamp Subseconds value. |
| ErrorStatus RTC_Init | ( | RTC_InitTypeDef * | RTC_InitStruct | ) |
Initializes the RTC registers according to the specified parameters in RTC_InitStruct.
| RTC_InitStruct,: | pointer to a RTC_InitTypeDef structure that contains the configuration information for the RTC peripheral. |
| An | ErrorStatus enumeration value:
|
| void RTC_ITConfig | ( | uint32_t | RTC_IT, |
| FunctionalState | NewState | ||
| ) |
Enables or disables the specified RTC interrupts.
| RTC_IT,: | specifies the RTC interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
|
| NewState,: | new state of the specified RTC interrupts. This parameter can be: ENABLE or DISABLE. |
| None |
| void RTC_OutputConfig | ( | uint32_t | RTC_Output, |
| uint32_t | RTC_OutputPolarity | ||
| ) |
Configures the RTC output source (AFO_ALARM).
| RTC_Output,: | Specifies which signal will be routed to the RTC output. This parameter can be one of the following values:
|
| RTC_OutputPolarity,: | Specifies the polarity of the output signal. This parameter can be one of the following:
|
| None |
| void RTC_OutputTypeConfig | ( | uint32_t | RTC_OutputType | ) |
Configures the RTC Output Pin mode.
| RTC_OutputType,: | specifies the RTC Output (PC13) pin mode. This parameter can be one of the following values:
|
| None |
| uint32_t RTC_ReadBackupRegister | ( | uint32_t | RTC_BKP_DR | ) |
Reads data from the specified RTC Backup data Register.
| RTC_BKP_DR,: | RTC Backup data Register number. This parameter can be: RTC_BKP_DRx where x can be from 0 to 19 to specify the register. |
| None |
| ErrorStatus RTC_RefClockCmd | ( | FunctionalState | NewState | ) |
Enables or disables the RTC reference clock detection.
| NewState,: | new state of the RTC reference clock. This parameter can be: ENABLE or DISABLE. |
| An | ErrorStatus enumeration value:
|
| void RTC_SetAlarm | ( | uint32_t | RTC_Format, |
| uint32_t | RTC_Alarm, | ||
| RTC_AlarmTypeDef * | RTC_AlarmStruct | ||
| ) |
Set the specified RTC Alarm.
| RTC_Format,: | specifies the format of the returned parameters. This parameter can be one of the following values:
|
| RTC_Alarm,: | specifies the alarm to be configured. This parameter can be one of the following values:
|
| RTC_AlarmStruct,: | pointer to a RTC_AlarmTypeDef structure that contains the alarm configuration parameters. |
| None |
| ErrorStatus RTC_SetDate | ( | uint32_t | RTC_Format, |
| RTC_DateTypeDef * | RTC_DateStruct | ||
| ) |
Set the RTC current date.
| RTC_Format,: | specifies the format of the entered parameters. This parameter can be one of the following values:
|
| RTC_DateStruct,: | pointer to a RTC_DateTypeDef structure that contains the date configuration information for the RTC. |
| An | ErrorStatus enumeration value:
|
| ErrorStatus RTC_SetTime | ( | uint32_t | RTC_Format, |
| RTC_TimeTypeDef * | RTC_TimeStruct | ||
| ) |
Set the RTC current time.
| RTC_Format,: | specifies the format of the entered parameters. This parameter can be one of the following values:
|
| RTC_TimeStruct,: | pointer to a RTC_TimeTypeDef structure that contains the time configuration information for the RTC. |
| An | ErrorStatus enumeration value:
|
| ErrorStatus RTC_SmoothCalibConfig | ( | uint32_t | RTC_SmoothCalibPeriod, |
| uint32_t | RTC_SmoothCalibPlusPulses, | ||
| uint32_t | RTC_SmouthCalibMinusPulsesValue | ||
| ) |
Configures the Smooth Calibration Settings.
| RTC_SmoothCalibPeriod,: | Select the Smooth Calibration Period. This parameter can be can be one of the following values:
|
| RTC_SmoothCalibPlusPulses,: | Select to Set or reset the CALP bit. This parameter can be one of the following values:
|
| RTC_SmouthCalibMinusPulsesValue,: | Select the value of CALM[8:0] bits. This parameter can be one any value from 0 to 0x000001FF. |
| An | ErrorStatus enumeration value:
|
| void RTC_StructInit | ( | RTC_InitTypeDef * | RTC_InitStruct | ) |
Fills each RTC_InitStruct member with its default value.
| RTC_InitStruct,: | pointer to a RTC_InitTypeDef structure which will be initialized. |
| None |
| ErrorStatus RTC_SynchroShiftConfig | ( | uint32_t | RTC_ShiftAdd1S, |
| uint32_t | RTC_ShiftSubFS | ||
| ) |
Configures the Synchronization Shift Control Settings.
| RTC_ShiftAdd1S,: | Select to add or not 1 second to the time Calendar. This parameter can be one of the following values :
|
| RTC_ShiftSubFS,: | Select the number of Second Fractions to Substitute. This parameter can be one any value from 0 to 0x7FFF. |
| An | ErrorStatus enumeration value:
|
| void RTC_TamperCmd | ( | uint32_t | RTC_Tamper, |
| FunctionalState | NewState | ||
| ) |
Enables or Disables the Tamper detection.
| RTC_Tamper,: | Selected tamper pin. This parameter can be any combination of the following values:
|
| NewState,: | new state of the tamper pin. This parameter can be: ENABLE or DISABLE. |
| None |
| void RTC_TamperFilterConfig | ( | uint32_t | RTC_TamperFilter | ) |
Configures the Tampers Filter.
| RTC_TamperFilter,: | Specifies the tampers filter. This parameter can be one of the following values:
|
| None |
| void RTC_TamperPinsPrechargeDuration | ( | uint32_t | RTC_TamperPrechargeDuration | ) |
Configures the Tampers Pins input Precharge Duration.
| RTC_TamperPrechargeDuration,: | Specifies the Tampers Pins input Precharge Duration. This parameter can be one of the following values:
|
| None |
| void RTC_TamperPullUpCmd | ( | FunctionalState | NewState | ) |
Enables or Disables the Precharge of Tamper pin.
| NewState,: | new state of tamper pull up. This parameter can be: ENABLE or DISABLE. |
| None |
| void RTC_TamperSamplingFreqConfig | ( | uint32_t | RTC_TamperSamplingFreq | ) |
Configures the Tampers Sampling Frequency.
| RTC_TamperSamplingFreq,: | Specifies the tampers Sampling Frequency. This parameter can be one of the following values:
|
| None |
| void RTC_TamperTriggerConfig | ( | uint32_t | RTC_Tamper, |
| uint32_t | RTC_TamperTrigger | ||
| ) |
Configures the select Tamper pin edge.
| RTC_Tamper,: | Selected tamper pin. This parameter can be any combination of the following values:
|
| RTC_TamperTrigger,: | Specifies the trigger on the tamper pin that stimulates tamper event. This parameter can be one of the following values:
|
| None |
| void RTC_TimeStampCmd | ( | uint32_t | RTC_TimeStampEdge, |
| FunctionalState | NewState | ||
| ) |
Enables or Disables the RTC TimeStamp functionality with the specified time stamp pin stimulating edge.
| RTC_TimeStampEdge,: | Specifies the pin edge on which the TimeStamp is activated. This parameter can be one of the following:
|
| NewState,: | new state of the TimeStamp. This parameter can be: ENABLE or DISABLE. |
| None |
| void RTC_TimeStampOnTamperDetectionCmd | ( | FunctionalState | NewState | ) |
Enables or Disables the TimeStamp on Tamper Detection Event.
| NewState,: | new state of the timestamp on tamper event. This parameter can be: ENABLE or DISABLE. |
| None |
| void RTC_TimeStructInit | ( | RTC_TimeTypeDef * | RTC_TimeStruct | ) |
Fills each RTC_TimeStruct member with its default value (Time = 00h:00min:00sec).
| RTC_TimeStruct,: | pointer to a RTC_TimeTypeDef structure which will be initialized. |
| None |
| ErrorStatus RTC_WaitForSynchro | ( | void | ) |
Waits until the RTC Time and Date registers (RTC_TR and RTC_DR) are synchronized with RTC APB clock.
| None |
| An | ErrorStatus enumeration value:
|
| void RTC_WriteBackupRegister | ( | uint32_t | RTC_BKP_DR, |
| uint32_t | Data | ||
| ) |
Writes a data in a specified RTC Backup data register.
| RTC_BKP_DR,: | RTC Backup data Register number. This parameter can be: RTC_BKP_DRx where x can be from 0 to 4 to specify the register. |
| Data,: | Data to be written in the specified RTC Backup data register. |
| None |
| void RTC_WriteProtectionCmd | ( | FunctionalState | NewState | ) |
Enables or disables the RTC registers write protection.
| NewState,: | new state of the write protection. This parameter can be: ENABLE or DISABLE. |
| None |