STM8S/A Standard Peripherals Drivers: AWU_Exported_Functions

STM8S/A

STM8S/A Standard Peripherals Drivers
AWU_Exported_Functions

Functions

void AWU_Cmd (FunctionalState NewState)
 Enable or disable the AWU peripheral.
void AWU_DeInit (void)
 Deinitializes the AWU peripheral registers to their default reset values.
FlagStatus AWU_GetFlagStatus (void)
 Returns status of the AWU peripheral flag.
void AWU_IdleModeEnable (void)
 Configures AWU in Idle mode to reduce power consumption.
void AWU_Init (AWU_Timebase_TypeDef AWU_TimeBase)
 Initializes the AWU peripheral according to the specified parameters.
void AWU_LSICalibrationConfig (uint32_t LSIFreqHz)
 Update APR register with the measured LSI frequency.

Function Documentation

void AWU_Cmd ( FunctionalState  NewState)

Enable or disable the AWU peripheral.

Parameters:
NewStateIndicates the new state of the AWU peripheral.
Return values:
None
Required preconditions:
Initialisation of AWU and LS RC calibration must be done before.

Definition at line 112 of file stm8s_awu.c.

References AWU, AWU_CSR_AWUEN, and DISABLE.

void AWU_DeInit ( void  )

Deinitializes the AWU peripheral registers to their default reset values.

Parameters:
None
Return values:
None

Definition at line 73 of file stm8s_awu.c.

References AWU, AWU_APR_RESET_VALUE, AWU_CSR_RESET_VALUE, and AWU_TBR_RESET_VALUE.

FlagStatus AWU_GetFlagStatus ( void  )

Returns status of the AWU peripheral flag.

Parameters:
None
Return values:
FlagStatus: Status of the AWU flag. This parameter can be any of the FlagStatus enumeration.

Definition at line 183 of file stm8s_awu.c.

References AWU, AWU_CSR_AWUF, RESET, and SET.

void AWU_IdleModeEnable ( void  )

Configures AWU in Idle mode to reduce power consumption.

Parameters:
None
Return values:
None

Definition at line 168 of file stm8s_awu.c.

References AWU, AWU_CSR_AWUEN, and AWU_TBR_AWUTB.

void AWU_Init ( AWU_Timebase_TypeDef  AWU_TimeBase)

Initializes the AWU peripheral according to the specified parameters.

Parameters:
AWU_TimeBase: Time base selection (interval between AWU interrupts). can be one of the values of AWU_Timebase_TypeDef.
Return values:
None
Required preconditions:
The LS RC calibration must be performed before calling this function.

Definition at line 88 of file stm8s_awu.c.

References APR_Array, AWU, AWU_APR_APR, AWU_CSR_AWUEN, AWU_TBR_AWUTB, IS_AWU_TIMEBASE_OK, and TBR_Array.

void AWU_LSICalibrationConfig ( uint32_t  LSIFreqHz)

Update APR register with the measured LSI frequency.

Note on the APR calculation:
A is the integer part of lsifreqkhz/4 and x the decimal part. x <= A/(1+2A) is equivalent to A >= x(1+2A) and also to 4A >= 4x(1+2A) [F1] but we know that A + x = lsifreqkhz/4 ==> 4x = lsifreqkhz-4A so [F1] can be written : 4A >= (lsifreqkhz-4A)(1+2A)
Parameters:
LSIFreqHzLow Speed RC frequency measured by timer (in Hz).
Return values:
None
Required preconditions:
  • AWU must be disabled to avoid unwanted interrupts.

Definition at line 139 of file stm8s_awu.c.

References AWU, and IS_LSI_FREQUENCY_OK.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com