STM32F0xx Standard Peripherals Firmware Library: RTC_StopWatch

STM32F0xx Standard Peripherals Library

STM32F0xx Standard Peripherals Firmware Library

Defines

#define MESSAGE1   " **** STOPWATCH ****"
#define MESSAGE2   " LEFT | RIGHT "
#define MESSAGE3   " START | GET "
#define MESSAGE4   " Press and hold TAMPER "
#define MESSAGE5   " to reset Backup registers"

Functions

static void Display_Init (void)
 Display Init (LCD)
void EXTI2_3_IRQHandler (void)
 This function handles External lines 3 to 2 interrupt request.
void HardFault_Handler (void)
 This function handles Hard Fault exception.
int main (void)
 Main program.
void NMI_Handler (void)
 This function handles NMI exception.
void PendSV_Handler (void)
 This function handles PendSVC exception.
static void RTC_Config (void)
 Configure the RTC peripheral by selecting the clock source.
Table_TypeDef RTC_Get_Time (uint32_t SecondFrac, RTC_TimeTypeDef *RTC_TimeStructure)
 load the current time and sub second on a table form.
void RTC_IRQHandler (void)
 This function handles Tamper pin interrupt request.
static void RTC_TamperConfig (void)
 RTC Tamper Configuration.
void RTC_Time_Display (uint8_t Line, __IO uint16_t Colorx, Table_TypeDef timetable)
 Displays the current Time on the LCD.
void RTC_Time_InitDisplay (void)
 Initialize the time displays on the LCD.
void SVC_Handler (void)
 This function handles SVCall exception.
void SysTick_Handler (void)
 This function handles SysTick Handler.

Variables

uint32_t BackupIndex
uint32_t BackupIndex = 0
uint32_t BKPDataReg [5]
__IO uint8_t Button_RTC
__IO uint8_t Button_RTC = 0
__IO uint8_t Button_State
__IO uint8_t Button_State = 0
__IO uint32_t CurrentTimeSec = 0
uint8_t i = 0
__IO uint32_t SecondFraction = 0
__IO uint8_t StartEvent
__IO uint8_t StartEvent = 0
__IO uint32_t SubSecFrac = 0

Define Documentation

#define MESSAGE1   " **** STOPWATCH ****"

Definition at line 41 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by Display_Init().

#define MESSAGE2   " LEFT | RIGHT "

Definition at line 42 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by Display_Init().

#define MESSAGE3   " START | GET "

Definition at line 43 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by Display_Init().

#define MESSAGE4   " Press and hold TAMPER "

Definition at line 44 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main().

#define MESSAGE5   " to reset Backup registers"

Definition at line 45 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main().


Function Documentation

static void Display_Init ( void  ) [static]

Display Init (LCD)

Parameters:
None
Return values:
None

Definition at line 371 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

References MESSAGE1, MESSAGE2, and MESSAGE3.

Referenced by main().

void EXTI2_3_IRQHandler ( void  )

This function handles External lines 3 to 2 interrupt request.

Parameters:
None
Return values:
None

Definition at line 136 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c.

References BackupIndex, Button_State, LEFT_ON, RIGHT_ON, and StartEvent.

void HardFault_Handler ( void  )

This function handles Hard Fault exception.

Parameters:
None
Return values:
None

Definition at line 70 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c.

int main ( void  )

Main program.

Parameters:
None
Return values:
None

< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f0xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f0xx.c file

Definition at line 71 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

References BackupIndex, BKPDataReg, Button_RTC, Button_State, CurrentTimeSec, Display_Init(), i, LEFT_ON, MESSAGE4, MESSAGE5, RIGHT_ON, RTC_Config(), RTC_Get_Time(), RTC_TAMP, RTC_TamperConfig(), RTC_Time_Display(), RTC_Time_InitDisplay(), SecondFraction, StartEvent, and SubSecFrac.

void NMI_Handler ( void  )

This function handles NMI exception.

Parameters:
None
Return values:
None

Definition at line 61 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c.

void PendSV_Handler ( void  )

This function handles PendSVC exception.

Parameters:
None
Return values:
None

Definition at line 92 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c.

static void RTC_Config ( void  ) [static]

Configure the RTC peripheral by selecting the clock source.

Parameters:
None
Return values:
None

Definition at line 321 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

References RTC_InitStructure.

Referenced by main().

static Table_TypeDef RTC_Get_Time ( uint32_t  Secondfraction,
RTC_TimeTypeDef *  RTC_TimeStructure 
)

load the current time and sub second on a table form.

Returns the current time and sub second.

Parameters:
SecondFraction,:the sub second fraction .
RTC_TimeStructure: pointer to a RTC_TimeTypeDef structure that contains the current time values.
Return values:
table: return current time and sub second in a table form
Parameters:
Secondfraction,:the sub second fraction.
RTC_TimeStructure: pointer to a RTC_TimeTypeDef structure that contains the current time values.
Return values:
table: return current time and sub second in a table form

Definition at line 289 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

References CurrentTimeSec, and Table_TypeDef::tab.

Referenced by main(), and RTC_TimeStampShow().

void RTC_IRQHandler ( void  )

This function handles Tamper pin interrupt request.

This function handles RTC Auto wake-up interrupt request.

Parameters:
None
Return values:
None

Definition at line 160 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c.

References Button_RTC, and RTC_TAMP.

static void RTC_TamperConfig ( void  ) [static]

RTC Tamper Configuration.

Parameters:
None
Return values:
None

Definition at line 248 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

References EXTI_InitStructure, and NVIC_InitStructure.

Referenced by main().

void RTC_Time_Display ( uint8_t  Line,
__IO uint16_t  Colorx,
Table_TypeDef  timetable 
)

Displays the current Time on the LCD.

Parameters:
Line,:the Line where to display the Current time . This parameter can be one of the following values:
  • Linex: where x can be 0..9
Color_x: specifies the Background Color.
table: the Current time and sub second.
Return values:
None

Definition at line 462 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

References i, and Table_TypeDef::tab.

Referenced by main().

void RTC_Time_InitDisplay ( void  )

Initialize the time displays on the LCD.

Parameters:
None.
Return values:
None

Definition at line 430 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

References i.

Referenced by main().

void SVC_Handler ( void  )

This function handles SVCall exception.

Parameters:
None
Return values:
None

Definition at line 83 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c.

void SysTick_Handler ( void  )

This function handles SysTick Handler.

Parameters:
None
Return values:
None

Definition at line 101 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c.


Variable Documentation

uint32_t BackupIndex
uint32_t BackupIndex = 0
uint32_t BKPDataReg[5]
Initial value:
 { RTC_BKP_DR0, RTC_BKP_DR1, RTC_BKP_DR2, RTC_BKP_DR3, RTC_BKP_DR4
                          }

Definition at line 57 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main().

__IO uint8_t Button_RTC

Definition at line 53 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main(), and RTC_IRQHandler().

__IO uint8_t Button_RTC = 0

Definition at line 53 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main(), and RTC_IRQHandler().

__IO uint8_t Button_State
__IO uint32_t CurrentTimeSec = 0

Definition at line 59 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main(), and RTC_Get_Time().

uint8_t i = 0
__IO uint32_t SecondFraction = 0

Definition at line 48 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main().

__IO uint8_t StartEvent
__IO uint8_t StartEvent = 0
__IO uint32_t SubSecFrac = 0

Definition at line 50 of file STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/main.c.

Referenced by main().

STM32L1xx Standard Peripherals Library: Footer

 

 

 For complete documentation on STM32 Microcontrollers visit www.st.com/STM32