AudioRecord and FFT/MSE comparison. Call AudioRecord_demo for control record and AudioSample for subsequent recordings.

Dependencies:   CMSIS_DSP_401 STM32L4xx_HAL_Driver

Fork of OneHopeOnePrayer by Senior Design: Sound Monitor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers stm32l4xx.h Source File

stm32l4xx.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32l4xx.h
00004   * @author  MCD Application Team
00005   * @version V1.0.1
00006   * @date    16-September-2015
00007   * @brief   CMSIS STM32L4xx Device Peripheral Access Layer Header File.
00008   *
00009   *          The file is the unique include file that the application programmer
00010   *          is using in the C source code, usually in main.c. This file contains:
00011   *           - Configuration section that allows to select:
00012   *              - The STM32L4xx device used in the target application
00013   *              - To use or not the peripheral�s drivers in application code(i.e.
00014   *                code will be based on direct access to peripheral�s registers
00015   *                rather than drivers API), this option is controlled by
00016   *                "#define USE_HAL_DRIVER"
00017   *
00018   ******************************************************************************
00019   * @attention
00020   *
00021   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
00022   *
00023   * Redistribution and use in source and binary forms, with or without modification,
00024   * are permitted provided that the following conditions are met:
00025   *   1. Redistributions of source code must retain the above copyright notice,
00026   *      this list of conditions and the following disclaimer.
00027   *   2. Redistributions in binary form must reproduce the above copyright notice,
00028   *      this list of conditions and the following disclaimer in the documentation
00029   *      and/or other materials provided with the distribution.
00030   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00031   *      may be used to endorse or promote products derived from this software
00032   *      without specific prior written permission.
00033   *
00034   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00035   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00036   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00037   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00038   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00039   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00040   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00041   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00042   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00043   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00044   *
00045   ******************************************************************************
00046   */
00047 
00048 /** @addtogroup CMSIS
00049   * @{
00050   */
00051 
00052 /** @addtogroup stm32l4xx
00053   * @{
00054   */
00055 
00056 #ifndef __STM32L4xx_H
00057 #define __STM32L4xx_H
00058 
00059 #ifdef __cplusplus
00060  extern "C" {
00061 #endif /* __cplusplus */
00062 
00063 /** @addtogroup Library_configuration_section
00064   * @{
00065   */
00066 
00067 /**
00068   * @brief STM32 Family
00069   */
00070 #if !defined (STM32L4)
00071 #define STM32L4
00072 #endif /* STM32L4 */
00073 
00074 /* Uncomment the line below according to the target STM32L4 device used in your
00075    application
00076   */
00077 
00078 #if !defined (STM32L471xx) && !defined (STM32L475xx) && !defined (STM32L476xx) && !defined (STM32L485xx) && !defined (STM32L486xx)
00079   /* #define STM32L471xx */   /*!< STM32L471xx Devices */
00080   /* #define STM32L475xx */   /*!< STM32L475xx Devices */
00081   #define STM32L476xx !< STM32L476xx Devices 
00082   /* #define STM32L485xx */   /*!< STM32L485xx Devices */
00083   /* #define STM32L486xx */   /*!< STM32L486xx Devices */
00084 #endif
00085 
00086 /*  Tip: To avoid modifying this file each time you need to switch between these
00087         devices, you can define the device in your toolchain compiler preprocessor.
00088   */
00089 #if !defined  (USE_HAL_DRIVER)
00090 /**
00091  * @brief Comment the line below if you will not use the peripherals drivers.
00092    In this case, these drivers will not be included and the application code will
00093    be based on direct access to peripherals registers
00094    */
00095   /*#define USE_HAL_DRIVER */
00096 #endif /* USE_HAL_DRIVER */
00097 
00098 /**
00099   * @brief CMSIS Device version number V1.0.1
00100   */
00101 #define __STM32L4xx_CMSIS_DEVICE_VERSION_MAIN   (0x01) /*!< [31:24] main version */
00102 #define __STM32L4xx_CMSIS_DEVICE_VERSION_SUB1   (0x00) /*!< [23:16] sub1 version */
00103 #define __STM32L4xx_CMSIS_DEVICE_VERSION_SUB2   (0x01) /*!< [15:8]  sub2 version */
00104 #define __STM32L4xx_CMSIS_DEVICE_VERSION_RC     (0x00) /*!< [7:0]  release candidate */
00105 #define __STM32L4xx_CMSIS_DEVICE_VERSION        ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
00106                                                 |(__CMSIS_DEVICE_VERSION_SUB1 << 16)\
00107                                                 |(__CMSIS_DEVICE_VERSION_SUB2 << 8 )\
00108                                                 |(__CMSIS_DEVICE_VERSION_RC))
00109 
00110 /**
00111   * @}
00112   */
00113 
00114 /** @addtogroup Device_Included
00115   * @{
00116   */
00117 
00118 #if defined(STM32L471xx)
00119   #include "stm32l471xx.h"
00120 #elif defined(STM32L475xx)
00121   #include "stm32l475xx.h"
00122 #elif defined(STM32L476xx)
00123   #include "stm32l476xx.h"
00124 #elif defined(STM32L485xx)
00125   #include "stm32l485xx.h"
00126 #elif defined(STM32L486xx)
00127   #include "stm32l486xx.h"
00128 #else
00129  #error "Please select first the target STM32L4xx device used in your application (in stm32l4xx.h file)"
00130 #endif
00131 
00132 /**
00133   * @}
00134   */
00135 
00136 /** @addtogroup Exported_types
00137   * @{
00138   */
00139 typedef enum
00140 {
00141   RESET = 0,
00142   SET = !RESET
00143 } FlagStatus, ITStatus;
00144 
00145 typedef enum
00146 {
00147   DISABLE = 0,
00148   ENABLE = !DISABLE
00149 } FunctionalState;
00150 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
00151 
00152 typedef enum
00153 {
00154   ERROR = 0,
00155   SUCCESS = !ERROR
00156 } ErrorStatus;
00157 
00158 /**
00159   * @}
00160   */
00161 
00162 
00163 /** @addtogroup Exported_macros
00164   * @{
00165   */
00166 #define SET_BIT(REG, BIT)     ((REG) |= (BIT))
00167 
00168 #define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))
00169 
00170 #define READ_BIT(REG, BIT)    ((REG) & (BIT))
00171 
00172 #define CLEAR_REG(REG)        ((REG) = (0x0))
00173 
00174 #define WRITE_REG(REG, VAL)   ((REG) = (VAL))
00175 
00176 #define READ_REG(REG)         ((REG))
00177 
00178 #define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
00179 
00180 #define POSITION_VAL(VAL)     (__CLZ(__RBIT(VAL)))
00181 
00182 
00183 /**
00184   * @}
00185   */
00186 
00187 #if defined (USE_HAL_DRIVER)
00188  #include "stm32l4xx_hal.h"
00189 #endif /* USE_HAL_DRIVER */
00190 
00191 #ifdef __cplusplus
00192 }
00193 #endif /* __cplusplus */
00194 
00195 #endif /* __STM32L4xx_H */
00196 /**
00197   * @}
00198   */
00199 
00200 /**
00201   * @}
00202   */
00203 
00204 
00205 
00206 
00207 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00208