mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
107:4f6c30876dfa
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 107:4f6c30876dfa 1 /**
Kojto 107:4f6c30876dfa 2 ******************************************************************************
Kojto 107:4f6c30876dfa 3 * @file stm32l4xx_hal_dfsdm.h
Kojto 107:4f6c30876dfa 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.5.1
Kojto 122:f9eeca106725 6 * @date 31-May-2016
Kojto 107:4f6c30876dfa 7 * @brief Header file of DFSDM HAL module.
Kojto 107:4f6c30876dfa 8 ******************************************************************************
Kojto 107:4f6c30876dfa 9 * @attention
Kojto 107:4f6c30876dfa 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 107:4f6c30876dfa 12 *
Kojto 107:4f6c30876dfa 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 107:4f6c30876dfa 14 * are permitted provided that the following conditions are met:
Kojto 107:4f6c30876dfa 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 107:4f6c30876dfa 16 * this list of conditions and the following disclaimer.
Kojto 107:4f6c30876dfa 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 107:4f6c30876dfa 18 * this list of conditions and the following disclaimer in the documentation
Kojto 107:4f6c30876dfa 19 * and/or other materials provided with the distribution.
Kojto 107:4f6c30876dfa 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 107:4f6c30876dfa 21 * may be used to endorse or promote products derived from this software
Kojto 107:4f6c30876dfa 22 * without specific prior written permission.
Kojto 107:4f6c30876dfa 23 *
Kojto 107:4f6c30876dfa 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 107:4f6c30876dfa 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 107:4f6c30876dfa 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 107:4f6c30876dfa 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 107:4f6c30876dfa 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 107:4f6c30876dfa 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 107:4f6c30876dfa 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 107:4f6c30876dfa 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 107:4f6c30876dfa 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 107:4f6c30876dfa 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 107:4f6c30876dfa 34 *
Kojto 107:4f6c30876dfa 35 ******************************************************************************
Kojto 107:4f6c30876dfa 36 */
Kojto 107:4f6c30876dfa 37
Kojto 107:4f6c30876dfa 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 107:4f6c30876dfa 39 #ifndef __STM32L4xx_HAL_DFSDM_H
Kojto 107:4f6c30876dfa 40 #define __STM32L4xx_HAL_DFSDM_H
Kojto 107:4f6c30876dfa 41
Kojto 107:4f6c30876dfa 42 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 43 extern "C" {
Kojto 107:4f6c30876dfa 44 #endif
Kojto 107:4f6c30876dfa 45
Kojto 122:f9eeca106725 46 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
Kojto 107:4f6c30876dfa 47 /* Includes ------------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 48 #include "stm32l4xx_hal_def.h"
Kojto 107:4f6c30876dfa 49
Kojto 107:4f6c30876dfa 50 /** @addtogroup STM32L4xx_HAL_Driver
Kojto 107:4f6c30876dfa 51 * @{
Kojto 107:4f6c30876dfa 52 */
Kojto 107:4f6c30876dfa 53
Kojto 107:4f6c30876dfa 54 /** @addtogroup DFSDM
Kojto 107:4f6c30876dfa 55 * @{
Kojto 107:4f6c30876dfa 56 */
Kojto 107:4f6c30876dfa 57
Kojto 107:4f6c30876dfa 58 /* Exported types ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 59 /** @defgroup DFSDM_Exported_Types DFSDM Exported Types
Kojto 107:4f6c30876dfa 60 * @{
Kojto 107:4f6c30876dfa 61 */
Kojto 107:4f6c30876dfa 62
Kojto 107:4f6c30876dfa 63 /**
Kojto 107:4f6c30876dfa 64 * @brief HAL DFSDM Channel states definition
Kojto 107:4f6c30876dfa 65 */
Kojto 107:4f6c30876dfa 66 typedef enum
Kojto 107:4f6c30876dfa 67 {
Kojto 122:f9eeca106725 68 HAL_DFSDM_CHANNEL_STATE_RESET = 0x00U, /*!< DFSDM channel not initialized */
Kojto 122:f9eeca106725 69 HAL_DFSDM_CHANNEL_STATE_READY = 0x01U, /*!< DFSDM channel initialized and ready for use */
Kojto 122:f9eeca106725 70 HAL_DFSDM_CHANNEL_STATE_ERROR = 0xFFU /*!< DFSDM channel state error */
Kojto 107:4f6c30876dfa 71 }HAL_DFSDM_Channel_StateTypeDef;
Kojto 107:4f6c30876dfa 72
Kojto 107:4f6c30876dfa 73 /**
Kojto 107:4f6c30876dfa 74 * @brief DFSDM channel output clock structure definition
Kojto 107:4f6c30876dfa 75 */
Kojto 107:4f6c30876dfa 76 typedef struct
Kojto 107:4f6c30876dfa 77 {
Kojto 107:4f6c30876dfa 78 FunctionalState Activation; /*!< Output clock enable/disable */
Kojto 107:4f6c30876dfa 79 uint32_t Selection; /*!< Output clock is system clock or audio clock.
Kojto 107:4f6c30876dfa 80 This parameter can be a value of @ref DFSDM_Channel_OuputClock */
Kojto 107:4f6c30876dfa 81 uint32_t Divider; /*!< Output clock divider.
Kojto 107:4f6c30876dfa 82 This parameter must be a number between Min_Data = 2 and Max_Data = 256 */
Kojto 107:4f6c30876dfa 83 }DFSDM_Channel_OutputClockTypeDef;
Kojto 107:4f6c30876dfa 84
Kojto 107:4f6c30876dfa 85 /**
Kojto 107:4f6c30876dfa 86 * @brief DFSDM channel input structure definition
Kojto 107:4f6c30876dfa 87 */
Kojto 107:4f6c30876dfa 88 typedef struct
Kojto 107:4f6c30876dfa 89 {
Kojto 107:4f6c30876dfa 90 uint32_t Multiplexer; /*!< Input is external serial inputs or internal register.
Kojto 107:4f6c30876dfa 91 This parameter can be a value of @ref DFSDM_Channel_InputMultiplexer */
Kojto 107:4f6c30876dfa 92 uint32_t DataPacking; /*!< Standard, interleaved or dual mode for internal register.
Kojto 107:4f6c30876dfa 93 This parameter can be a value of @ref DFSDM_Channel_DataPacking */
Kojto 107:4f6c30876dfa 94 uint32_t Pins; /*!< Input pins are taken from same or following channel.
Kojto 107:4f6c30876dfa 95 This parameter can be a value of @ref DFSDM_Channel_InputPins */
Kojto 107:4f6c30876dfa 96 }DFSDM_Channel_InputTypeDef;
Kojto 107:4f6c30876dfa 97
Kojto 107:4f6c30876dfa 98 /**
Kojto 107:4f6c30876dfa 99 * @brief DFSDM channel serial interface structure definition
Kojto 107:4f6c30876dfa 100 */
Kojto 107:4f6c30876dfa 101 typedef struct
Kojto 107:4f6c30876dfa 102 {
Kojto 107:4f6c30876dfa 103 uint32_t Type; /*!< SPI or Manchester modes.
Kojto 107:4f6c30876dfa 104 This parameter can be a value of @ref DFSDM_Channel_SerialInterfaceType */
Kojto 107:4f6c30876dfa 105 uint32_t SpiClock; /*!< SPI clock select (external or internal with different sampling point).
Kojto 107:4f6c30876dfa 106 This parameter can be a value of @ref DFSDM_Channel_SpiClock */
Kojto 107:4f6c30876dfa 107 }DFSDM_Channel_SerialInterfaceTypeDef;
Kojto 107:4f6c30876dfa 108
Kojto 107:4f6c30876dfa 109 /**
Kojto 107:4f6c30876dfa 110 * @brief DFSDM channel analog watchdog structure definition
Kojto 107:4f6c30876dfa 111 */
Kojto 107:4f6c30876dfa 112 typedef struct
Kojto 107:4f6c30876dfa 113 {
Kojto 107:4f6c30876dfa 114 uint32_t FilterOrder; /*!< Analog watchdog Sinc filter order.
Kojto 107:4f6c30876dfa 115 This parameter can be a value of @ref DFSDM_Channel_AwdFilterOrder */
Kojto 107:4f6c30876dfa 116 uint32_t Oversampling; /*!< Analog watchdog filter oversampling ratio.
Kojto 107:4f6c30876dfa 117 This parameter must be a number between Min_Data = 1 and Max_Data = 32 */
Kojto 107:4f6c30876dfa 118 }DFSDM_Channel_AwdTypeDef;
Kojto 107:4f6c30876dfa 119
Kojto 107:4f6c30876dfa 120 /**
Kojto 107:4f6c30876dfa 121 * @brief DFSDM channel init structure definition
Kojto 107:4f6c30876dfa 122 */
Kojto 107:4f6c30876dfa 123 typedef struct
Kojto 107:4f6c30876dfa 124 {
Kojto 107:4f6c30876dfa 125 DFSDM_Channel_OutputClockTypeDef OutputClock; /*!< DFSDM channel output clock parameters */
Kojto 107:4f6c30876dfa 126 DFSDM_Channel_InputTypeDef Input; /*!< DFSDM channel input parameters */
Kojto 107:4f6c30876dfa 127 DFSDM_Channel_SerialInterfaceTypeDef SerialInterface; /*!< DFSDM channel serial interface parameters */
Kojto 107:4f6c30876dfa 128 DFSDM_Channel_AwdTypeDef Awd; /*!< DFSDM channel analog watchdog parameters */
Kojto 107:4f6c30876dfa 129 int32_t Offset; /*!< DFSDM channel offset.
Kojto 107:4f6c30876dfa 130 This parameter must be a number between Min_Data = -8388608 and Max_Data = 8388607 */
Kojto 107:4f6c30876dfa 131 uint32_t RightBitShift; /*!< DFSDM channel right bit shift.
Kojto 107:4f6c30876dfa 132 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x1F */
Kojto 107:4f6c30876dfa 133 }DFSDM_Channel_InitTypeDef;
Kojto 107:4f6c30876dfa 134
Kojto 107:4f6c30876dfa 135 /**
Kojto 107:4f6c30876dfa 136 * @brief DFSDM channel handle structure definition
Kojto 107:4f6c30876dfa 137 */
Kojto 107:4f6c30876dfa 138 typedef struct
Kojto 107:4f6c30876dfa 139 {
Kojto 107:4f6c30876dfa 140 DFSDM_Channel_TypeDef *Instance; /*!< DFSDM channel instance */
Kojto 107:4f6c30876dfa 141 DFSDM_Channel_InitTypeDef Init; /*!< DFSDM channel init parameters */
Kojto 107:4f6c30876dfa 142 HAL_DFSDM_Channel_StateTypeDef State; /*!< DFSDM channel state */
Kojto 107:4f6c30876dfa 143 }DFSDM_Channel_HandleTypeDef;
Kojto 107:4f6c30876dfa 144
Kojto 107:4f6c30876dfa 145 /**
Kojto 107:4f6c30876dfa 146 * @brief HAL DFSDM Filter states definition
Kojto 107:4f6c30876dfa 147 */
Kojto 107:4f6c30876dfa 148 typedef enum
Kojto 107:4f6c30876dfa 149 {
Kojto 122:f9eeca106725 150 HAL_DFSDM_FILTER_STATE_RESET = 0x00U, /*!< DFSDM filter not initialized */
Kojto 122:f9eeca106725 151 HAL_DFSDM_FILTER_STATE_READY = 0x01U, /*!< DFSDM filter initialized and ready for use */
Kojto 122:f9eeca106725 152 HAL_DFSDM_FILTER_STATE_REG = 0x02U, /*!< DFSDM filter regular conversion in progress */
Kojto 122:f9eeca106725 153 HAL_DFSDM_FILTER_STATE_INJ = 0x03U, /*!< DFSDM filter injected conversion in progress */
Kojto 122:f9eeca106725 154 HAL_DFSDM_FILTER_STATE_REG_INJ = 0x04U, /*!< DFSDM filter regular and injected conversions in progress */
Kojto 122:f9eeca106725 155 HAL_DFSDM_FILTER_STATE_ERROR = 0xFFU /*!< DFSDM filter state error */
Kojto 107:4f6c30876dfa 156 }HAL_DFSDM_Filter_StateTypeDef;
Kojto 107:4f6c30876dfa 157
Kojto 107:4f6c30876dfa 158 /**
Kojto 107:4f6c30876dfa 159 * @brief DFSDM filter regular conversion parameters structure definition
Kojto 107:4f6c30876dfa 160 */
Kojto 107:4f6c30876dfa 161 typedef struct
Kojto 107:4f6c30876dfa 162 {
Kojto 107:4f6c30876dfa 163 uint32_t Trigger; /*!< Trigger used to start regular conversion: software or synchronous.
Kojto 107:4f6c30876dfa 164 This parameter can be a value of @ref DFSDM_Filter_Trigger */
Kojto 107:4f6c30876dfa 165 FunctionalState FastMode; /*!< Enable/disable fast mode for regular conversion */
Kojto 107:4f6c30876dfa 166 FunctionalState DmaMode; /*!< Enable/disable DMA for regular conversion */
Kojto 107:4f6c30876dfa 167 }DFSDM_Filter_RegularParamTypeDef;
Kojto 107:4f6c30876dfa 168
Kojto 107:4f6c30876dfa 169 /**
Kojto 107:4f6c30876dfa 170 * @brief DFSDM filter injected conversion parameters structure definition
Kojto 107:4f6c30876dfa 171 */
Kojto 107:4f6c30876dfa 172 typedef struct
Kojto 107:4f6c30876dfa 173 {
Kojto 107:4f6c30876dfa 174 uint32_t Trigger; /*!< Trigger used to start injected conversion: software, external or synchronous.
Kojto 107:4f6c30876dfa 175 This parameter can be a value of @ref DFSDM_Filter_Trigger */
Kojto 107:4f6c30876dfa 176 FunctionalState ScanMode; /*!< Enable/disable scanning mode for injected conversion */
Kojto 107:4f6c30876dfa 177 FunctionalState DmaMode; /*!< Enable/disable DMA for injected conversion */
Kojto 107:4f6c30876dfa 178 uint32_t ExtTrigger; /*!< External trigger.
Kojto 107:4f6c30876dfa 179 This parameter can be a value of @ref DFSDM_Filter_ExtTrigger */
Kojto 107:4f6c30876dfa 180 uint32_t ExtTriggerEdge; /*!< External trigger edge: rising, falling or both.
Kojto 107:4f6c30876dfa 181 This parameter can be a value of @ref DFSDM_Filter_ExtTriggerEdge */
Kojto 107:4f6c30876dfa 182 }DFSDM_Filter_InjectedParamTypeDef;
Kojto 107:4f6c30876dfa 183
Kojto 107:4f6c30876dfa 184 /**
Kojto 107:4f6c30876dfa 185 * @brief DFSDM filter parameters structure definition
Kojto 107:4f6c30876dfa 186 */
Kojto 107:4f6c30876dfa 187 typedef struct
Kojto 107:4f6c30876dfa 188 {
Kojto 107:4f6c30876dfa 189 uint32_t SincOrder; /*!< Sinc filter order.
Kojto 107:4f6c30876dfa 190 This parameter can be a value of @ref DFSDM_Filter_SincOrder */
Kojto 107:4f6c30876dfa 191 uint32_t Oversampling; /*!< Filter oversampling ratio.
Kojto 107:4f6c30876dfa 192 This parameter must be a number between Min_Data = 1 and Max_Data = 1024 */
Kojto 107:4f6c30876dfa 193 uint32_t IntOversampling; /*!< Integrator oversampling ratio.
Kojto 107:4f6c30876dfa 194 This parameter must be a number between Min_Data = 1 and Max_Data = 256 */
Kojto 107:4f6c30876dfa 195 }DFSDM_Filter_FilterParamTypeDef;
Kojto 107:4f6c30876dfa 196
Kojto 107:4f6c30876dfa 197 /**
Kojto 107:4f6c30876dfa 198 * @brief DFSDM filter init structure definition
Kojto 107:4f6c30876dfa 199 */
Kojto 107:4f6c30876dfa 200 typedef struct
Kojto 107:4f6c30876dfa 201 {
Kojto 107:4f6c30876dfa 202 DFSDM_Filter_RegularParamTypeDef RegularParam; /*!< DFSDM regular conversion parameters */
Kojto 107:4f6c30876dfa 203 DFSDM_Filter_InjectedParamTypeDef InjectedParam; /*!< DFSDM injected conversion parameters */
Kojto 107:4f6c30876dfa 204 DFSDM_Filter_FilterParamTypeDef FilterParam; /*!< DFSDM filter parameters */
Kojto 107:4f6c30876dfa 205 }DFSDM_Filter_InitTypeDef;
Kojto 107:4f6c30876dfa 206
Kojto 107:4f6c30876dfa 207 /**
Kojto 107:4f6c30876dfa 208 * @brief DFSDM filter handle structure definition
Kojto 107:4f6c30876dfa 209 */
Kojto 107:4f6c30876dfa 210 typedef struct
Kojto 107:4f6c30876dfa 211 {
Kojto 107:4f6c30876dfa 212 DFSDM_Filter_TypeDef *Instance; /*!< DFSDM filter instance */
Kojto 107:4f6c30876dfa 213 DFSDM_Filter_InitTypeDef Init; /*!< DFSDM filter init parameters */
Kojto 107:4f6c30876dfa 214 DMA_HandleTypeDef *hdmaReg; /*!< Pointer on DMA handler for regular conversions */
Kojto 107:4f6c30876dfa 215 DMA_HandleTypeDef *hdmaInj; /*!< Pointer on DMA handler for injected conversions */
Kojto 107:4f6c30876dfa 216 uint32_t RegularContMode; /*!< Regular conversion continuous mode */
Kojto 107:4f6c30876dfa 217 uint32_t RegularTrigger; /*!< Trigger used for regular conversion */
Kojto 107:4f6c30876dfa 218 uint32_t InjectedTrigger; /*!< Trigger used for injected conversion */
Kojto 107:4f6c30876dfa 219 uint32_t ExtTriggerEdge; /*!< Rising, falling or both edges selected */
Kojto 107:4f6c30876dfa 220 FunctionalState InjectedScanMode; /*!< Injected scanning mode */
Kojto 107:4f6c30876dfa 221 uint32_t InjectedChannelsNbr; /*!< Number of channels in injected sequence */
Kojto 107:4f6c30876dfa 222 uint32_t InjConvRemaining; /*!< Injected conversions remaining */
Kojto 107:4f6c30876dfa 223 HAL_DFSDM_Filter_StateTypeDef State; /*!< DFSDM filter state */
Kojto 107:4f6c30876dfa 224 uint32_t ErrorCode; /*!< DFSDM filter error code */
Kojto 107:4f6c30876dfa 225 }DFSDM_Filter_HandleTypeDef;
Kojto 107:4f6c30876dfa 226
Kojto 107:4f6c30876dfa 227 /**
Kojto 107:4f6c30876dfa 228 * @brief DFSDM filter analog watchdog parameters structure definition
Kojto 107:4f6c30876dfa 229 */
Kojto 107:4f6c30876dfa 230 typedef struct
Kojto 107:4f6c30876dfa 231 {
Kojto 107:4f6c30876dfa 232 uint32_t DataSource; /*!< Values from digital filter or from channel watchdog filter.
Kojto 107:4f6c30876dfa 233 This parameter can be a value of @ref DFSDM_Filter_AwdDataSource */
Kojto 107:4f6c30876dfa 234 uint32_t Channel; /*!< Analog watchdog channel selection.
Kojto 107:4f6c30876dfa 235 This parameter can be a values combination of @ref DFSDM_Channel_Selection */
Kojto 107:4f6c30876dfa 236 int32_t HighThreshold; /*!< High threshold for the analog watchdog.
Kojto 107:4f6c30876dfa 237 This parameter must be a number between Min_Data = -8388608 and Max_Data = 8388607 */
Kojto 107:4f6c30876dfa 238 int32_t LowThreshold; /*!< Low threshold for the analog watchdog.
Kojto 107:4f6c30876dfa 239 This parameter must be a number between Min_Data = -8388608 and Max_Data = 8388607 */
Kojto 107:4f6c30876dfa 240 uint32_t HighBreakSignal; /*!< Break signal assigned to analog watchdog high threshold event.
Kojto 107:4f6c30876dfa 241 This parameter can be a values combination of @ref DFSDM_BreakSignals */
Kojto 107:4f6c30876dfa 242 uint32_t LowBreakSignal; /*!< Break signal assigned to analog watchdog low threshold event.
Kojto 107:4f6c30876dfa 243 This parameter can be a values combination of @ref DFSDM_BreakSignals */
Kojto 107:4f6c30876dfa 244 }DFSDM_Filter_AwdParamTypeDef;
Kojto 107:4f6c30876dfa 245
Kojto 107:4f6c30876dfa 246 /**
Kojto 107:4f6c30876dfa 247 * @}
Kojto 107:4f6c30876dfa 248 */
Kojto 107:4f6c30876dfa 249 /* End of exported types -----------------------------------------------------*/
Kojto 107:4f6c30876dfa 250
Kojto 107:4f6c30876dfa 251 /* Exported constants --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 252 /** @defgroup DFSDM_Exported_Constants DFSDM Exported Constants
Kojto 107:4f6c30876dfa 253 * @{
Kojto 107:4f6c30876dfa 254 */
Kojto 107:4f6c30876dfa 255
Kojto 107:4f6c30876dfa 256 /** @defgroup DFSDM_Channel_OuputClock DFSDM channel output clock selection
Kojto 107:4f6c30876dfa 257 * @{
Kojto 107:4f6c30876dfa 258 */
Kojto 122:f9eeca106725 259 #define DFSDM_CHANNEL_OUTPUT_CLOCK_SYSTEM ((uint32_t)0x00000000U) /*!< Source for ouput clock is system clock */
Kojto 122:f9eeca106725 260 #define DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO DFSDM_CHCFGR1_CKOUTSRC /*!< Source for ouput clock is audio clock */
Kojto 107:4f6c30876dfa 261 /**
Kojto 107:4f6c30876dfa 262 * @}
Kojto 107:4f6c30876dfa 263 */
Kojto 107:4f6c30876dfa 264
Kojto 107:4f6c30876dfa 265 /** @defgroup DFSDM_Channel_InputMultiplexer DFSDM channel input multiplexer
Kojto 107:4f6c30876dfa 266 * @{
Kojto 107:4f6c30876dfa 267 */
Kojto 122:f9eeca106725 268 #define DFSDM_CHANNEL_EXTERNAL_INPUTS ((uint32_t)0x00000000U) /*!< Data are taken from external inputs */
Kojto 122:f9eeca106725 269 #define DFSDM_CHANNEL_INTERNAL_REGISTER DFSDM_CHCFGR1_DATMPX_1 /*!< Data are taken from internal register */
Kojto 107:4f6c30876dfa 270 /**
Kojto 107:4f6c30876dfa 271 * @}
Kojto 107:4f6c30876dfa 272 */
Kojto 107:4f6c30876dfa 273
Kojto 107:4f6c30876dfa 274 /** @defgroup DFSDM_Channel_DataPacking DFSDM channel input data packing
Kojto 107:4f6c30876dfa 275 * @{
Kojto 107:4f6c30876dfa 276 */
Kojto 122:f9eeca106725 277 #define DFSDM_CHANNEL_STANDARD_MODE ((uint32_t)0x00000000U) /*!< Standard data packing mode */
Kojto 107:4f6c30876dfa 278 #define DFSDM_CHANNEL_INTERLEAVED_MODE DFSDM_CHCFGR1_DATPACK_0 /*!< Interleaved data packing mode */
Kojto 107:4f6c30876dfa 279 #define DFSDM_CHANNEL_DUAL_MODE DFSDM_CHCFGR1_DATPACK_1 /*!< Dual data packing mode */
Kojto 107:4f6c30876dfa 280 /**
Kojto 107:4f6c30876dfa 281 * @}
Kojto 107:4f6c30876dfa 282 */
Kojto 107:4f6c30876dfa 283
Kojto 107:4f6c30876dfa 284 /** @defgroup DFSDM_Channel_InputPins DFSDM channel input pins
Kojto 107:4f6c30876dfa 285 * @{
Kojto 107:4f6c30876dfa 286 */
Kojto 122:f9eeca106725 287 #define DFSDM_CHANNEL_SAME_CHANNEL_PINS ((uint32_t)0x00000000U) /*!< Input from pins on same channel */
Kojto 122:f9eeca106725 288 #define DFSDM_CHANNEL_FOLLOWING_CHANNEL_PINS DFSDM_CHCFGR1_CHINSEL /*!< Input from pins on following channel */
Kojto 107:4f6c30876dfa 289 /**
Kojto 107:4f6c30876dfa 290 * @}
Kojto 107:4f6c30876dfa 291 */
Kojto 107:4f6c30876dfa 292
Kojto 107:4f6c30876dfa 293 /** @defgroup DFSDM_Channel_SerialInterfaceType DFSDM channel serial interface type
Kojto 107:4f6c30876dfa 294 * @{
Kojto 107:4f6c30876dfa 295 */
Kojto 122:f9eeca106725 296 #define DFSDM_CHANNEL_SPI_RISING ((uint32_t)0x00000000U) /*!< SPI with rising edge */
Kojto 122:f9eeca106725 297 #define DFSDM_CHANNEL_SPI_FALLING DFSDM_CHCFGR1_SITP_0 /*!< SPI with falling edge */
Kojto 122:f9eeca106725 298 #define DFSDM_CHANNEL_MANCHESTER_RISING DFSDM_CHCFGR1_SITP_1 /*!< Manchester with rising edge */
Kojto 122:f9eeca106725 299 #define DFSDM_CHANNEL_MANCHESTER_FALLING DFSDM_CHCFGR1_SITP /*!< Manchester with falling edge */
Kojto 107:4f6c30876dfa 300 /**
Kojto 107:4f6c30876dfa 301 * @}
Kojto 107:4f6c30876dfa 302 */
Kojto 107:4f6c30876dfa 303
Kojto 107:4f6c30876dfa 304 /** @defgroup DFSDM_Channel_SpiClock DFSDM channel SPI clock selection
Kojto 107:4f6c30876dfa 305 * @{
Kojto 107:4f6c30876dfa 306 */
Kojto 122:f9eeca106725 307 #define DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL ((uint32_t)0x00000000U) /*!< External SPI clock */
Kojto 107:4f6c30876dfa 308 #define DFSDM_CHANNEL_SPI_CLOCK_INTERNAL DFSDM_CHCFGR1_SPICKSEL_0 /*!< Internal SPI clock */
Kojto 107:4f6c30876dfa 309 #define DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_FALLING DFSDM_CHCFGR1_SPICKSEL_1 /*!< Internal SPI clock divided by 2, falling edge */
Kojto 107:4f6c30876dfa 310 #define DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_RISING DFSDM_CHCFGR1_SPICKSEL /*!< Internal SPI clock divided by 2, rising edge */
Kojto 107:4f6c30876dfa 311 /**
Kojto 107:4f6c30876dfa 312 * @}
Kojto 107:4f6c30876dfa 313 */
Kojto 107:4f6c30876dfa 314
Kojto 107:4f6c30876dfa 315 /** @defgroup DFSDM_Channel_AwdFilterOrder DFSDM channel analog watchdog filter order
Kojto 107:4f6c30876dfa 316 * @{
Kojto 107:4f6c30876dfa 317 */
Kojto 122:f9eeca106725 318 #define DFSDM_CHANNEL_FASTSINC_ORDER ((uint32_t)0x00000000U) /*!< FastSinc filter type */
Kojto 122:f9eeca106725 319 #define DFSDM_CHANNEL_SINC1_ORDER DFSDM_CHAWSCDR_AWFORD_0 /*!< Sinc 1 filter type */
Kojto 122:f9eeca106725 320 #define DFSDM_CHANNEL_SINC2_ORDER DFSDM_CHAWSCDR_AWFORD_1 /*!< Sinc 2 filter type */
Kojto 122:f9eeca106725 321 #define DFSDM_CHANNEL_SINC3_ORDER DFSDM_CHAWSCDR_AWFORD /*!< Sinc 3 filter type */
Kojto 107:4f6c30876dfa 322 /**
Kojto 107:4f6c30876dfa 323 * @}
Kojto 107:4f6c30876dfa 324 */
Kojto 107:4f6c30876dfa 325
Kojto 107:4f6c30876dfa 326 /** @defgroup DFSDM_Filter_Trigger DFSDM filter conversion trigger
Kojto 107:4f6c30876dfa 327 * @{
Kojto 107:4f6c30876dfa 328 */
Kojto 122:f9eeca106725 329 #define DFSDM_FILTER_SW_TRIGGER ((uint32_t)0x00000000U) /*!< Software trigger */
Kojto 122:f9eeca106725 330 #define DFSDM_FILTER_SYNC_TRIGGER ((uint32_t)0x00000001U) /*!< Synchronous with DFSDM_FLT0 */
Kojto 122:f9eeca106725 331 #define DFSDM_FILTER_EXT_TRIGGER ((uint32_t)0x00000002U) /*!< External trigger (only for injected conversion) */
Kojto 107:4f6c30876dfa 332 /**
Kojto 107:4f6c30876dfa 333 * @}
Kojto 107:4f6c30876dfa 334 */
Kojto 107:4f6c30876dfa 335
Kojto 107:4f6c30876dfa 336 /** @defgroup DFSDM_Filter_ExtTrigger DFSDM filter external trigger
Kojto 107:4f6c30876dfa 337 * @{
Kojto 107:4f6c30876dfa 338 */
Kojto 122:f9eeca106725 339 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO ((uint32_t)0x00000000U) /*!< For DFSDM filter 0, 1, 2 and 3 */
Kojto 122:f9eeca106725 340 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2 DFSDM_FLTCR1_JEXTSEL_0 /*!< For DFSDM filter 0, 1, 2 and 3 */
Kojto 122:f9eeca106725 341 #define DFSDM_FILTER_EXT_TRIG_TIM8_TRGO DFSDM_FLTCR1_JEXTSEL_1 /*!< For DFSDM filter 0, 1, 2 and 3 */
Kojto 122:f9eeca106725 342 #define DFSDM_FILTER_EXT_TRIG_TIM8_TRGO2 (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_1) /*!< For DFSDM filter 0, 1 and 2 */
Kojto 122:f9eeca106725 343 #define DFSDM_FILTER_EXT_TRIG_TIM3_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_1) /*!< For DFSDM filter 3 */
Kojto 122:f9eeca106725 344 #define DFSDM_FILTER_EXT_TRIG_TIM4_TRGO DFSDM_FLTCR1_JEXTSEL_2 /*!< For DFSDM filter 0, 1 and 2 */
Kojto 122:f9eeca106725 345 #define DFSDM_FILTER_EXT_TRIG_TIM16_OC1 DFSDM_FLTCR1_JEXTSEL_2 /*!< For DFSDM filter 3 */
Kojto 122:f9eeca106725 346 #define DFSDM_FILTER_EXT_TRIG_TIM6_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_2) /*!< For DFSDM filter 0 and 1 */
Kojto 122:f9eeca106725 347 #define DFSDM_FILTER_EXT_TRIG_TIM7_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_2) /*!< For DFSDM filter 2 and 3 */
Kojto 122:f9eeca106725 348 #define DFSDM_FILTER_EXT_TRIG_EXTI11 (DFSDM_FLTCR1_JEXTSEL_1 | DFSDM_FLTCR1_JEXTSEL_2) /*!< For DFSDM filter 0, 1, 2 and 3 */
Kojto 122:f9eeca106725 349 #define DFSDM_FILTER_EXT_TRIG_EXTI15 DFSDM_FLTCR1_JEXTSEL /*!< For DFSDM filter 0, 1, 2 and 3 */
Kojto 107:4f6c30876dfa 350 /**
Kojto 107:4f6c30876dfa 351 * @}
Kojto 107:4f6c30876dfa 352 */
Kojto 107:4f6c30876dfa 353
Kojto 107:4f6c30876dfa 354 /** @defgroup DFSDM_Filter_ExtTriggerEdge DFSDM filter external trigger edge
Kojto 107:4f6c30876dfa 355 * @{
Kojto 107:4f6c30876dfa 356 */
Kojto 122:f9eeca106725 357 #define DFSDM_FILTER_EXT_TRIG_RISING_EDGE DFSDM_FLTCR1_JEXTEN_0 /*!< External rising edge */
Kojto 122:f9eeca106725 358 #define DFSDM_FILTER_EXT_TRIG_FALLING_EDGE DFSDM_FLTCR1_JEXTEN_1 /*!< External falling edge */
Kojto 122:f9eeca106725 359 #define DFSDM_FILTER_EXT_TRIG_BOTH_EDGES DFSDM_FLTCR1_JEXTEN /*!< External rising and falling edges */
Kojto 107:4f6c30876dfa 360 /**
Kojto 107:4f6c30876dfa 361 * @}
Kojto 107:4f6c30876dfa 362 */
Kojto 107:4f6c30876dfa 363
Kojto 107:4f6c30876dfa 364 /** @defgroup DFSDM_Filter_SincOrder DFSDM filter sinc order
Kojto 107:4f6c30876dfa 365 * @{
Kojto 107:4f6c30876dfa 366 */
Kojto 122:f9eeca106725 367 #define DFSDM_FILTER_FASTSINC_ORDER ((uint32_t)0x00000000U) /*!< FastSinc filter type */
Kojto 122:f9eeca106725 368 #define DFSDM_FILTER_SINC1_ORDER DFSDM_FLTFCR_FORD_0 /*!< Sinc 1 filter type */
Kojto 122:f9eeca106725 369 #define DFSDM_FILTER_SINC2_ORDER DFSDM_FLTFCR_FORD_1 /*!< Sinc 2 filter type */
Kojto 122:f9eeca106725 370 #define DFSDM_FILTER_SINC3_ORDER (DFSDM_FLTFCR_FORD_0 | DFSDM_FLTFCR_FORD_1) /*!< Sinc 3 filter type */
Kojto 122:f9eeca106725 371 #define DFSDM_FILTER_SINC4_ORDER DFSDM_FLTFCR_FORD_2 /*!< Sinc 4 filter type */
Kojto 122:f9eeca106725 372 #define DFSDM_FILTER_SINC5_ORDER (DFSDM_FLTFCR_FORD_0 | DFSDM_FLTFCR_FORD_2) /*!< Sinc 5 filter type */
Kojto 107:4f6c30876dfa 373 /**
Kojto 107:4f6c30876dfa 374 * @}
Kojto 107:4f6c30876dfa 375 */
Kojto 107:4f6c30876dfa 376
Kojto 107:4f6c30876dfa 377 /** @defgroup DFSDM_Filter_AwdDataSource DFSDM filter analog watchdog data source
Kojto 107:4f6c30876dfa 378 * @{
Kojto 107:4f6c30876dfa 379 */
Kojto 122:f9eeca106725 380 #define DFSDM_FILTER_AWD_FILTER_DATA ((uint32_t)0x00000000U) /*!< From digital filter */
Kojto 122:f9eeca106725 381 #define DFSDM_FILTER_AWD_CHANNEL_DATA DFSDM_FLTCR1_AWFSEL /*!< From analog watchdog channel */
Kojto 107:4f6c30876dfa 382 /**
Kojto 107:4f6c30876dfa 383 * @}
Kojto 107:4f6c30876dfa 384 */
Kojto 107:4f6c30876dfa 385
Kojto 107:4f6c30876dfa 386 /** @defgroup DFSDM_Filter_ErrorCode DFSDM filter error code
Kojto 107:4f6c30876dfa 387 * @{
Kojto 107:4f6c30876dfa 388 */
Kojto 122:f9eeca106725 389 #define DFSDM_FILTER_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
Kojto 122:f9eeca106725 390 #define DFSDM_FILTER_ERROR_REGULAR_OVERRUN ((uint32_t)0x00000001U) /*!< Overrun occurs during regular conversion */
Kojto 122:f9eeca106725 391 #define DFSDM_FILTER_ERROR_INJECTED_OVERRUN ((uint32_t)0x00000002U) /*!< Overrun occurs during injected conversion */
Kojto 122:f9eeca106725 392 #define DFSDM_FILTER_ERROR_DMA ((uint32_t)0x00000003U) /*!< DMA error occurs */
Kojto 107:4f6c30876dfa 393 /**
Kojto 107:4f6c30876dfa 394 * @}
Kojto 107:4f6c30876dfa 395 */
Kojto 107:4f6c30876dfa 396
Kojto 107:4f6c30876dfa 397 /** @defgroup DFSDM_BreakSignals DFSDM break signals
Kojto 107:4f6c30876dfa 398 * @{
Kojto 107:4f6c30876dfa 399 */
Kojto 122:f9eeca106725 400 #define DFSDM_NO_BREAK_SIGNAL ((uint32_t)0x00000000U) /*!< No break signal */
Kojto 122:f9eeca106725 401 #define DFSDM_BREAK_SIGNAL_0 ((uint32_t)0x00000001U) /*!< Break signal 0 */
Kojto 122:f9eeca106725 402 #define DFSDM_BREAK_SIGNAL_1 ((uint32_t)0x00000002U) /*!< Break signal 1 */
Kojto 122:f9eeca106725 403 #define DFSDM_BREAK_SIGNAL_2 ((uint32_t)0x00000004U) /*!< Break signal 2 */
Kojto 122:f9eeca106725 404 #define DFSDM_BREAK_SIGNAL_3 ((uint32_t)0x00000008U) /*!< Break signal 3 */
Kojto 107:4f6c30876dfa 405 /**
Kojto 107:4f6c30876dfa 406 * @}
Kojto 107:4f6c30876dfa 407 */
Kojto 107:4f6c30876dfa 408
Kojto 107:4f6c30876dfa 409 /** @defgroup DFSDM_Channel_Selection DFSDM Channel Selection
Kojto 107:4f6c30876dfa 410 * @{
Kojto 107:4f6c30876dfa 411 */
Kojto 107:4f6c30876dfa 412 /* DFSDM Channels ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 413 /* The DFSDM channels are defined as follows:
Kojto 107:4f6c30876dfa 414 - in 16-bit LSB the channel mask is set
Kojto 107:4f6c30876dfa 415 - in 16-bit MSB the channel number is set
Kojto 107:4f6c30876dfa 416 e.g. for channel 5 definition:
Kojto 107:4f6c30876dfa 417 - the channel mask is 0x00000020 (bit 5 is set)
Kojto 107:4f6c30876dfa 418 - the channel number 5 is 0x00050000
Kojto 107:4f6c30876dfa 419 --> Consequently, channel 5 definition is 0x00000020 | 0x00050000 = 0x00050020 */
Kojto 122:f9eeca106725 420 #define DFSDM_CHANNEL_0 ((uint32_t)0x00000001U)
Kojto 122:f9eeca106725 421 #define DFSDM_CHANNEL_1 ((uint32_t)0x00010002U)
Kojto 122:f9eeca106725 422 #define DFSDM_CHANNEL_2 ((uint32_t)0x00020004U)
Kojto 122:f9eeca106725 423 #define DFSDM_CHANNEL_3 ((uint32_t)0x00030008U)
Kojto 122:f9eeca106725 424 #define DFSDM_CHANNEL_4 ((uint32_t)0x00040010U)
Kojto 122:f9eeca106725 425 #define DFSDM_CHANNEL_5 ((uint32_t)0x00050020U)
Kojto 122:f9eeca106725 426 #define DFSDM_CHANNEL_6 ((uint32_t)0x00060040U)
Kojto 122:f9eeca106725 427 #define DFSDM_CHANNEL_7 ((uint32_t)0x00070080U)
Kojto 107:4f6c30876dfa 428 /**
Kojto 107:4f6c30876dfa 429 * @}
Kojto 107:4f6c30876dfa 430 */
Kojto 107:4f6c30876dfa 431
Kojto 107:4f6c30876dfa 432 /** @defgroup DFSDM_ContinuousMode DFSDM Continuous Mode
Kojto 107:4f6c30876dfa 433 * @{
Kojto 107:4f6c30876dfa 434 */
Kojto 122:f9eeca106725 435 #define DFSDM_CONTINUOUS_CONV_OFF ((uint32_t)0x00000000U) /*!< Conversion are not continuous */
Kojto 122:f9eeca106725 436 #define DFSDM_CONTINUOUS_CONV_ON ((uint32_t)0x00000001U) /*!< Conversion are continuous */
Kojto 107:4f6c30876dfa 437 /**
Kojto 107:4f6c30876dfa 438 * @}
Kojto 107:4f6c30876dfa 439 */
Kojto 107:4f6c30876dfa 440
Kojto 107:4f6c30876dfa 441 /** @defgroup DFSDM_AwdThreshold DFSDM analog watchdog threshold
Kojto 107:4f6c30876dfa 442 * @{
Kojto 107:4f6c30876dfa 443 */
Kojto 122:f9eeca106725 444 #define DFSDM_AWD_HIGH_THRESHOLD ((uint32_t)0x00000000U) /*!< Analog watchdog high threshold */
Kojto 122:f9eeca106725 445 #define DFSDM_AWD_LOW_THRESHOLD ((uint32_t)0x00000001U) /*!< Analog watchdog low threshold */
Kojto 107:4f6c30876dfa 446 /**
Kojto 107:4f6c30876dfa 447 * @}
Kojto 107:4f6c30876dfa 448 */
Kojto 107:4f6c30876dfa 449
Kojto 107:4f6c30876dfa 450 /**
Kojto 107:4f6c30876dfa 451 * @}
Kojto 107:4f6c30876dfa 452 */
Kojto 107:4f6c30876dfa 453 /* End of exported constants -------------------------------------------------*/
Kojto 107:4f6c30876dfa 454
Kojto 107:4f6c30876dfa 455 /* Exported macros -----------------------------------------------------------*/
Kojto 107:4f6c30876dfa 456 /** @defgroup DFSDM_Exported_Macros DFSDM Exported Macros
Kojto 107:4f6c30876dfa 457 * @{
Kojto 107:4f6c30876dfa 458 */
Kojto 107:4f6c30876dfa 459
Kojto 107:4f6c30876dfa 460 /** @brief Reset DFSDM channel handle state.
Kojto 107:4f6c30876dfa 461 * @param __HANDLE__: DFSDM channel handle.
Kojto 107:4f6c30876dfa 462 * @retval None
Kojto 107:4f6c30876dfa 463 */
Kojto 107:4f6c30876dfa 464 #define __HAL_DFSDM_CHANNEL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DFSDM_CHANNEL_STATE_RESET)
Kojto 107:4f6c30876dfa 465
Kojto 107:4f6c30876dfa 466 /** @brief Reset DFSDM filter handle state.
Kojto 107:4f6c30876dfa 467 * @param __HANDLE__: DFSDM filter handle.
Kojto 107:4f6c30876dfa 468 * @retval None
Kojto 107:4f6c30876dfa 469 */
Kojto 107:4f6c30876dfa 470 #define __HAL_DFSDM_FILTER_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DFSDM_FILTER_STATE_RESET)
Kojto 107:4f6c30876dfa 471
Kojto 107:4f6c30876dfa 472 /**
Kojto 107:4f6c30876dfa 473 * @}
Kojto 107:4f6c30876dfa 474 */
Kojto 107:4f6c30876dfa 475 /* End of exported macros ----------------------------------------------------*/
Kojto 107:4f6c30876dfa 476
Kojto 107:4f6c30876dfa 477 /* Exported functions --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 478 /** @addtogroup DFSDM_Exported_Functions DFSDM Exported Functions
Kojto 107:4f6c30876dfa 479 * @{
Kojto 107:4f6c30876dfa 480 */
Kojto 107:4f6c30876dfa 481
Kojto 107:4f6c30876dfa 482 /** @addtogroup DFSDM_Exported_Functions_Group1_Channel Channel initialization and de-initialization functions
Kojto 107:4f6c30876dfa 483 * @{
Kojto 107:4f6c30876dfa 484 */
Kojto 107:4f6c30876dfa 485 /* Channel initialization and de-initialization functions *********************/
Kojto 107:4f6c30876dfa 486 HAL_StatusTypeDef HAL_DFSDM_ChannelInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 487 HAL_StatusTypeDef HAL_DFSDM_ChannelDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 488 void HAL_DFSDM_ChannelMspInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 489 void HAL_DFSDM_ChannelMspDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 490 /**
Kojto 107:4f6c30876dfa 491 * @}
Kojto 107:4f6c30876dfa 492 */
Kojto 107:4f6c30876dfa 493
Kojto 107:4f6c30876dfa 494 /** @addtogroup DFSDM_Exported_Functions_Group2_Channel Channel operation functions
Kojto 107:4f6c30876dfa 495 * @{
Kojto 107:4f6c30876dfa 496 */
Kojto 107:4f6c30876dfa 497 /* Channel operation functions ************************************************/
Kojto 107:4f6c30876dfa 498 HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 499 HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 500 HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 501 HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 502
Kojto 107:4f6c30876dfa 503 HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal);
Kojto 107:4f6c30876dfa 504 HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal);
Kojto 107:4f6c30876dfa 505 HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 506 HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 507
Kojto 107:4f6c30876dfa 508 int16_t HAL_DFSDM_ChannelGetAwdValue(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 509 HAL_StatusTypeDef HAL_DFSDM_ChannelModifyOffset(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, int32_t Offset);
Kojto 107:4f6c30876dfa 510
Kojto 107:4f6c30876dfa 511 HAL_StatusTypeDef HAL_DFSDM_ChannelPollForCkab(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout);
Kojto 107:4f6c30876dfa 512 HAL_StatusTypeDef HAL_DFSDM_ChannelPollForScd(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout);
Kojto 107:4f6c30876dfa 513
Kojto 107:4f6c30876dfa 514 void HAL_DFSDM_ChannelCkabCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 515 void HAL_DFSDM_ChannelScdCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 516 /**
Kojto 107:4f6c30876dfa 517 * @}
Kojto 107:4f6c30876dfa 518 */
Kojto 107:4f6c30876dfa 519
Kojto 107:4f6c30876dfa 520 /** @defgroup DFSDM_Exported_Functions_Group3_Channel Channel state function
Kojto 107:4f6c30876dfa 521 * @{
Kojto 107:4f6c30876dfa 522 */
Kojto 107:4f6c30876dfa 523 /* Channel state function *****************************************************/
Kojto 107:4f6c30876dfa 524 HAL_DFSDM_Channel_StateTypeDef HAL_DFSDM_ChannelGetState(DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
Kojto 107:4f6c30876dfa 525 /**
Kojto 107:4f6c30876dfa 526 * @}
Kojto 107:4f6c30876dfa 527 */
Kojto 107:4f6c30876dfa 528
Kojto 107:4f6c30876dfa 529 /** @addtogroup DFSDM_Exported_Functions_Group1_Filter Filter initialization and de-initialization functions
Kojto 107:4f6c30876dfa 530 * @{
Kojto 107:4f6c30876dfa 531 */
Kojto 107:4f6c30876dfa 532 /* Filter initialization and de-initialization functions *********************/
Kojto 107:4f6c30876dfa 533 HAL_StatusTypeDef HAL_DFSDM_FilterInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 534 HAL_StatusTypeDef HAL_DFSDM_FilterDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 535 void HAL_DFSDM_FilterMspInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 536 void HAL_DFSDM_FilterMspDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 537 /**
Kojto 107:4f6c30876dfa 538 * @}
Kojto 107:4f6c30876dfa 539 */
Kojto 107:4f6c30876dfa 540
Kojto 107:4f6c30876dfa 541 /** @addtogroup DFSDM_Exported_Functions_Group2_Filter Filter control functions
Kojto 107:4f6c30876dfa 542 * @{
Kojto 107:4f6c30876dfa 543 */
Kojto 107:4f6c30876dfa 544 /* Filter control functions *********************/
Kojto 107:4f6c30876dfa 545 HAL_StatusTypeDef HAL_DFSDM_FilterConfigRegChannel(DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
Kojto 107:4f6c30876dfa 546 uint32_t Channel,
Kojto 107:4f6c30876dfa 547 uint32_t ContinuousMode);
Kojto 107:4f6c30876dfa 548 HAL_StatusTypeDef HAL_DFSDM_FilterConfigInjChannel(DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
Kojto 107:4f6c30876dfa 549 uint32_t Channel);
Kojto 107:4f6c30876dfa 550 /**
Kojto 107:4f6c30876dfa 551 * @}
Kojto 107:4f6c30876dfa 552 */
Kojto 107:4f6c30876dfa 553
Kojto 107:4f6c30876dfa 554 /** @addtogroup DFSDM_Exported_Functions_Group3_Filter Filter operation functions
Kojto 107:4f6c30876dfa 555 * @{
Kojto 107:4f6c30876dfa 556 */
Kojto 107:4f6c30876dfa 557 /* Filter operation functions *********************/
Kojto 107:4f6c30876dfa 558 HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 559 HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 560 HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int32_t *pData, uint32_t Length);
Kojto 107:4f6c30876dfa 561 HAL_StatusTypeDef HAL_DFSDM_FilterRegularMsbStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int16_t *pData, uint32_t Length);
Kojto 107:4f6c30876dfa 562 HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 563 HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 564 HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 565 HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 566 HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 567 HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int32_t *pData, uint32_t Length);
Kojto 107:4f6c30876dfa 568 HAL_StatusTypeDef HAL_DFSDM_FilterInjectedMsbStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int16_t *pData, uint32_t Length);
Kojto 107:4f6c30876dfa 569 HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 570 HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 571 HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 572 HAL_StatusTypeDef HAL_DFSDM_FilterAwdStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
Kojto 107:4f6c30876dfa 573 DFSDM_Filter_AwdParamTypeDef* awdParam);
Kojto 107:4f6c30876dfa 574 HAL_StatusTypeDef HAL_DFSDM_FilterAwdStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 575 HAL_StatusTypeDef HAL_DFSDM_FilterExdStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel);
Kojto 107:4f6c30876dfa 576 HAL_StatusTypeDef HAL_DFSDM_FilterExdStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 577
Kojto 107:4f6c30876dfa 578 int32_t HAL_DFSDM_FilterGetRegularValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t* Channel);
Kojto 107:4f6c30876dfa 579 int32_t HAL_DFSDM_FilterGetInjectedValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t* Channel);
Kojto 107:4f6c30876dfa 580 int32_t HAL_DFSDM_FilterGetExdMaxValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t* Channel);
Kojto 107:4f6c30876dfa 581 int32_t HAL_DFSDM_FilterGetExdMinValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t* Channel);
Kojto 107:4f6c30876dfa 582 uint32_t HAL_DFSDM_FilterGetConvTimeValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 583
Kojto 107:4f6c30876dfa 584 void HAL_DFSDM_IRQHandler(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 585
Kojto 107:4f6c30876dfa 586 HAL_StatusTypeDef HAL_DFSDM_FilterPollForRegConversion(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Timeout);
Kojto 107:4f6c30876dfa 587 HAL_StatusTypeDef HAL_DFSDM_FilterPollForInjConversion(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Timeout);
Kojto 107:4f6c30876dfa 588
Kojto 107:4f6c30876dfa 589 void HAL_DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 590 void HAL_DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 591 void HAL_DFSDM_FilterInjConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 592 void HAL_DFSDM_FilterInjConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 593 void HAL_DFSDM_FilterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel, uint32_t Threshold);
Kojto 107:4f6c30876dfa 594 void HAL_DFSDM_FilterErrorCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 595 /**
Kojto 107:4f6c30876dfa 596 * @}
Kojto 107:4f6c30876dfa 597 */
Kojto 107:4f6c30876dfa 598
Kojto 107:4f6c30876dfa 599 /** @defgroup DFSDM_Exported_Functions_Group4_Filter Filter state functions
Kojto 107:4f6c30876dfa 600 * @{
Kojto 107:4f6c30876dfa 601 */
Kojto 107:4f6c30876dfa 602 /* Filter state functions *****************************************************/
Kojto 107:4f6c30876dfa 603 HAL_DFSDM_Filter_StateTypeDef HAL_DFSDM_FilterGetState(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 604 uint32_t HAL_DFSDM_FilterGetError(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
Kojto 107:4f6c30876dfa 605 /**
Kojto 107:4f6c30876dfa 606 * @}
Kojto 107:4f6c30876dfa 607 */
Kojto 107:4f6c30876dfa 608
Kojto 107:4f6c30876dfa 609 /**
Kojto 107:4f6c30876dfa 610 * @}
Kojto 107:4f6c30876dfa 611 */
Kojto 107:4f6c30876dfa 612 /* End of exported functions -------------------------------------------------*/
Kojto 107:4f6c30876dfa 613
Kojto 107:4f6c30876dfa 614 /* Private macros ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 615 /** @defgroup DFSDM_Private_Macros DFSDM Private Macros
Kojto 107:4f6c30876dfa 616 * @{
Kojto 107:4f6c30876dfa 617 */
Kojto 107:4f6c30876dfa 618 #define IS_DFSDM_CHANNEL_OUTPUT_CLOCK(CLOCK) (((CLOCK) == DFSDM_CHANNEL_OUTPUT_CLOCK_SYSTEM) || \
Kojto 107:4f6c30876dfa 619 ((CLOCK) == DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO))
Kojto 107:4f6c30876dfa 620 #define IS_DFSDM_CHANNEL_OUTPUT_CLOCK_DIVIDER(DIVIDER) ((2 <= (DIVIDER)) && ((DIVIDER) <= 256))
Kojto 107:4f6c30876dfa 621 #define IS_DFSDM_CHANNEL_INPUT(INPUT) (((INPUT) == DFSDM_CHANNEL_EXTERNAL_INPUTS) || \
Kojto 107:4f6c30876dfa 622 ((INPUT) == DFSDM_CHANNEL_INTERNAL_REGISTER))
Kojto 107:4f6c30876dfa 623 #define IS_DFSDM_CHANNEL_DATA_PACKING(MODE) (((MODE) == DFSDM_CHANNEL_STANDARD_MODE) || \
Kojto 107:4f6c30876dfa 624 ((MODE) == DFSDM_CHANNEL_INTERLEAVED_MODE) || \
Kojto 107:4f6c30876dfa 625 ((MODE) == DFSDM_CHANNEL_DUAL_MODE))
Kojto 107:4f6c30876dfa 626 #define IS_DFSDM_CHANNEL_INPUT_PINS(PINS) (((PINS) == DFSDM_CHANNEL_SAME_CHANNEL_PINS) || \
Kojto 107:4f6c30876dfa 627 ((PINS) == DFSDM_CHANNEL_FOLLOWING_CHANNEL_PINS))
Kojto 107:4f6c30876dfa 628 #define IS_DFSDM_CHANNEL_SERIAL_INTERFACE_TYPE(MODE) (((MODE) == DFSDM_CHANNEL_SPI_RISING) || \
Kojto 107:4f6c30876dfa 629 ((MODE) == DFSDM_CHANNEL_SPI_FALLING) || \
Kojto 107:4f6c30876dfa 630 ((MODE) == DFSDM_CHANNEL_MANCHESTER_RISING) || \
Kojto 107:4f6c30876dfa 631 ((MODE) == DFSDM_CHANNEL_MANCHESTER_FALLING))
Kojto 107:4f6c30876dfa 632 #define IS_DFSDM_CHANNEL_SPI_CLOCK(TYPE) (((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL) || \
Kojto 107:4f6c30876dfa 633 ((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_INTERNAL) || \
Kojto 107:4f6c30876dfa 634 ((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_FALLING) || \
Kojto 107:4f6c30876dfa 635 ((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_RISING))
Kojto 107:4f6c30876dfa 636 #define IS_DFSDM_CHANNEL_FILTER_ORDER(ORDER) (((ORDER) == DFSDM_CHANNEL_FASTSINC_ORDER) || \
Kojto 107:4f6c30876dfa 637 ((ORDER) == DFSDM_CHANNEL_SINC1_ORDER) || \
Kojto 107:4f6c30876dfa 638 ((ORDER) == DFSDM_CHANNEL_SINC2_ORDER) || \
Kojto 107:4f6c30876dfa 639 ((ORDER) == DFSDM_CHANNEL_SINC3_ORDER))
Kojto 107:4f6c30876dfa 640 #define IS_DFSDM_CHANNEL_FILTER_OVS_RATIO(RATIO) ((1 <= (RATIO)) && ((RATIO) <= 32))
Kojto 107:4f6c30876dfa 641 #define IS_DFSDM_CHANNEL_OFFSET(VALUE) ((-8388608 <= (VALUE)) && ((VALUE) <= 8388607))
Kojto 107:4f6c30876dfa 642 #define IS_DFSDM_CHANNEL_RIGHT_BIT_SHIFT(VALUE) ((VALUE) <= 0x1F)
Kojto 107:4f6c30876dfa 643 #define IS_DFSDM_CHANNEL_SCD_THRESHOLD(VALUE) ((VALUE) <= 0xFF)
Kojto 107:4f6c30876dfa 644 #define IS_DFSDM_FILTER_REG_TRIGGER(TRIG) (((TRIG) == DFSDM_FILTER_SW_TRIGGER) || \
Kojto 107:4f6c30876dfa 645 ((TRIG) == DFSDM_FILTER_SYNC_TRIGGER))
Kojto 107:4f6c30876dfa 646 #define IS_DFSDM_FILTER_INJ_TRIGGER(TRIG) (((TRIG) == DFSDM_FILTER_SW_TRIGGER) || \
Kojto 107:4f6c30876dfa 647 ((TRIG) == DFSDM_FILTER_SYNC_TRIGGER) || \
Kojto 107:4f6c30876dfa 648 ((TRIG) == DFSDM_FILTER_EXT_TRIGGER))
Kojto 107:4f6c30876dfa 649 #define IS_DFSDM_FILTER_EXT_TRIG(TRIG) (((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO) || \
Kojto 107:4f6c30876dfa 650 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2) || \
Kojto 107:4f6c30876dfa 651 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM8_TRGO) || \
Kojto 107:4f6c30876dfa 652 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM8_TRGO2) || \
Kojto 107:4f6c30876dfa 653 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM3_TRGO) || \
Kojto 107:4f6c30876dfa 654 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM4_TRGO) || \
Kojto 107:4f6c30876dfa 655 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM16_OC1) || \
Kojto 107:4f6c30876dfa 656 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM6_TRGO) || \
Kojto 107:4f6c30876dfa 657 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM7_TRGO) || \
Kojto 107:4f6c30876dfa 658 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI11) || \
Kojto 107:4f6c30876dfa 659 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI15))
Kojto 107:4f6c30876dfa 660 #define IS_DFSDM_FILTER_EXT_TRIG_EDGE(EDGE) (((EDGE) == DFSDM_FILTER_EXT_TRIG_RISING_EDGE) || \
Kojto 107:4f6c30876dfa 661 ((EDGE) == DFSDM_FILTER_EXT_TRIG_FALLING_EDGE) || \
Kojto 107:4f6c30876dfa 662 ((EDGE) == DFSDM_FILTER_EXT_TRIG_BOTH_EDGES))
Kojto 107:4f6c30876dfa 663 #define IS_DFSDM_FILTER_SINC_ORDER(ORDER) (((ORDER) == DFSDM_FILTER_FASTSINC_ORDER) || \
Kojto 107:4f6c30876dfa 664 ((ORDER) == DFSDM_FILTER_SINC1_ORDER) || \
Kojto 107:4f6c30876dfa 665 ((ORDER) == DFSDM_FILTER_SINC2_ORDER) || \
Kojto 107:4f6c30876dfa 666 ((ORDER) == DFSDM_FILTER_SINC3_ORDER) || \
Kojto 107:4f6c30876dfa 667 ((ORDER) == DFSDM_FILTER_SINC4_ORDER) || \
Kojto 107:4f6c30876dfa 668 ((ORDER) == DFSDM_FILTER_SINC5_ORDER))
Kojto 107:4f6c30876dfa 669 #define IS_DFSDM_FILTER_OVS_RATIO(RATIO) ((1 <= (RATIO)) && ((RATIO) <= 1024))
Kojto 107:4f6c30876dfa 670 #define IS_DFSDM_FILTER_INTEGRATOR_OVS_RATIO(RATIO) ((1 <= (RATIO)) && ((RATIO) <= 256))
Kojto 107:4f6c30876dfa 671 #define IS_DFSDM_FILTER_AWD_DATA_SOURCE(DATA) (((DATA) == DFSDM_FILTER_AWD_FILTER_DATA) || \
Kojto 107:4f6c30876dfa 672 ((DATA) == DFSDM_FILTER_AWD_CHANNEL_DATA))
Kojto 107:4f6c30876dfa 673 #define IS_DFSDM_FILTER_AWD_THRESHOLD(VALUE) ((-8388608 <= (VALUE)) && ((VALUE) <= 8388607))
Kojto 122:f9eeca106725 674 #define IS_DFSDM_BREAK_SIGNALS(VALUE) ((VALUE) <= 0xFU)
Kojto 107:4f6c30876dfa 675 #define IS_DFSDM_REGULAR_CHANNEL(CHANNEL) (((CHANNEL) == DFSDM_CHANNEL_0) || \
Kojto 107:4f6c30876dfa 676 ((CHANNEL) == DFSDM_CHANNEL_1) || \
Kojto 107:4f6c30876dfa 677 ((CHANNEL) == DFSDM_CHANNEL_2) || \
Kojto 107:4f6c30876dfa 678 ((CHANNEL) == DFSDM_CHANNEL_3) || \
Kojto 107:4f6c30876dfa 679 ((CHANNEL) == DFSDM_CHANNEL_4) || \
Kojto 107:4f6c30876dfa 680 ((CHANNEL) == DFSDM_CHANNEL_5) || \
Kojto 107:4f6c30876dfa 681 ((CHANNEL) == DFSDM_CHANNEL_6) || \
Kojto 107:4f6c30876dfa 682 ((CHANNEL) == DFSDM_CHANNEL_7))
Kojto 122:f9eeca106725 683 #define IS_DFSDM_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) != 0) && ((CHANNEL) <= 0x000F00FFU))
Kojto 107:4f6c30876dfa 684 #define IS_DFSDM_CONTINUOUS_MODE(MODE) (((MODE) == DFSDM_CONTINUOUS_CONV_OFF) || \
Kojto 107:4f6c30876dfa 685 ((MODE) == DFSDM_CONTINUOUS_CONV_ON))
Kojto 107:4f6c30876dfa 686 /**
Kojto 107:4f6c30876dfa 687 * @}
Kojto 107:4f6c30876dfa 688 */
Kojto 107:4f6c30876dfa 689 /* End of private macros -----------------------------------------------------*/
Kojto 107:4f6c30876dfa 690
Kojto 107:4f6c30876dfa 691 /**
Kojto 107:4f6c30876dfa 692 * @}
Kojto 107:4f6c30876dfa 693 */
Kojto 107:4f6c30876dfa 694
Kojto 107:4f6c30876dfa 695 /**
Kojto 107:4f6c30876dfa 696 * @}
Kojto 107:4f6c30876dfa 697 */
Kojto 122:f9eeca106725 698 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
Kojto 107:4f6c30876dfa 699 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 700 }
Kojto 107:4f6c30876dfa 701 #endif
Kojto 107:4f6c30876dfa 702
Kojto 107:4f6c30876dfa 703 #endif /* __STM32L4xx_HAL_DFSDM_H */
Kojto 107:4f6c30876dfa 704
Kojto 107:4f6c30876dfa 705 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/