STM8L15x Standard Peripherals Drivers: stm8l15x_beep.h Source File

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

stm8l15x_beep.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm8l15x_beep.h
00004   * @author  MCD Application Team
00005   * @version V1.5.0
00006   * @date    13-May-2011
00007   * @brief   This file contains all the functions prototypes for the BEEP firmware
00008   *          library.
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
00020   ******************************************************************************  
00021   */
00022 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __STM8L15x_BEEP_H
00025 #define __STM8L15x_BEEP_H
00026 
00027 /* Includes ------------------------------------------------------------------*/
00028 #include "stm8l15x.h"
00029 
00030 /** @addtogroup STM8L15x_StdPeriph_Driver
00031   * @{
00032   */
00033   
00034 /** @addtogroup BEEP
00035   * @{
00036   */ 
00037   
00038 /* Exported types ------------------------------------------------------------*/
00039 /** @defgroup BEEP_Exported_Types
00040   * @{
00041   */
00042   
00043 /** @defgroup BEEP_Frequency
00044   * @{
00045   */
00046 typedef enum {
00047   BEEP_Frequency_1KHz = (uint8_t)0x00,  /*!< Beep signal output frequency 1 KHz */
00048   BEEP_Frequency_2KHz = (uint8_t)0x40,  /*!< Beep signal output frequency 2 KHz */
00049   BEEP_Frequency_4KHz = (uint8_t)0x80   /*!< Beep signal output frequency 4 KHz */
00050 } BEEP_Frequency_TypeDef;
00051 
00052 #define IS_BEEP_FREQUENCY(FREQ) (((FREQ) == BEEP_Frequency_1KHz) || \
00053                                  ((FREQ) == BEEP_Frequency_2KHz) || \
00054                                  ((FREQ) == BEEP_Frequency_4KHz))
00055  
00056 /**
00057   * @}
00058   */
00059 
00060 /**
00061   * @}
00062   */
00063       
00064 /* Exported constants --------------------------------------------------------*/
00065 /** @defgroup BEEP_Exported_Constants
00066   * @{
00067   */
00068 
00069 #define BEEP_CALIBRATION_DEFAULT ((uint8_t)0x01)  /*!< Default value when calibration is not done */
00070 #define LSI_FREQUENCY_MIN ((uint32_t)25000)       /*!< LSI minimum value in Hertz */
00071 #define LSI_FREQUENCY_MAX ((uint32_t)75000)       /*!< LSI maximum value in Hertz */
00072 
00073 /**
00074   * @}
00075   */
00076 
00077 /* Exported macros -----------------------------------------------------------*/
00078 /** @defgroup BEEP_Exported_Macros
00079   * @{
00080   */
00081 #define IS_LSI_FREQUENCY(FREQ) (((FREQ) >= LSI_FREQUENCY_MIN) && ((FREQ) <= LSI_FREQUENCY_MAX))
00082 
00083 /**
00084   * @}
00085   */
00086 
00087 /* Exported functions ------------------------------------------------------- */
00088 
00089 /*  Function used to set the BEEP configuration to the default reset state *****/  
00090 void BEEP_DeInit(void);
00091 
00092 /* Initialization and Configuration functions *********************************/
00093 void BEEP_Init(BEEP_Frequency_TypeDef BEEP_Frequency);
00094 void BEEP_Cmd(FunctionalState NewState);
00095 
00096 /* Low Speed Internal Clock(LSI) Calibration functions functions **************/
00097 void BEEP_LSClockToTIMConnectCmd(FunctionalState NewState);
00098 void BEEP_LSICalibrationConfig(uint32_t LSIFreqHz);
00099 
00100 
00101 #endif /* __STM8L15x_BEEP_H */
00102 
00103 /**
00104   * @}
00105   */
00106 
00107 /**
00108   * @}
00109   */
00110 
00111 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
STM8S Firmware Library: Overview

 

 

 

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