STM8L15x Standard Peripherals Drivers: BEEP

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

BEEP driver modules. More...

Modules

 BEEP_Exported_Types
 BEEP_Exported_Constants
 BEEP_Exported_Macros
 BEEP_Private_Functions

Functions

void BEEP_Cmd (FunctionalState NewState)
 Enable or disable the BEEP function.
void BEEP_DeInit (void)
 Deinitializes the BEEP peripheral registers to their default reset values.
void BEEP_Init (BEEP_Frequency_TypeDef BEEP_Frequency)
 Initializes the BEEP function according to the specified parameters.
void BEEP_LSClockToTIMConnectCmd (FunctionalState NewState)
 Enable or disable the LS clock source connection to TIM for measurement.
void BEEP_LSICalibrationConfig (uint32_t LSIFreqHz)
 Update CSR register with the measured LSI frequency.

Detailed Description

BEEP driver modules.


Function Documentation

void BEEP_Cmd ( FunctionalState  NewState)

Enable or disable the BEEP function.

Note:
Initialisation of BEEP and LS RC calibration must be done before.
Parameters:
NewStateIndicates the new state of the BEEP function.
Return values:
None

Definition at line 124 of file stm8l15x_beep.c.

References BEEP, BEEP_CSR2_BEEPEN, DISABLE, and IS_FUNCTIONAL_STATE.

void BEEP_DeInit ( void  )

Deinitializes the BEEP peripheral registers to their default reset values.

Parameters:
None
Return values:
None

Definition at line 86 of file stm8l15x_beep.c.

References BEEP, BEEP_CSR1_RESET_VALUE, and BEEP_CSR2_RESET_VALUE.

void BEEP_Init ( BEEP_Frequency_TypeDef  BEEP_Frequency)

Initializes the BEEP function according to the specified parameters.

Note:
The LS RC calibration must be performed before calling this function.
Parameters:
BEEP_FrequencyFrequency selection. This parameter can be one of the values of BEEP_Frequency_TypeDef.
Return values:
None

Definition at line 99 of file stm8l15x_beep.c.

References BEEP, BEEP_CALIBRATION_DEFAULT, BEEP_CSR2_BEEPDIV, BEEP_CSR2_BEEPSEL, and IS_BEEP_FREQUENCY.

void BEEP_LSClockToTIMConnectCmd ( FunctionalState  NewState)

Enable or disable the LS clock source connection to TIM for measurement.

Parameters:
NewStateIndicates the new state of the LS clock to TIM connection
Return values:
None

Definition at line 172 of file stm8l15x_beep.c.

References BEEP, BEEP_CSR1_MSR, DISABLE, and IS_FUNCTIONAL_STATE.

void BEEP_LSICalibrationConfig ( uint32_t  LSIFreqHz)

Update CSR register with the measured LSI frequency.

Note:
BEEP must be disabled to avoid unwanted interrupts.
Prescaler 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

Definition at line 201 of file stm8l15x_beep.c.

References BEEP, BEEP_CSR2_BEEPDIV, and IS_LSI_FREQUENCY.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com