STM8S/A Standard Peripherals Drivers: BEEP_Public_Functions

STM8S/A Standard Peripherals Library

STM8S/A Standard Peripherals Drivers
BEEP_Public_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_LSICalibrationConfig (uint32_t LSIFreqHz)
 Update CSR register with the measured LSI frequency.

Function Documentation

void BEEP_Cmd ( FunctionalState  NewState)

Enable or disable the BEEP function.

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

Definition at line 91 of file stm8s_beep.c.

References BEEP, BEEP_CSR_BEEPEN, and DISABLE.

void BEEP_DeInit ( void  )

Deinitializes the BEEP peripheral registers to their default reset values.

Parameters:
None
Return values:
None

Definition at line 54 of file stm8s_beep.c.

References BEEP, and BEEP_CSR_RESET_VALUE.

void BEEP_Init ( BEEP_Frequency_TypeDef  BEEP_Frequency)

Initializes the BEEP function according to the specified parameters.

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

Definition at line 67 of file stm8s_beep.c.

References BEEP, BEEP_CALIBRATION_DEFAULT, BEEP_CSR_BEEPDIV, BEEP_CSR_BEEPSEL, and IS_BEEP_FREQUENCY_OK.

void BEEP_LSICalibrationConfig ( uint32_t  LSIFreqHz)

Update CSR 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:
  • BEEP must be disabled to avoid unwanted interrupts.

Definition at line 118 of file stm8s_beep.c.

References BEEP, BEEP_CSR_BEEPDIV, and IS_LSI_FREQUENCY_OK.

STM8 Standard Peripherals Library: Footer

 

 

 

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