21 #ifndef STM32L4xx_HAL_DFSDM_H 22 #define STM32L4xx_HAL_DFSDM_H 28 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) || \ 29 defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) || \ 30 defined(STM32L496xx) || defined(STM32L4A6xx) || \ 31 defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) 127 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 128 typedef struct __DFSDM_Channel_HandleTypeDef
135 HAL_DFSDM_Channel_StateTypeDef
State;
136 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 137 void (*CkabCallback)(
struct __DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
138 void (*ScdCallback)(
struct __DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
139 void (*MspInitCallback)(
struct __DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
140 void (*MspDeInitCallback)(
struct __DFSDM_Channel_HandleTypeDef *hdfsdm_channel);
144 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 227 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 228 typedef struct __DFSDM_Filter_HandleTypeDef
244 HAL_DFSDM_Filter_StateTypeDef
State;
246 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 247 void (*AwdCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
248 uint32_t Channel, uint32_t Threshold);
249 void (*RegConvCpltCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
250 void (*RegConvHalfCpltCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
251 void (*InjConvCpltCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
252 void (*InjConvHalfCpltCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
253 void (*ErrorCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
254 void (*MspInitCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
255 void (*MspDeInitCallback)(
struct __DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
278 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 313 #define DFSDM_CHANNEL_OUTPUT_CLOCK_SYSTEM 0x00000000U 314 #define DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO DFSDM_CHCFGR1_CKOUTSRC 322 #define DFSDM_CHANNEL_EXTERNAL_INPUTS 0x00000000U 323 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) || \ 324 defined(STM32L496xx) || defined(STM32L4A6xx) || \ 325 defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) 326 #define DFSDM_CHANNEL_ADC_OUTPUT DFSDM_CHCFGR1_DATMPX_0 328 #define DFSDM_CHANNEL_INTERNAL_REGISTER DFSDM_CHCFGR1_DATMPX_1 336 #define DFSDM_CHANNEL_STANDARD_MODE 0x00000000U 337 #define DFSDM_CHANNEL_INTERLEAVED_MODE DFSDM_CHCFGR1_DATPACK_0 338 #define DFSDM_CHANNEL_DUAL_MODE DFSDM_CHCFGR1_DATPACK_1 346 #define DFSDM_CHANNEL_SAME_CHANNEL_PINS 0x00000000U 347 #define DFSDM_CHANNEL_FOLLOWING_CHANNEL_PINS DFSDM_CHCFGR1_CHINSEL 355 #define DFSDM_CHANNEL_SPI_RISING 0x00000000U 356 #define DFSDM_CHANNEL_SPI_FALLING DFSDM_CHCFGR1_SITP_0 357 #define DFSDM_CHANNEL_MANCHESTER_RISING DFSDM_CHCFGR1_SITP_1 358 #define DFSDM_CHANNEL_MANCHESTER_FALLING DFSDM_CHCFGR1_SITP 366 #define DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL 0x00000000U 367 #define DFSDM_CHANNEL_SPI_CLOCK_INTERNAL DFSDM_CHCFGR1_SPICKSEL_0 368 #define DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_FALLING DFSDM_CHCFGR1_SPICKSEL_1 369 #define DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_RISING DFSDM_CHCFGR1_SPICKSEL 377 #define DFSDM_CHANNEL_FASTSINC_ORDER 0x00000000U 378 #define DFSDM_CHANNEL_SINC1_ORDER DFSDM_CHAWSCDR_AWFORD_0 379 #define DFSDM_CHANNEL_SINC2_ORDER DFSDM_CHAWSCDR_AWFORD_1 380 #define DFSDM_CHANNEL_SINC3_ORDER DFSDM_CHAWSCDR_AWFORD 388 #define DFSDM_FILTER_SW_TRIGGER 0x00000000U 389 #define DFSDM_FILTER_SYNC_TRIGGER 0x00000001U 390 #define DFSDM_FILTER_EXT_TRIGGER 0x00000002U 398 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) 399 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO 0x00000000U 400 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2 DFSDM_FLTCR1_JEXTSEL_0 401 #define DFSDM_FILTER_EXT_TRIG_TIM3_TRGO DFSDM_FLTCR1_JEXTSEL_1 402 #define DFSDM_FILTER_EXT_TRIG_TIM16_OC1 (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_1) 403 #define DFSDM_FILTER_EXT_TRIG_TIM6_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_2) 404 #define DFSDM_FILTER_EXT_TRIG_EXTI11 (DFSDM_FLTCR1_JEXTSEL_1 | DFSDM_FLTCR1_JEXTSEL_2) 405 #define DFSDM_FILTER_EXT_TRIG_EXTI15 DFSDM_FLTCR1_JEXTSEL 406 #elif defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) 407 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO 0x00000000U 408 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2 DFSDM_FLTCR1_JEXTSEL_0 409 #define DFSDM_FILTER_EXT_TRIG_TIM8_TRGO DFSDM_FLTCR1_JEXTSEL_1 410 #define DFSDM_FILTER_EXT_TRIG_TIM8_TRGO2 (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_1) 411 #define DFSDM_FILTER_EXT_TRIG_TIM3_TRGO DFSDM_FLTCR1_JEXTSEL_2 412 #define DFSDM_FILTER_EXT_TRIG_TIM4_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_2) 413 #define DFSDM_FILTER_EXT_TRIG_TIM16_OC1 (DFSDM_FLTCR1_JEXTSEL_1 | DFSDM_FLTCR1_JEXTSEL_2) 414 #define DFSDM_FILTER_EXT_TRIG_TIM6_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_1 | \ 415 DFSDM_FLTCR1_JEXTSEL_2) 416 #define DFSDM_FILTER_EXT_TRIG_TIM7_TRGO DFSDM_FLTCR1_JEXTSEL_3 417 #define DFSDM_FILTER_EXT_TRIG_EXTI11 (DFSDM_FLTCR1_JEXTSEL_3 | DFSDM_FLTCR1_JEXTSEL_4) 418 #define DFSDM_FILTER_EXT_TRIG_EXTI15 (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_3 | \ 419 DFSDM_FLTCR1_JEXTSEL_4) 420 #define DFSDM_FILTER_EXT_TRIG_LPTIM1_OUT (DFSDM_FLTCR1_JEXTSEL_1 | DFSDM_FLTCR1_JEXTSEL_3 | \ 421 DFSDM_FLTCR1_JEXTSEL_4) 423 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO 0x00000000U 424 #define DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2 DFSDM_FLTCR1_JEXTSEL_0 425 #define DFSDM_FILTER_EXT_TRIG_TIM8_TRGO DFSDM_FLTCR1_JEXTSEL_1 426 #define DFSDM_FILTER_EXT_TRIG_TIM8_TRGO2 (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_1) 427 #define DFSDM_FILTER_EXT_TRIG_TIM3_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_1) 428 #define DFSDM_FILTER_EXT_TRIG_TIM4_TRGO DFSDM_FLTCR1_JEXTSEL_2 429 #define DFSDM_FILTER_EXT_TRIG_TIM16_OC1 DFSDM_FLTCR1_JEXTSEL_2 430 #define DFSDM_FILTER_EXT_TRIG_TIM6_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_2) 431 #define DFSDM_FILTER_EXT_TRIG_TIM7_TRGO (DFSDM_FLTCR1_JEXTSEL_0 | DFSDM_FLTCR1_JEXTSEL_2) 432 #define DFSDM_FILTER_EXT_TRIG_EXTI11 (DFSDM_FLTCR1_JEXTSEL_1 | DFSDM_FLTCR1_JEXTSEL_2) 433 #define DFSDM_FILTER_EXT_TRIG_EXTI15 DFSDM_FLTCR1_JEXTSEL 442 #define DFSDM_FILTER_EXT_TRIG_RISING_EDGE DFSDM_FLTCR1_JEXTEN_0 443 #define DFSDM_FILTER_EXT_TRIG_FALLING_EDGE DFSDM_FLTCR1_JEXTEN_1 444 #define DFSDM_FILTER_EXT_TRIG_BOTH_EDGES DFSDM_FLTCR1_JEXTEN 452 #define DFSDM_FILTER_FASTSINC_ORDER 0x00000000U 453 #define DFSDM_FILTER_SINC1_ORDER DFSDM_FLTFCR_FORD_0 454 #define DFSDM_FILTER_SINC2_ORDER DFSDM_FLTFCR_FORD_1 455 #define DFSDM_FILTER_SINC3_ORDER (DFSDM_FLTFCR_FORD_0 | DFSDM_FLTFCR_FORD_1) 456 #define DFSDM_FILTER_SINC4_ORDER DFSDM_FLTFCR_FORD_2 457 #define DFSDM_FILTER_SINC5_ORDER (DFSDM_FLTFCR_FORD_0 | DFSDM_FLTFCR_FORD_2) 465 #define DFSDM_FILTER_AWD_FILTER_DATA 0x00000000U 466 #define DFSDM_FILTER_AWD_CHANNEL_DATA DFSDM_FLTCR1_AWFSEL 474 #define DFSDM_FILTER_ERROR_NONE 0x00000000U 475 #define DFSDM_FILTER_ERROR_REGULAR_OVERRUN 0x00000001U 476 #define DFSDM_FILTER_ERROR_INJECTED_OVERRUN 0x00000002U 477 #define DFSDM_FILTER_ERROR_DMA 0x00000003U 478 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 479 #define DFSDM_FILTER_ERROR_INVALID_CALLBACK 0x00000004U 488 #define DFSDM_NO_BREAK_SIGNAL 0x00000000U 489 #define DFSDM_BREAK_SIGNAL_0 0x00000001U 490 #define DFSDM_BREAK_SIGNAL_1 0x00000002U 491 #define DFSDM_BREAK_SIGNAL_2 0x00000004U 492 #define DFSDM_BREAK_SIGNAL_3 0x00000008U 508 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) 509 #define DFSDM_CHANNEL_0 0x00000001U 510 #define DFSDM_CHANNEL_1 0x00010002U 511 #define DFSDM_CHANNEL_2 0x00020004U 512 #define DFSDM_CHANNEL_3 0x00030008U 514 #define DFSDM_CHANNEL_0 0x00000001U 515 #define DFSDM_CHANNEL_1 0x00010002U 516 #define DFSDM_CHANNEL_2 0x00020004U 517 #define DFSDM_CHANNEL_3 0x00030008U 518 #define DFSDM_CHANNEL_4 0x00040010U 519 #define DFSDM_CHANNEL_5 0x00050020U 520 #define DFSDM_CHANNEL_6 0x00060040U 521 #define DFSDM_CHANNEL_7 0x00070080U 530 #define DFSDM_CONTINUOUS_CONV_OFF 0x00000000U 531 #define DFSDM_CONTINUOUS_CONV_ON 0x00000001U 539 #define DFSDM_AWD_HIGH_THRESHOLD 0x00000000U 540 #define DFSDM_AWD_LOW_THRESHOLD 0x00000001U 559 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 560 #define __HAL_DFSDM_CHANNEL_RESET_HANDLE_STATE(__HANDLE__) do{ \ 561 (__HANDLE__)->State = HAL_DFSDM_CHANNEL_STATE_RESET; \ 562 (__HANDLE__)->MspInitCallback = NULL; \ 563 (__HANDLE__)->MspDeInitCallback = NULL; \ 566 #define __HAL_DFSDM_CHANNEL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DFSDM_CHANNEL_STATE_RESET) 573 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 574 #define __HAL_DFSDM_FILTER_RESET_HANDLE_STATE(__HANDLE__) do{ \ 575 (__HANDLE__)->State = HAL_DFSDM_FILTER_STATE_RESET; \ 576 (__HANDLE__)->MspInitCallback = NULL; \ 577 (__HANDLE__)->MspDeInitCallback = NULL; \ 580 #define __HAL_DFSDM_FILTER_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DFSDM_FILTER_STATE_RESET) 588 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) 607 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 610 HAL_DFSDM_Channel_CallbackIDTypeDef CallbackID,
613 HAL_DFSDM_Channel_CallbackIDTypeDef CallbackID);
663 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1) 666 HAL_DFSDM_Filter_CallbackIDTypeDef CallbackID,
669 HAL_DFSDM_Filter_CallbackIDTypeDef CallbackID);
684 uint32_t ContinuousMode);
755 #define IS_DFSDM_CHANNEL_OUTPUT_CLOCK(CLOCK) (((CLOCK) == DFSDM_CHANNEL_OUTPUT_CLOCK_SYSTEM) || \ 756 ((CLOCK) == DFSDM_CHANNEL_OUTPUT_CLOCK_AUDIO)) 757 #define IS_DFSDM_CHANNEL_OUTPUT_CLOCK_DIVIDER(DIVIDER) ((2U <= (DIVIDER)) && ((DIVIDER) <= 256U)) 758 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) || \ 759 defined(STM32L496xx) || defined(STM32L4A6xx) || \ 760 defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) 761 #define IS_DFSDM_CHANNEL_INPUT(INPUT) (((INPUT) == DFSDM_CHANNEL_EXTERNAL_INPUTS) || \ 762 ((INPUT) == DFSDM_CHANNEL_ADC_OUTPUT) || \ 763 ((INPUT) == DFSDM_CHANNEL_INTERNAL_REGISTER)) 765 #define IS_DFSDM_CHANNEL_INPUT(INPUT) (((INPUT) == DFSDM_CHANNEL_EXTERNAL_INPUTS) || \ 766 ((INPUT) == DFSDM_CHANNEL_INTERNAL_REGISTER)) 770 #define IS_DFSDM_CHANNEL_DATA_PACKING(MODE) (((MODE) == DFSDM_CHANNEL_STANDARD_MODE) || \ 771 ((MODE) == DFSDM_CHANNEL_INTERLEAVED_MODE) || \ 772 ((MODE) == DFSDM_CHANNEL_DUAL_MODE)) 773 #define IS_DFSDM_CHANNEL_INPUT_PINS(PINS) (((PINS) == DFSDM_CHANNEL_SAME_CHANNEL_PINS) || \ 774 ((PINS) == DFSDM_CHANNEL_FOLLOWING_CHANNEL_PINS)) 775 #define IS_DFSDM_CHANNEL_SERIAL_INTERFACE_TYPE(MODE) (((MODE) == DFSDM_CHANNEL_SPI_RISING) || \ 776 ((MODE) == DFSDM_CHANNEL_SPI_FALLING) || \ 777 ((MODE) == DFSDM_CHANNEL_MANCHESTER_RISING) || \ 778 ((MODE) == DFSDM_CHANNEL_MANCHESTER_FALLING)) 779 #define IS_DFSDM_CHANNEL_SPI_CLOCK(TYPE) (((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL) || \ 780 ((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_INTERNAL) || \ 781 ((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_FALLING) || \ 782 ((TYPE) == DFSDM_CHANNEL_SPI_CLOCK_INTERNAL_DIV2_RISING)) 783 #define IS_DFSDM_CHANNEL_FILTER_ORDER(ORDER) (((ORDER) == DFSDM_CHANNEL_FASTSINC_ORDER) || \ 784 ((ORDER) == DFSDM_CHANNEL_SINC1_ORDER) || \ 785 ((ORDER) == DFSDM_CHANNEL_SINC2_ORDER) || \ 786 ((ORDER) == DFSDM_CHANNEL_SINC3_ORDER)) 787 #define IS_DFSDM_CHANNEL_FILTER_OVS_RATIO(RATIO) ((1U <= (RATIO)) && ((RATIO) <= 32U)) 788 #define IS_DFSDM_CHANNEL_OFFSET(VALUE) ((-8388608 <= (VALUE)) && ((VALUE) <= 8388607)) 789 #define IS_DFSDM_CHANNEL_RIGHT_BIT_SHIFT(VALUE) ((VALUE) <= 0x1FU) 790 #define IS_DFSDM_CHANNEL_SCD_THRESHOLD(VALUE) ((VALUE) <= 0xFFU) 791 #define IS_DFSDM_FILTER_REG_TRIGGER(TRIG) (((TRIG) == DFSDM_FILTER_SW_TRIGGER) || \ 792 ((TRIG) == DFSDM_FILTER_SYNC_TRIGGER)) 793 #define IS_DFSDM_FILTER_INJ_TRIGGER(TRIG) (((TRIG) == DFSDM_FILTER_SW_TRIGGER) || \ 794 ((TRIG) == DFSDM_FILTER_SYNC_TRIGGER) || \ 795 ((TRIG) == DFSDM_FILTER_EXT_TRIGGER)) 796 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) 797 #define IS_DFSDM_FILTER_EXT_TRIG(TRIG) (((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO) || \ 798 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2) || \ 799 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM3_TRGO) || \ 800 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM16_OC1) || \ 801 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM6_TRGO) || \ 802 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI11) || \ 803 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI15)) 804 #elif defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) 805 #define IS_DFSDM_FILTER_EXT_TRIG(TRIG) (((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO) || \ 806 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2) || \ 807 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM8_TRGO) || \ 808 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM8_TRGO2) || \ 809 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM3_TRGO) || \ 810 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM4_TRGO) || \ 811 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM16_OC1) || \ 812 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM6_TRGO) || \ 813 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM7_TRGO) || \ 814 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI11) || \ 815 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI15) || \ 816 ((TRIG) == DFSDM_FILTER_EXT_TRIG_LPTIM1_OUT)) 818 #define IS_DFSDM_FILTER_EXT_TRIG(TRIG) (((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO) || \ 819 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM1_TRGO2) || \ 820 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM8_TRGO) || \ 821 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM8_TRGO2) || \ 822 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM3_TRGO) || \ 823 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM4_TRGO) || \ 824 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM16_OC1) || \ 825 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM6_TRGO) || \ 826 ((TRIG) == DFSDM_FILTER_EXT_TRIG_TIM7_TRGO) || \ 827 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI11) || \ 828 ((TRIG) == DFSDM_FILTER_EXT_TRIG_EXTI15)) 830 #define IS_DFSDM_FILTER_EXT_TRIG_EDGE(EDGE) (((EDGE) == DFSDM_FILTER_EXT_TRIG_RISING_EDGE) || \ 831 ((EDGE) == DFSDM_FILTER_EXT_TRIG_FALLING_EDGE) || \ 832 ((EDGE) == DFSDM_FILTER_EXT_TRIG_BOTH_EDGES)) 833 #define IS_DFSDM_FILTER_SINC_ORDER(ORDER) (((ORDER) == DFSDM_FILTER_FASTSINC_ORDER) || \ 834 ((ORDER) == DFSDM_FILTER_SINC1_ORDER) || \ 835 ((ORDER) == DFSDM_FILTER_SINC2_ORDER) || \ 836 ((ORDER) == DFSDM_FILTER_SINC3_ORDER) || \ 837 ((ORDER) == DFSDM_FILTER_SINC4_ORDER) || \ 838 ((ORDER) == DFSDM_FILTER_SINC5_ORDER)) 839 #define IS_DFSDM_FILTER_OVS_RATIO(RATIO) ((1U <= (RATIO)) && ((RATIO) <= 1024U)) 840 #define IS_DFSDM_FILTER_INTEGRATOR_OVS_RATIO(RATIO) ((1U <= (RATIO)) && ((RATIO) <= 256U)) 841 #define IS_DFSDM_FILTER_AWD_DATA_SOURCE(DATA) (((DATA) == DFSDM_FILTER_AWD_FILTER_DATA) || \ 842 ((DATA) == DFSDM_FILTER_AWD_CHANNEL_DATA)) 843 #define IS_DFSDM_FILTER_AWD_THRESHOLD(VALUE) ((-8388608 <= (VALUE)) && ((VALUE) <= 8388607)) 844 #define IS_DFSDM_BREAK_SIGNALS(VALUE) ((VALUE) <= 0xFU) 845 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) 846 #define IS_DFSDM_REGULAR_CHANNEL(CHANNEL) (((CHANNEL) == DFSDM_CHANNEL_0) || \ 847 ((CHANNEL) == DFSDM_CHANNEL_1) || \ 848 ((CHANNEL) == DFSDM_CHANNEL_2) || \ 849 ((CHANNEL) == DFSDM_CHANNEL_3)) 850 #define IS_DFSDM_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) != 0U) && ((CHANNEL) <= 0x0003000FU)) 852 #define IS_DFSDM_REGULAR_CHANNEL(CHANNEL) (((CHANNEL) == DFSDM_CHANNEL_0) || \ 853 ((CHANNEL) == DFSDM_CHANNEL_1) || \ 854 ((CHANNEL) == DFSDM_CHANNEL_2) || \ 855 ((CHANNEL) == DFSDM_CHANNEL_3) || \ 856 ((CHANNEL) == DFSDM_CHANNEL_4) || \ 857 ((CHANNEL) == DFSDM_CHANNEL_5) || \ 858 ((CHANNEL) == DFSDM_CHANNEL_6) || \ 859 ((CHANNEL) == DFSDM_CHANNEL_7)) 860 #define IS_DFSDM_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) != 0U) && ((CHANNEL) <= 0x000F00FFU)) 862 #define IS_DFSDM_CONTINUOUS_MODE(MODE) (((MODE) == DFSDM_CONTINUOUS_CONV_OFF) || \ 863 ((MODE) == DFSDM_CONTINUOUS_CONV_ON)) HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop regular conversion in polling mode.
HAL_DFSDM_Filter_StateTypeDef
HAL DFSDM Filter states definition.
HAL_StatusTypeDef HAL_DFSDM_FilterDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
De-initializes the DFSDM filter.
struct __DFSDM_Channel_HandleTypeDef else typedef struct endif DFSDM_Channel_HandleTypeDef
DFSDM channel handle structure definition.
int32_t HAL_DFSDM_FilterGetInjectedValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
This function allows to get injected conversion value.
HAL_StatusTypeDef HAL_DFSDM_FilterPollForRegConversion(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Timeout)
This function allows to poll for the end of regular conversion.
DFSDM filter regular conversion parameters structure definition.
HAL_StatusTypeDef HAL_DFSDM_Filter_UnRegisterCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, HAL_DFSDM_Filter_CallbackIDTypeDef CallbackID)
Unregister a user DFSDM filter callback. DFSDM filter callback is redirected to the weak predefined c...
DFSDM_Filter_TypeDef * Instance
int16_t HAL_DFSDM_ChannelGetAwdValue(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to get channel analog watchdog value.
void HAL_DFSDM_ChannelScdCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
Short circuit detection callback.
void HAL_DFSDM_FilterErrorCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Error callback.
DFSDM_Filter_RegularParamTypeDef RegularParam
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to stop short circuit detection in polling mode.
DMA_HandleTypeDef * hdmaReg
DMA handle Structure definition.
DFSDM filter injected conversion parameters structure definition.
int32_t HAL_DFSDM_FilterGetExdMaxValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
This function allows to get extreme detector maximum value.
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int32_t *pData, uint32_t Length)
This function allows to start regular conversion in DMA mode.
HAL_StatusTypeDef HAL_DFSDM_Filter_RegisterCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, HAL_DFSDM_Filter_CallbackIDTypeDef CallbackID, pDFSDM_Filter_CallbackTypeDef pCallback)
Register a user DFSDM filter callback to be used instead of the weak predefined callback.
DFSDM_Channel_InputTypeDef Input
int32_t HAL_DFSDM_FilterGetExdMinValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
This function allows to get extreme detector minimum value.
HAL_StatusTypeDef HAL_DFSDM_FilterExdStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel)
This function allows to start extreme detector feature.
void HAL_DFSDM_ChannelMspDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
De-initialize the DFSDM channel MSP.
HAL_DFSDM_Channel_StateTypeDef State
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop injected conversion in polling mode.
HAL_StatusTypeDef HAL_DFSDM_Channel_UnRegisterCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, HAL_DFSDM_Channel_CallbackIDTypeDef CallbackID)
Unregister a user DFSDM channel callback. DFSDM channel callback is redirected to the weak predefined...
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop regular conversion in interrupt mode.
DFSDM_Channel_OutputClockTypeDef OutputClock
DFSDM_Channel_TypeDef * Instance
int32_t HAL_DFSDM_FilterGetRegularValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
This function allows to get regular conversion value.
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to start injected conversion in interrupt mode.
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to stop short circuit detection in interrupt mode.
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to start clock absence detection in polling mode.
struct __DFSDM_Filter_HandleTypeDef else typedef struct endif DFSDM_Filter_HandleTypeDef
DFSDM filter handle structure definition.
DFSDM_Filter_FilterParamTypeDef FilterParam
void HAL_DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Half regular conversion complete callback.
HAL_StatusTypeDef HAL_DFSDM_FilterPollForInjConversion(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Timeout)
This function allows to poll for the end of injected conversion.
HAL_DFSDM_Filter_StateTypeDef HAL_DFSDM_FilterGetState(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to get the current DFSDM filter handle state.
FunctionalState Activation
DFSDM filter init structure definition.
void HAL_DFSDM_ChannelCkabCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
Clock absence detection callback.
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to start regular conversion in polling mode.
HAL_StatusTypeDef HAL_DFSDM_FilterConfigInjChannel(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel)
This function allows to select channels for injected conversion.
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to stop clock absence detection in polling mode.
DFSDM channel init structure definition.
uint32_t HAL_DFSDM_FilterGetError(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to get the current DFSDM filter error.
Header file of DFSDM HAL extended module.
void HAL_DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Regular conversion complete callback.
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop injected conversion in interrupt mode.
DFSDM filter analog watchdog parameters structure definition.
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to start clock absence detection in interrupt mode.
HAL_StatusTypeDef HAL_DFSDM_FilterAwdStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop filter analog watchdog in interrupt mode.
void HAL_DFSDM_FilterInjConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Half injected conversion complete callback.
uint32_t HAL_DFSDM_FilterGetConvTimeValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to get conversion time value.
HAL_StatusTypeDef HAL_DFSDM_FilterAwdStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, DFSDM_Filter_AwdParamTypeDef *awdParam)
This function allows to start filter analog watchdog in interrupt mode.
DMA_HandleTypeDef * hdmaInj
DFSDM_Channel_SerialInterfaceTypeDef SerialInterface
HAL_StatusTypeDef HAL_DFSDM_FilterExdStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop extreme detector feature.
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal)
This function allows to start short circuit detection in interrupt mode.
void(* pDFSDM_Filter_AwdCallbackTypeDef)(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel, uint32_t Threshold)
HAL_StatusTypeDef HAL_DFSDM_FilterInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Initialize the DFSDM filter according to the specified parameters in the DFSDM_FilterInitTypeDef stru...
uint32_t InjectedChannelsNbr
HAL_StatusTypeDef HAL_DFSDM_ChannelPollForScd(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout)
This function allows to poll for the short circuit detection.
void HAL_DFSDM_IRQHandler(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function handles the DFSDM interrupts.
HAL_StatusTypeDef HAL_DFSDM_Channel_RegisterCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, HAL_DFSDM_Channel_CallbackIDTypeDef CallbackID, pDFSDM_Channel_CallbackTypeDef pCallback)
Register a user DFSDM channel callback to be used instead of the weak predefined callback.
HAL_DFSDM_Channel_StateTypeDef HAL_DFSDM_ChannelGetState(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to get the current DFSDM channel handle state.
HAL_DFSDM_Filter_StateTypeDef State
HAL_StatusTypeDef HAL_DFSDM_ChannelPollForCkab(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout)
This function allows to poll for the clock absence detection.
DFSDM_Filter_InitTypeDef Init
void HAL_DFSDM_FilterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel, uint32_t Threshold)
Filter analog watchdog callback.
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to start injected conversion in polling mode.
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedMsbStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int16_t *pData, uint32_t Length)
This function allows to start injected conversion in DMA mode and to get only the 16 most significant...
HAL_StatusTypeDef HAL_DFSDM_ChannelDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
De-initialize the DFSDM channel.
void(* pDFSDM_Channel_CallbackTypeDef)(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM channel callback pointer definition.
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int32_t *pData, uint32_t Length)
This function allows to start injected conversion in DMA mode.
HAL_StatusTypeDef HAL_DFSDM_FilterConfigRegChannel(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel, uint32_t ContinuousMode)
This function allows to select channel and to enable/disable continuous mode for regular conversion...
ADC handle Structure definition.
DFSDM_Channel_InitTypeDef Init
HAL_DFSDM_Channel_StateTypeDef
HAL DFSDM Channel states definition.
void HAL_DFSDM_ChannelMspInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
Initialize the DFSDM channel MSP.
HAL_StatusTypeDef HAL_DFSDM_FilterRegularMsbStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int16_t *pData, uint32_t Length)
This function allows to start regular conversion in DMA mode and to get only the 16 most significant ...
void(* pDFSDM_Filter_CallbackTypeDef)(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM filter callback pointer definition.
DFSDM_Channel_AwdTypeDef Awd
HAL_StatusTypeDef HAL_DFSDM_Filter_RegisterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, pDFSDM_Filter_AwdCallbackTypeDef pCallback)
Register a user DFSDM filter analog watchdog callback to be used instead of the weak predefined callb...
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
This function allows to stop clock absence detection in interrupt mode.
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop regular conversion in DMA mode.
DFSDM filter parameters structure definition.
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal)
This function allows to start short circuit detection in polling mode.
HAL_StatusTypeDef HAL_DFSDM_Filter_UnRegisterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Unregister a user DFSDM filter analog watchdog callback. DFSDM filter AWD callback is redirected to t...
DFSDM_Filter_InjectedParamTypeDef InjectedParam
HAL_StatusTypeDef HAL_DFSDM_ChannelModifyOffset(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, int32_t Offset)
This function allows to modify channel offset value.
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to start regular conversion in interrupt mode.
DFSDM channel output clock structure definition.
DFSDM channel serial interface structure definition.
HAL_StatusTypeDef HAL_DFSDM_ChannelInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
Initialize the DFSDM channel according to the specified parameters in the DFSDM_ChannelInitTypeDef st...
void HAL_DFSDM_FilterInjConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Injected conversion complete callback.
void HAL_DFSDM_FilterMspDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
De-initializes the DFSDM filter MSP.
void HAL_DFSDM_FilterMspInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Initializes the DFSDM filter MSP.
FunctionalState InjectedScanMode
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
This function allows to stop injected conversion in DMA mode.
DFSDM channel analog watchdog structure definition.
HAL_DFSDM_Filter_CallbackIDTypeDef
DFSDM filter callback ID enumeration definition.
HAL_DFSDM_Channel_CallbackIDTypeDef
DFSDM channel callback ID enumeration definition.
uint32_t InjConvRemaining