WebRadioApp  0.1
Collaboration diagram for EW_BSP_CLOCK:

Macros

#define RTC_CLOCK_SOURCE_LSI
 
#define RTC_ASYNCH_PREDIV   0x7F
 
#define RTC_SYNCH_PREDIV   0xF9
 
#define RtcTicksPerSecond   (1UL)
 
#define RtcTicksPerMinute   (RtcTicksPerSecond * 60UL)
 
#define RtcTicksPerHour   (RtcTicksPerMinute * 60UL)
 
#define RtcTicksPerDay   (RtcTicksPerHour * 24UL)
 
#define CPU_LOAD_SET_IDLE()
 
#define CPU_LOAD_SET_ACTIVE()
 

Functions

void HAL_RTC_MspInit (RTC_HandleTypeDef *hrtc)
 RTC MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_RTC_MspDeInit (RTC_HandleTypeDef *hrtc)
 RTC MSP De-Initialization This function frees the hardware resources used in this example: More...
 
void EwBspClockInit (void)
 Initialises the system clock and the real time clock. More...
 
void EwBspClockTickIncrement (void)
 The function EwBspClockTickIncrement increments the millisecond counter, which is used by the Runtime Environment (RTE) to trigger timer events. More...
 
unsigned long EwBspClockGetTicks (void)
 The function EwBspClockGetTicks returns the current ticks counter value. More...
 
unsigned long EwBspClockGetTime (void)
 Returns the current time in seconds since 01.01.1970. More...
 
void EwBspClockSetTime (unsigned long aTime)
 Sets the given time in seconds since 01.01.1970 at real time clock (RTC). More...
 
int EwBspClockGetCpuLoad (void)
 Returns the current CPU load as percent value. More...
 
void EwBspClockCpuLoadSetActive (void)
 Starts the CPU load counting. Call this function whenever CPU processing is needed. More...
 
void EwBspClockCpuLoadSetIdle (void)
 Stops the CPU load counting. Call this function whenever CPU processing is currently not needed since the program execution is waiting for some system event. More...
 

Variables

const unsigned long DaysToMonth []
 
const unsigned long DaysToMonthInLeapYear []
 
static volatile unsigned long EmWiSystemTicks = 0
 
static RTC_HandleTypeDef RtcHandle
 
volatile int XTAL_Min
 
volatile int XTAL_Hour
 
volatile int XTAL_Sec
 
volatile int XTAL_Day
 
volatile int XTAL_Month
 
volatile int XTAL_Year
 

Detailed Description

Macro Definition Documentation

◆ CPU_LOAD_SET_ACTIVE

#define CPU_LOAD_SET_ACTIVE ( )

◆ CPU_LOAD_SET_IDLE

#define CPU_LOAD_SET_IDLE ( )

◆ RTC_ASYNCH_PREDIV

#define RTC_ASYNCH_PREDIV   0x7F

◆ RTC_CLOCK_SOURCE_LSI

#define RTC_CLOCK_SOURCE_LSI

< Defines to select adaquate clock source

◆ RTC_SYNCH_PREDIV

#define RTC_SYNCH_PREDIV   0xF9

◆ RtcTicksPerDay

#define RtcTicksPerDay   (RtcTicksPerHour * 24UL)

◆ RtcTicksPerHour

#define RtcTicksPerHour   (RtcTicksPerMinute * 60UL)

◆ RtcTicksPerMinute

#define RtcTicksPerMinute   (RtcTicksPerSecond * 60UL)

◆ RtcTicksPerSecond

#define RtcTicksPerSecond   (1UL)

Function Documentation

◆ EwBspClockCpuLoadSetActive()

void EwBspClockCpuLoadSetActive ( void  )

Starts the CPU load counting. Call this function whenever CPU processing is needed.


◆ EwBspClockCpuLoadSetIdle()

void EwBspClockCpuLoadSetIdle ( void  )

Stops the CPU load counting. Call this function whenever CPU processing is currently not needed since the program execution is waiting for some system event.


◆ EwBspClockGetCpuLoad()

int EwBspClockGetCpuLoad ( void  )

Returns the current CPU load as percent value.

Returns
int - The current CPU load.

◆ EwBspClockGetTicks()

unsigned long EwBspClockGetTicks ( void  )

The function EwBspClockGetTicks returns the current ticks counter value.

Returns
unsigned long - The current ticks counter value.

References EmWiSystemTicks.

Here is the caller graph for this function:

◆ EwBspClockGetTime()

unsigned long EwBspClockGetTime ( void  )

Returns the current time in seconds since 01.01.1970.

Returns
unsigned long - The current time in seconds since 01.01.1970.

References DaysToMonth, DaysToMonthInLeapYear, RtcHandle, RtcTicksPerDay, RtcTicksPerHour, and RtcTicksPerMinute.

Here is the caller graph for this function:

◆ EwBspClockInit()

void EwBspClockInit ( void  )

Initialises the system clock and the real time clock.


References EmWiSystemTicks, RTC_ASYNCH_PREDIV, RTC_SYNCH_PREDIV, RtcHandle, and SystemCoreClock.

Here is the caller graph for this function:

◆ EwBspClockSetTime()

void EwBspClockSetTime ( unsigned long  aTime)

Sets the given time in seconds since 01.01.1970 at real time clock (RTC).

Parameters
aTimeaTime - the time in seconds since 01.01.1970 to set in real time clock.

References RtcHandle, XTAL_Day, XTAL_Hour, XTAL_Min, XTAL_Month, XTAL_Sec, and XTAL_Year.

Here is the caller graph for this function:

◆ EwBspClockTickIncrement()

void EwBspClockTickIncrement ( void  )

The function EwBspClockTickIncrement increments the millisecond counter, which is used by the Runtime Environment (RTE) to trigger timer events.


References EmWiSystemTicks.

Here is the caller graph for this function:

◆ HAL_RTC_MspDeInit()

void HAL_RTC_MspDeInit ( RTC_HandleTypeDef *  hrtc)

RTC MSP De-Initialization This function frees the hardware resources used in this example:

  • Disable the Peripheral's clock
    Parameters
    hrtcRTC handle pointer
    Return values
    None

◆ HAL_RTC_MspInit()

void HAL_RTC_MspInit ( RTC_HandleTypeDef *  hrtc)

RTC MSP Initialization This function configures the hardware resources used in this example.

Parameters
hrtcRTC handle pointer
Note
Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select the RTC clock source; in this case the Backup domain will be reset in order to modify the RTC Clock source, as consequence RTC registers (including the backup registers) and RCC_BDCR register are set to their reset values.
Return values
None

References PeriphClkInitStruct.

Variable Documentation

◆ DaysToMonth

const unsigned long DaysToMonth[]
Initial value:
= {0, 31, 59, 90, 120, 151, 181,
212, 243, 273, 304, 334, 365}

◆ DaysToMonthInLeapYear

const unsigned long DaysToMonthInLeapYear[]
Initial value:
= {
0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}

timer tick for Embedded Wizard UI applications

◆ EmWiSystemTicks

volatile unsigned long EmWiSystemTicks = 0
static

RTC handler declaration

◆ RtcHandle

RTC_HandleTypeDef RtcHandle
static

◆ XTAL_Day

volatile int XTAL_Day

◆ XTAL_Hour

volatile int XTAL_Hour

◆ XTAL_Min

volatile int XTAL_Min

◆ XTAL_Month

volatile int XTAL_Month

◆ XTAL_Sec

volatile int XTAL_Sec

◆ XTAL_Year

volatile int XTAL_Year