STM8S/A Standard Peripherals Firmware Library
|
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:
-
NewState Indicates 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.
Referenced by main().
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_Frequency Frequency 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 assert_param, BEEP, BEEP_CALIBRATION_DEFAULT, BEEP_CSR_BEEPDIV, BEEP_CSR_BEEPSEL, and IS_BEEP_FREQUENCY_OK.
Referenced by main().
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:
-
LSIFreqHz Low 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 assert_param, BEEP, BEEP_CSR_BEEPDIV, and IS_LSI_FREQUENCY_OK.
Referenced by main().