stm32f7xx_hal_dfsdm.c
Go to the documentation of this file.
1 
267 /* Includes ------------------------------------------------------------------*/
268 #include "stm32f7xx_hal.h"
269 
273 #ifdef HAL_DFSDM_MODULE_ENABLED
274 #if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
275 
280 /* Private typedef -----------------------------------------------------------*/
281 /* Private define ------------------------------------------------------------*/
286 #define DFSDM_FLTCR1_MSB_RCH_OFFSET 8
287 
288 #define DFSDM_MSB_MASK 0xFFFF0000U
289 #define DFSDM_LSB_MASK 0x0000FFFFU
290 #define DFSDM_CKAB_TIMEOUT 5000U
291 #define DFSDM1_CHANNEL_NUMBER 8U
292 
296 /* Private macro -------------------------------------------------------------*/
297 /* Private variables ---------------------------------------------------------*/
301 __IO uint32_t v_dfsdm1ChannelCounter = 0;
302 DFSDM_Channel_HandleTypeDef* a_dfsdm1ChannelHandle[DFSDM1_CHANNEL_NUMBER] = {NULL};
307 /* Private function prototypes -----------------------------------------------*/
311 static uint32_t DFSDM_GetInjChannelsNbr(uint32_t Channels);
312 static uint32_t DFSDM_GetChannelFromInstance(DFSDM_Channel_TypeDef* Instance);
313 static void DFSDM_RegConvStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter);
314 static void DFSDM_RegConvStop(DFSDM_Filter_HandleTypeDef* hdfsdm_filter);
315 static void DFSDM_InjConvStart(DFSDM_Filter_HandleTypeDef* hdfsdm_filter);
316 static void DFSDM_InjConvStop(DFSDM_Filter_HandleTypeDef* hdfsdm_filter);
317 static void DFSDM_DMARegularHalfConvCplt(DMA_HandleTypeDef *hdma);
318 static void DFSDM_DMARegularConvCplt(DMA_HandleTypeDef *hdma);
319 static void DFSDM_DMAInjectedHalfConvCplt(DMA_HandleTypeDef *hdma);
320 static void DFSDM_DMAInjectedConvCplt(DMA_HandleTypeDef *hdma);
321 static void DFSDM_DMAError(DMA_HandleTypeDef *hdma);
326 /* Exported functions --------------------------------------------------------*/
352 {
353  /* Check DFSDM Channel handle */
354  if(hdfsdm_channel == NULL)
355  {
356  return HAL_ERROR;
357  }
358 
359  /* Check parameters */
371 
372  /* Check that channel has not been already initialized */
373  if(a_dfsdm1ChannelHandle[DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance)] != NULL)
374  {
375  return HAL_ERROR;
376  }
377 
378 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
379  /* Reset callback pointers to the weak predefined callbacks */
380  hdfsdm_channel->CkabCallback = HAL_DFSDM_ChannelCkabCallback;
381  hdfsdm_channel->ScdCallback = HAL_DFSDM_ChannelScdCallback;
382 
383  /* Call MSP init function */
384  if(hdfsdm_channel->MspInitCallback == NULL)
385  {
386  hdfsdm_channel->MspInitCallback = HAL_DFSDM_ChannelMspInit;
387  }
388  hdfsdm_channel->MspInitCallback(hdfsdm_channel);
389 #else
390  /* Call MSP init function */
391  HAL_DFSDM_ChannelMspInit(hdfsdm_channel);
392 #endif
393 
394  /* Update the channel counter */
395  v_dfsdm1ChannelCounter++;
396 
397  /* Configure output serial clock and enable global DFSDM interface only for first channel */
398  if(v_dfsdm1ChannelCounter == 1)
399  {
401  /* Set the output serial clock source */
403  DFSDM1_Channel0->CHCFGR1 |= hdfsdm_channel->Init.OutputClock.Selection;
404 
405  /* Reset clock divider */
407  if(hdfsdm_channel->Init.OutputClock.Activation == ENABLE)
408  {
410  /* Set the output clock divider */
411  DFSDM1_Channel0->CHCFGR1 |= (uint32_t) ((hdfsdm_channel->Init.OutputClock.Divider - 1) <<
413  }
414 
415  /* enable the DFSDM global interface */
417  }
418 
419  /* Set channel input parameters */
422  hdfsdm_channel->Instance->CHCFGR1 |= (hdfsdm_channel->Init.Input.Multiplexer |
423  hdfsdm_channel->Init.Input.DataPacking |
424  hdfsdm_channel->Init.Input.Pins);
425 
426  /* Set serial interface parameters */
428  hdfsdm_channel->Instance->CHCFGR1 |= (hdfsdm_channel->Init.SerialInterface.Type |
429  hdfsdm_channel->Init.SerialInterface.SpiClock);
430 
431  /* Set analog watchdog parameters */
433  hdfsdm_channel->Instance->CHAWSCDR |= (hdfsdm_channel->Init.Awd.FilterOrder |
434  ((hdfsdm_channel->Init.Awd.Oversampling - 1) << DFSDM_CHAWSCDR_AWFOSR_Pos));
435 
436  /* Set channel offset and right bit shift */
437  hdfsdm_channel->Instance->CHCFGR2 &= ~(DFSDM_CHCFGR2_OFFSET | DFSDM_CHCFGR2_DTRBS);
438  hdfsdm_channel->Instance->CHCFGR2 |= (((uint32_t) hdfsdm_channel->Init.Offset << DFSDM_CHCFGR2_OFFSET_Pos) |
439  (hdfsdm_channel->Init.RightBitShift << DFSDM_CHCFGR2_DTRBS_Pos));
440 
441  /* Enable DFSDM channel */
442  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_CHEN;
443 
444  /* Set DFSDM Channel to ready state */
445  hdfsdm_channel->State = HAL_DFSDM_CHANNEL_STATE_READY;
446 
447  /* Store channel handle in DFSDM channel handle table */
448  a_dfsdm1ChannelHandle[DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance)] = hdfsdm_channel;
449 
450  return HAL_OK;
451 }
452 
459 {
460  /* Check DFSDM Channel handle */
461  if(hdfsdm_channel == NULL)
462  {
463  return HAL_ERROR;
464  }
465 
466  /* Check parameters */
468 
469  /* Check that channel has not been already deinitialized */
470  if(a_dfsdm1ChannelHandle[DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance)] == NULL)
471  {
472  return HAL_ERROR;
473  }
474 
475  /* Disable the DFSDM channel */
476  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_CHEN);
477 
478  /* Update the channel counter */
479  v_dfsdm1ChannelCounter--;
480 
481  /* Disable global DFSDM at deinit of last channel */
482  if(v_dfsdm1ChannelCounter == 0)
483  {
484  DFSDM1_Channel0->CHCFGR1 &= ~(DFSDM_CHCFGR1_DFSDMEN);
485  }
486 
487  /* Call MSP deinit function */
488 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
489  if(hdfsdm_channel->MspDeInitCallback == NULL)
490  {
491  hdfsdm_channel->MspDeInitCallback = HAL_DFSDM_ChannelMspDeInit;
492  }
493  hdfsdm_channel->MspDeInitCallback(hdfsdm_channel);
494 #else
495  HAL_DFSDM_ChannelMspDeInit(hdfsdm_channel);
496 #endif
497 
498  /* Set DFSDM Channel in reset state */
499  hdfsdm_channel->State = HAL_DFSDM_CHANNEL_STATE_RESET;
500 
501  /* Reset channel handle in DFSDM channel handle table */
502  a_dfsdm1ChannelHandle[DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance)] = (DFSDM_Channel_HandleTypeDef *) NULL;
503 
504  return HAL_OK;
505 }
506 
512 __weak void HAL_DFSDM_ChannelMspInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
513 {
514  /* Prevent unused argument(s) compilation warning */
515  UNUSED(hdfsdm_channel);
516 
517  /* NOTE : This function should not be modified, when the function is needed,
518  the HAL_DFSDM_ChannelMspInit could be implemented in the user file.
519  */
520 }
521 
527 __weak void HAL_DFSDM_ChannelMspDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
528 {
529  /* Prevent unused argument(s) compilation warning */
530  UNUSED(hdfsdm_channel);
531 
532  /* NOTE : This function should not be modified, when the function is needed,
533  the HAL_DFSDM_ChannelMspDeInit could be implemented in the user file.
534  */
535 }
536 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
537 
550 HAL_StatusTypeDef HAL_DFSDM_Channel_RegisterCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel,
551  HAL_DFSDM_Channel_CallbackIDTypeDef CallbackID,
552  pDFSDM_Channel_CallbackTypeDef pCallback)
553 {
554  HAL_StatusTypeDef status = HAL_OK;
555 
556  if(pCallback == NULL)
557  {
558  /* update return status */
559  status = HAL_ERROR;
560  }
561  else
562  {
563  if(HAL_DFSDM_CHANNEL_STATE_READY == hdfsdm_channel->State)
564  {
565  switch (CallbackID)
566  {
567  case HAL_DFSDM_CHANNEL_CKAB_CB_ID :
568  hdfsdm_channel->CkabCallback = pCallback;
569  break;
570  case HAL_DFSDM_CHANNEL_SCD_CB_ID :
571  hdfsdm_channel->ScdCallback = pCallback;
572  break;
573  case HAL_DFSDM_CHANNEL_MSPINIT_CB_ID :
574  hdfsdm_channel->MspInitCallback = pCallback;
575  break;
576  case HAL_DFSDM_CHANNEL_MSPDEINIT_CB_ID :
577  hdfsdm_channel->MspDeInitCallback = pCallback;
578  break;
579  default :
580  /* update return status */
581  status = HAL_ERROR;
582  break;
583  }
584  }
585  else if(HAL_DFSDM_CHANNEL_STATE_RESET == hdfsdm_channel->State)
586  {
587  switch (CallbackID)
588  {
589  case HAL_DFSDM_CHANNEL_MSPINIT_CB_ID :
590  hdfsdm_channel->MspInitCallback = pCallback;
591  break;
592  case HAL_DFSDM_CHANNEL_MSPDEINIT_CB_ID :
593  hdfsdm_channel->MspDeInitCallback = pCallback;
594  break;
595  default :
596  /* update return status */
597  status = HAL_ERROR;
598  break;
599  }
600  }
601  else
602  {
603  /* update return status */
604  status = HAL_ERROR;
605  }
606  }
607  return status;
608 }
609 
622 HAL_StatusTypeDef HAL_DFSDM_Channel_UnRegisterCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel,
623  HAL_DFSDM_Channel_CallbackIDTypeDef CallbackID)
624 {
625  HAL_StatusTypeDef status = HAL_OK;
626 
627  if(HAL_DFSDM_CHANNEL_STATE_READY == hdfsdm_channel->State)
628  {
629  switch (CallbackID)
630  {
631  case HAL_DFSDM_CHANNEL_CKAB_CB_ID :
632  hdfsdm_channel->CkabCallback = HAL_DFSDM_ChannelCkabCallback;
633  break;
634  case HAL_DFSDM_CHANNEL_SCD_CB_ID :
635  hdfsdm_channel->ScdCallback = HAL_DFSDM_ChannelScdCallback;
636  break;
637  case HAL_DFSDM_CHANNEL_MSPINIT_CB_ID :
638  hdfsdm_channel->MspInitCallback = HAL_DFSDM_ChannelMspInit;
639  break;
640  case HAL_DFSDM_CHANNEL_MSPDEINIT_CB_ID :
641  hdfsdm_channel->MspDeInitCallback = HAL_DFSDM_ChannelMspDeInit;
642  break;
643  default :
644  /* update return status */
645  status = HAL_ERROR;
646  break;
647  }
648  }
649  else if(HAL_DFSDM_CHANNEL_STATE_RESET == hdfsdm_channel->State)
650  {
651  switch (CallbackID)
652  {
653  case HAL_DFSDM_CHANNEL_MSPINIT_CB_ID :
654  hdfsdm_channel->MspInitCallback = HAL_DFSDM_ChannelMspInit;
655  break;
656  case HAL_DFSDM_CHANNEL_MSPDEINIT_CB_ID :
657  hdfsdm_channel->MspDeInitCallback = HAL_DFSDM_ChannelMspDeInit;
658  break;
659  default :
660  /* update return status */
661  status = HAL_ERROR;
662  break;
663  }
664  }
665  else
666  {
667  /* update return status */
668  status = HAL_ERROR;
669  }
670  return status;
671 }
672 #endif /* USE_HAL_DFSDM_REGISTER_CALLBACKS */
673 
704 {
705  HAL_StatusTypeDef status = HAL_OK;
706  uint32_t channel;
707  uint32_t tickstart;
708 
709  /* Check parameters */
711 
712  /* Check DFSDM channel state */
713  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
714  {
715  /* Return error status */
716  status = HAL_ERROR;
717  }
718  else
719  {
720  /* Get channel number from channel instance */
721  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
722 
723  /* Get timeout */
724  tickstart = HAL_GetTick();
725 
726  /* Clear clock absence flag */
727  while((((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_CKABF) >> (DFSDM_FLTISR_CKABF_Pos + channel)) & 1) != 0)
728  {
729  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
730 
731  /* Check the Timeout */
732  if((HAL_GetTick()-tickstart) > DFSDM_CKAB_TIMEOUT)
733  {
734  /* Set timeout status */
735  status = HAL_TIMEOUT;
736  break;
737  }
738  }
739 
740  if(status == HAL_OK)
741  {
742  /* Start clock absence detection */
743  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_CKABEN;
744  }
745  }
746  /* Return function status */
747  return status;
748 }
749 
757  uint32_t Timeout)
758 {
759  uint32_t tickstart;
760  uint32_t channel;
761 
762  /* Check parameters */
764 
765  /* Check DFSDM channel state */
766  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
767  {
768  /* Return error status */
769  return HAL_ERROR;
770  }
771  else
772  {
773  /* Get channel number from channel instance */
774  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
775 
776  /* Get timeout */
777  tickstart = HAL_GetTick();
778 
779  /* Wait clock absence detection */
780  while((((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_CKABF) >> (DFSDM_FLTISR_CKABF_Pos + channel)) & 1) == 0)
781  {
782  /* Check the Timeout */
783  if(Timeout != HAL_MAX_DELAY)
784  {
785  if((Timeout == 0) || ((HAL_GetTick()-tickstart) > Timeout))
786  {
787  /* Return timeout status */
788  return HAL_TIMEOUT;
789  }
790  }
791  }
792 
793  /* Clear clock absence detection flag */
794  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
795 
796  /* Return function status */
797  return HAL_OK;
798  }
799 }
800 
807 {
808  HAL_StatusTypeDef status = HAL_OK;
809  uint32_t channel;
810 
811  /* Check parameters */
813 
814  /* Check DFSDM channel state */
815  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
816  {
817  /* Return error status */
818  status = HAL_ERROR;
819  }
820  else
821  {
822  /* Stop clock absence detection */
823  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_CKABEN);
824 
825  /* Clear clock absence flag */
826  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
827  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
828  }
829  /* Return function status */
830  return status;
831 }
832 
843 {
844  HAL_StatusTypeDef status = HAL_OK;
845  uint32_t channel;
846  uint32_t tickstart;
847 
848  /* Check parameters */
850 
851  /* Check DFSDM channel state */
852  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
853  {
854  /* Return error status */
855  status = HAL_ERROR;
856  }
857  else
858  {
859  /* Get channel number from channel instance */
860  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
861 
862  /* Get timeout */
863  tickstart = HAL_GetTick();
864 
865  /* Clear clock absence flag */
866  while((((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_CKABF) >> (DFSDM_FLTISR_CKABF_Pos + channel)) & 1) != 0)
867  {
868  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
869 
870  /* Check the Timeout */
871  if((HAL_GetTick()-tickstart) > DFSDM_CKAB_TIMEOUT)
872  {
873  /* Set timeout status */
874  status = HAL_TIMEOUT;
875  break;
876  }
877  }
878 
879  if(status == HAL_OK)
880  {
881  /* Activate clock absence detection interrupt */
883 
884  /* Start clock absence detection */
885  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_CKABEN;
886  }
887  }
888  /* Return function status */
889  return status;
890 }
891 
898 {
899  /* Prevent unused argument(s) compilation warning */
900  UNUSED(hdfsdm_channel);
901 
902  /* NOTE : This function should not be modified, when the callback is needed,
903  the HAL_DFSDM_ChannelCkabCallback could be implemented in the user file
904  */
905 }
906 
914 {
915  HAL_StatusTypeDef status = HAL_OK;
916  uint32_t channel;
917 
918  /* Check parameters */
920 
921  /* Check DFSDM channel state */
922  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
923  {
924  /* Return error status */
925  status = HAL_ERROR;
926  }
927  else
928  {
929  /* Stop clock absence detection */
930  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_CKABEN);
931 
932  /* Clear clock absence flag */
933  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
934  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
935 
936  /* Disable clock absence detection interrupt */
937  DFSDM1_Filter0->FLTCR2 &= ~(DFSDM_FLTCR2_CKABIE);
938  }
939  /* Return function status */
940  return status;
941 }
942 
954  uint32_t Threshold,
955  uint32_t BreakSignal)
956 {
957  HAL_StatusTypeDef status = HAL_OK;
958 
959  /* Check parameters */
962  assert_param(IS_DFSDM_BREAK_SIGNALS(BreakSignal));
963 
964  /* Check DFSDM channel state */
965  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
966  {
967  /* Return error status */
968  status = HAL_ERROR;
969  }
970  else
971  {
972  /* Configure threshold and break signals */
974  hdfsdm_channel->Instance->CHAWSCDR |= ((BreakSignal << DFSDM_CHAWSCDR_BKSCD_Pos) | \
975  Threshold);
976 
977  /* Start short circuit detection */
978  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_SCDEN;
979  }
980  /* Return function status */
981  return status;
982 }
983 
991  uint32_t Timeout)
992 {
993  uint32_t tickstart;
994  uint32_t channel;
995 
996  /* Check parameters */
998 
999  /* Check DFSDM channel state */
1000  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1001  {
1002  /* Return error status */
1003  return HAL_ERROR;
1004  }
1005  else
1006  {
1007  /* Get channel number from channel instance */
1008  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
1009 
1010  /* Get timeout */
1011  tickstart = HAL_GetTick();
1012 
1013  /* Wait short circuit detection */
1014  while(((DFSDM1_Filter0->FLTISR & DFSDM_FLTISR_SCDF) >> (DFSDM_FLTISR_SCDF_Pos + channel)) == 0)
1015  {
1016  /* Check the Timeout */
1017  if(Timeout != HAL_MAX_DELAY)
1018  {
1019  if((Timeout == 0) || ((HAL_GetTick()-tickstart) > Timeout))
1020  {
1021  /* Return timeout status */
1022  return HAL_TIMEOUT;
1023  }
1024  }
1025  }
1026 
1027  /* Clear short circuit detection flag */
1028  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRSCDF_Pos + channel));
1029 
1030  /* Return function status */
1031  return HAL_OK;
1032  }
1033 }
1034 
1041 {
1042  HAL_StatusTypeDef status = HAL_OK;
1043  uint32_t channel;
1044 
1045  /* Check parameters */
1047 
1048  /* Check DFSDM channel state */
1049  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1050  {
1051  /* Return error status */
1052  status = HAL_ERROR;
1053  }
1054  else
1055  {
1056  /* Stop short circuit detection */
1057  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_SCDEN);
1058 
1059  /* Clear short circuit detection flag */
1060  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
1061  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRSCDF_Pos + channel));
1062  }
1063  /* Return function status */
1064  return status;
1065 }
1066 
1078  uint32_t Threshold,
1079  uint32_t BreakSignal)
1080 {
1081  HAL_StatusTypeDef status = HAL_OK;
1082 
1083  /* Check parameters */
1086  assert_param(IS_DFSDM_BREAK_SIGNALS(BreakSignal));
1087 
1088  /* Check DFSDM channel state */
1089  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1090  {
1091  /* Return error status */
1092  status = HAL_ERROR;
1093  }
1094  else
1095  {
1096  /* Activate short circuit detection interrupt */
1098 
1099  /* Configure threshold and break signals */
1100  hdfsdm_channel->Instance->CHAWSCDR &= ~(DFSDM_CHAWSCDR_BKSCD | DFSDM_CHAWSCDR_SCDT);
1101  hdfsdm_channel->Instance->CHAWSCDR |= ((BreakSignal << DFSDM_CHAWSCDR_BKSCD_Pos) | \
1102  Threshold);
1103 
1104  /* Start short circuit detection */
1105  hdfsdm_channel->Instance->CHCFGR1 |= DFSDM_CHCFGR1_SCDEN;
1106  }
1107  /* Return function status */
1108  return status;
1109 }
1110 
1116 __weak void HAL_DFSDM_ChannelScdCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
1117 {
1118  /* Prevent unused argument(s) compilation warning */
1119  UNUSED(hdfsdm_channel);
1120 
1121  /* NOTE : This function should not be modified, when the callback is needed,
1122  the HAL_DFSDM_ChannelScdCallback could be implemented in the user file
1123  */
1124 }
1125 
1133 {
1134  HAL_StatusTypeDef status = HAL_OK;
1135  uint32_t channel;
1136 
1137  /* Check parameters */
1139 
1140  /* Check DFSDM channel state */
1141  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1142  {
1143  /* Return error status */
1144  status = HAL_ERROR;
1145  }
1146  else
1147  {
1148  /* Stop short circuit detection */
1149  hdfsdm_channel->Instance->CHCFGR1 &= ~(DFSDM_CHCFGR1_SCDEN);
1150 
1151  /* Clear short circuit detection flag */
1152  channel = DFSDM_GetChannelFromInstance(hdfsdm_channel->Instance);
1153  DFSDM1_Filter0->FLTICR = (1 << (DFSDM_FLTICR_CLRSCDF_Pos + channel));
1154 
1155  /* Disable short circuit detection interrupt */
1156  DFSDM1_Filter0->FLTCR2 &= ~(DFSDM_FLTCR2_SCDIE);
1157  }
1158  /* Return function status */
1159  return status;
1160 }
1161 
1168 {
1169  return (int16_t) hdfsdm_channel->Instance->CHWDATAR;
1170 }
1171 
1180  int32_t Offset)
1181 {
1182  HAL_StatusTypeDef status = HAL_OK;
1183 
1184  /* Check parameters */
1187 
1188  /* Check DFSDM channel state */
1189  if(hdfsdm_channel->State != HAL_DFSDM_CHANNEL_STATE_READY)
1190  {
1191  /* Return error status */
1192  status = HAL_ERROR;
1193  }
1194  else
1195  {
1196  /* Modify channel offset */
1197  hdfsdm_channel->Instance->CHCFGR2 &= ~(DFSDM_CHCFGR2_OFFSET);
1198  hdfsdm_channel->Instance->CHCFGR2 |= ((uint32_t) Offset << DFSDM_CHCFGR2_OFFSET_Pos);
1199  }
1200  /* Return function status */
1201  return status;
1202 }
1203 
1227 {
1228  /* Return DFSDM channel handle state */
1229  return hdfsdm_channel->State;
1230 }
1231 
1257 {
1258  /* Check DFSDM Channel handle */
1259  if(hdfsdm_filter == NULL)
1260  {
1261  return HAL_ERROR;
1262  }
1263 
1264  /* Check parameters */
1275 
1276  /* Check parameters compatibility */
1277  if((hdfsdm_filter->Instance == DFSDM1_Filter0) &&
1278  ((hdfsdm_filter->Init.RegularParam.Trigger == DFSDM_FILTER_SYNC_TRIGGER) ||
1279  (hdfsdm_filter->Init.InjectedParam.Trigger == DFSDM_FILTER_SYNC_TRIGGER)))
1280  {
1281  return HAL_ERROR;
1282  }
1283 
1284  /* Initialize DFSDM filter variables with default values */
1285  hdfsdm_filter->RegularContMode = DFSDM_CONTINUOUS_CONV_OFF;
1286  hdfsdm_filter->InjectedChannelsNbr = 1;
1287  hdfsdm_filter->InjConvRemaining = 1;
1288  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_NONE;
1289 
1290 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
1291  /* Reset callback pointers to the weak predefined callbacks */
1292  hdfsdm_filter->AwdCallback = HAL_DFSDM_FilterAwdCallback;
1293  hdfsdm_filter->RegConvCpltCallback = HAL_DFSDM_FilterRegConvCpltCallback;
1294  hdfsdm_filter->RegConvHalfCpltCallback = HAL_DFSDM_FilterRegConvHalfCpltCallback;
1295  hdfsdm_filter->InjConvCpltCallback = HAL_DFSDM_FilterInjConvCpltCallback;
1296  hdfsdm_filter->InjConvHalfCpltCallback = HAL_DFSDM_FilterInjConvHalfCpltCallback;
1297  hdfsdm_filter->ErrorCallback = HAL_DFSDM_FilterErrorCallback;
1298 
1299  /* Call MSP init function */
1300  if(hdfsdm_filter->MspInitCallback == NULL)
1301  {
1302  hdfsdm_filter->MspInitCallback = HAL_DFSDM_FilterMspInit;
1303  }
1304  hdfsdm_filter->MspInitCallback(hdfsdm_filter);
1305 #else
1306  /* Call MSP init function */
1307  HAL_DFSDM_FilterMspInit(hdfsdm_filter);
1308 #endif
1309 
1310  /* Set regular parameters */
1311  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_RSYNC);
1312  if(hdfsdm_filter->Init.RegularParam.FastMode == ENABLE)
1313  {
1314  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_FAST;
1315  }
1316  else
1317  {
1318  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_FAST);
1319  }
1320 
1321  if(hdfsdm_filter->Init.RegularParam.DmaMode == ENABLE)
1322  {
1323  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_RDMAEN;
1324  }
1325  else
1326  {
1327  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_RDMAEN);
1328  }
1329 
1330  /* Set injected parameters */
1332  if(hdfsdm_filter->Init.InjectedParam.Trigger == DFSDM_FILTER_EXT_TRIGGER)
1333  {
1336  hdfsdm_filter->Instance->FLTCR1 |= (hdfsdm_filter->Init.InjectedParam.ExtTrigger);
1337  }
1338 
1339  if(hdfsdm_filter->Init.InjectedParam.ScanMode == ENABLE)
1340  {
1341  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_JSCAN;
1342  }
1343  else
1344  {
1345  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_JSCAN);
1346  }
1347 
1348  if(hdfsdm_filter->Init.InjectedParam.DmaMode == ENABLE)
1349  {
1350  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_JDMAEN;
1351  }
1352  else
1353  {
1354  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_JDMAEN);
1355  }
1356 
1357  /* Set filter parameters */
1359  hdfsdm_filter->Instance->FLTFCR |= (hdfsdm_filter->Init.FilterParam.SincOrder |
1360  ((hdfsdm_filter->Init.FilterParam.Oversampling - 1) << DFSDM_FLTFCR_FOSR_Pos) |
1361  (hdfsdm_filter->Init.FilterParam.IntOversampling - 1));
1362 
1363  /* Store regular and injected triggers and injected scan mode*/
1364  hdfsdm_filter->RegularTrigger = hdfsdm_filter->Init.RegularParam.Trigger;
1365  hdfsdm_filter->InjectedTrigger = hdfsdm_filter->Init.InjectedParam.Trigger;
1366  hdfsdm_filter->ExtTriggerEdge = hdfsdm_filter->Init.InjectedParam.ExtTriggerEdge;
1367  hdfsdm_filter->InjectedScanMode = hdfsdm_filter->Init.InjectedParam.ScanMode;
1368 
1369  /* Enable DFSDM filter */
1370  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_DFEN;
1371 
1372  /* Set DFSDM filter to ready state */
1373  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_READY;
1374 
1375  return HAL_OK;
1376 }
1377 
1384 {
1385  /* Check DFSDM filter handle */
1386  if(hdfsdm_filter == NULL)
1387  {
1388  return HAL_ERROR;
1389  }
1390 
1391  /* Check parameters */
1393 
1394  /* Disable the DFSDM filter */
1395  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_DFEN);
1396 
1397  /* Call MSP deinit function */
1398 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
1399  if(hdfsdm_filter->MspDeInitCallback == NULL)
1400  {
1401  hdfsdm_filter->MspDeInitCallback = HAL_DFSDM_FilterMspDeInit;
1402  }
1403  hdfsdm_filter->MspDeInitCallback(hdfsdm_filter);
1404 #else
1405  HAL_DFSDM_FilterMspDeInit(hdfsdm_filter);
1406 #endif
1407 
1408  /* Set DFSDM filter in reset state */
1409  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_RESET;
1410 
1411  return HAL_OK;
1412 }
1413 
1419 __weak void HAL_DFSDM_FilterMspInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
1420 {
1421  /* Prevent unused argument(s) compilation warning */
1422  UNUSED(hdfsdm_filter);
1423 
1424  /* NOTE : This function should not be modified, when the function is needed,
1425  the HAL_DFSDM_FilterMspInit could be implemented in the user file.
1426  */
1427 }
1428 
1434 __weak void HAL_DFSDM_FilterMspDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
1435 {
1436  /* Prevent unused argument(s) compilation warning */
1437  UNUSED(hdfsdm_filter);
1438 
1439  /* NOTE : This function should not be modified, when the function is needed,
1440  the HAL_DFSDM_FilterMspDeInit could be implemented in the user file.
1441  */
1442 }
1443 
1444 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
1445 
1461 HAL_StatusTypeDef HAL_DFSDM_Filter_RegisterCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
1462  HAL_DFSDM_Filter_CallbackIDTypeDef CallbackID,
1463  pDFSDM_Filter_CallbackTypeDef pCallback)
1464 {
1465  HAL_StatusTypeDef status = HAL_OK;
1466 
1467  if(pCallback == NULL)
1468  {
1469  /* update the error code */
1470  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1471  /* update return status */
1472  status = HAL_ERROR;
1473  }
1474  else
1475  {
1476  if(HAL_DFSDM_FILTER_STATE_READY == hdfsdm_filter->State)
1477  {
1478  switch (CallbackID)
1479  {
1480  case HAL_DFSDM_FILTER_REGCONV_COMPLETE_CB_ID :
1481  hdfsdm_filter->RegConvCpltCallback = pCallback;
1482  break;
1483  case HAL_DFSDM_FILTER_REGCONV_HALFCOMPLETE_CB_ID :
1484  hdfsdm_filter->RegConvHalfCpltCallback = pCallback;
1485  break;
1486  case HAL_DFSDM_FILTER_INJCONV_COMPLETE_CB_ID :
1487  hdfsdm_filter->InjConvCpltCallback = pCallback;
1488  break;
1489  case HAL_DFSDM_FILTER_INJCONV_HALFCOMPLETE_CB_ID :
1490  hdfsdm_filter->InjConvHalfCpltCallback = pCallback;
1491  break;
1492  case HAL_DFSDM_FILTER_ERROR_CB_ID :
1493  hdfsdm_filter->ErrorCallback = pCallback;
1494  break;
1495  case HAL_DFSDM_FILTER_MSPINIT_CB_ID :
1496  hdfsdm_filter->MspInitCallback = pCallback;
1497  break;
1498  case HAL_DFSDM_FILTER_MSPDEINIT_CB_ID :
1499  hdfsdm_filter->MspDeInitCallback = pCallback;
1500  break;
1501  default :
1502  /* update the error code */
1503  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1504  /* update return status */
1505  status = HAL_ERROR;
1506  break;
1507  }
1508  }
1509  else if(HAL_DFSDM_FILTER_STATE_RESET == hdfsdm_filter->State)
1510  {
1511  switch (CallbackID)
1512  {
1513  case HAL_DFSDM_FILTER_MSPINIT_CB_ID :
1514  hdfsdm_filter->MspInitCallback = pCallback;
1515  break;
1516  case HAL_DFSDM_FILTER_MSPDEINIT_CB_ID :
1517  hdfsdm_filter->MspDeInitCallback = pCallback;
1518  break;
1519  default :
1520  /* update the error code */
1521  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1522  /* update return status */
1523  status = HAL_ERROR;
1524  break;
1525  }
1526  }
1527  else
1528  {
1529  /* update the error code */
1530  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1531  /* update return status */
1532  status = HAL_ERROR;
1533  }
1534  }
1535  return status;
1536 }
1537 
1553 HAL_StatusTypeDef HAL_DFSDM_Filter_UnRegisterCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
1554  HAL_DFSDM_Filter_CallbackIDTypeDef CallbackID)
1555 {
1556  HAL_StatusTypeDef status = HAL_OK;
1557 
1558  if(HAL_DFSDM_FILTER_STATE_READY == hdfsdm_filter->State)
1559  {
1560  switch (CallbackID)
1561  {
1562  case HAL_DFSDM_FILTER_REGCONV_COMPLETE_CB_ID :
1563  hdfsdm_filter->RegConvCpltCallback = HAL_DFSDM_FilterRegConvCpltCallback;
1564  break;
1565  case HAL_DFSDM_FILTER_REGCONV_HALFCOMPLETE_CB_ID :
1566  hdfsdm_filter->RegConvHalfCpltCallback = HAL_DFSDM_FilterRegConvHalfCpltCallback;
1567  break;
1568  case HAL_DFSDM_FILTER_INJCONV_COMPLETE_CB_ID :
1569  hdfsdm_filter->InjConvCpltCallback = HAL_DFSDM_FilterInjConvCpltCallback;
1570  break;
1571  case HAL_DFSDM_FILTER_INJCONV_HALFCOMPLETE_CB_ID :
1572  hdfsdm_filter->InjConvHalfCpltCallback = HAL_DFSDM_FilterInjConvHalfCpltCallback;
1573  break;
1574  case HAL_DFSDM_FILTER_ERROR_CB_ID :
1575  hdfsdm_filter->ErrorCallback = HAL_DFSDM_FilterErrorCallback;
1576  break;
1577  case HAL_DFSDM_FILTER_MSPINIT_CB_ID :
1578  hdfsdm_filter->MspInitCallback = HAL_DFSDM_FilterMspInit;
1579  break;
1580  case HAL_DFSDM_FILTER_MSPDEINIT_CB_ID :
1581  hdfsdm_filter->MspDeInitCallback = HAL_DFSDM_FilterMspDeInit;
1582  break;
1583  default :
1584  /* update the error code */
1585  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1586  /* update return status */
1587  status = HAL_ERROR;
1588  break;
1589  }
1590  }
1591  else if(HAL_DFSDM_FILTER_STATE_RESET == hdfsdm_filter->State)
1592  {
1593  switch (CallbackID)
1594  {
1595  case HAL_DFSDM_FILTER_MSPINIT_CB_ID :
1596  hdfsdm_filter->MspInitCallback = HAL_DFSDM_FilterMspInit;
1597  break;
1598  case HAL_DFSDM_FILTER_MSPDEINIT_CB_ID :
1599  hdfsdm_filter->MspDeInitCallback = HAL_DFSDM_FilterMspDeInit;
1600  break;
1601  default :
1602  /* update the error code */
1603  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1604  /* update return status */
1605  status = HAL_ERROR;
1606  break;
1607  }
1608  }
1609  else
1610  {
1611  /* update the error code */
1612  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1613  /* update return status */
1614  status = HAL_ERROR;
1615  }
1616  return status;
1617 }
1618 
1626 HAL_StatusTypeDef HAL_DFSDM_Filter_RegisterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
1627  pDFSDM_Filter_AwdCallbackTypeDef pCallback)
1628 {
1629  HAL_StatusTypeDef status = HAL_OK;
1630 
1631  if(pCallback == NULL)
1632  {
1633  /* update the error code */
1634  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1635  /* update return status */
1636  status = HAL_ERROR;
1637  }
1638  else
1639  {
1640  if(HAL_DFSDM_FILTER_STATE_READY == hdfsdm_filter->State)
1641  {
1642  hdfsdm_filter->AwdCallback = pCallback;
1643  }
1644  else
1645  {
1646  /* update the error code */
1647  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1648  /* update return status */
1649  status = HAL_ERROR;
1650  }
1651  }
1652  return status;
1653 }
1654 
1661 HAL_StatusTypeDef HAL_DFSDM_Filter_UnRegisterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
1662 {
1663  HAL_StatusTypeDef status = HAL_OK;
1664 
1665  if(HAL_DFSDM_FILTER_STATE_READY == hdfsdm_filter->State)
1666  {
1667  hdfsdm_filter->AwdCallback = HAL_DFSDM_FilterAwdCallback;
1668  }
1669  else
1670  {
1671  /* update the error code */
1672  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_INVALID_CALLBACK;
1673  /* update return status */
1674  status = HAL_ERROR;
1675  }
1676  return status;
1677 }
1678 #endif /* USE_HAL_DFSDM_REGISTER_CALLBACKS */
1679 
1709  uint32_t Channel,
1710  uint32_t ContinuousMode)
1711 {
1712  HAL_StatusTypeDef status = HAL_OK;
1713 
1714  /* Check parameters */
1717  assert_param(IS_DFSDM_CONTINUOUS_MODE(ContinuousMode));
1718 
1719  /* Check DFSDM filter state */
1720  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_RESET) &&
1721  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_ERROR))
1722  {
1723  /* Configure channel and continuous mode for regular conversion */
1724  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_RCH | DFSDM_FLTCR1_RCONT);
1725  if(ContinuousMode == DFSDM_CONTINUOUS_CONV_ON)
1726  {
1727  hdfsdm_filter->Instance->FLTCR1 |= (uint32_t) (((Channel & DFSDM_MSB_MASK) << DFSDM_FLTCR1_MSB_RCH_OFFSET) |
1729  }
1730  else
1731  {
1732  hdfsdm_filter->Instance->FLTCR1 |= (uint32_t) ((Channel & DFSDM_MSB_MASK) << DFSDM_FLTCR1_MSB_RCH_OFFSET);
1733  }
1734  /* Store continuous mode information */
1735  hdfsdm_filter->RegularContMode = ContinuousMode;
1736  }
1737  else
1738  {
1739  status = HAL_ERROR;
1740  }
1741 
1742  /* Return function status */
1743  return status;
1744 }
1745 
1754  uint32_t Channel)
1755 {
1756  HAL_StatusTypeDef status = HAL_OK;
1757 
1758  /* Check parameters */
1761 
1762  /* Check DFSDM filter state */
1763  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_RESET) &&
1764  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_ERROR))
1765  {
1766  /* Configure channel for injected conversion */
1767  hdfsdm_filter->Instance->FLTJCHGR = (uint32_t) (Channel & DFSDM_LSB_MASK);
1768  /* Store number of injected channels */
1769  hdfsdm_filter->InjectedChannelsNbr = DFSDM_GetInjChannelsNbr(Channel);
1770  /* Update number of injected channels remaining */
1771  hdfsdm_filter->InjConvRemaining = (hdfsdm_filter->InjectedScanMode == ENABLE) ? \
1772  hdfsdm_filter->InjectedChannelsNbr : 1;
1773  }
1774  else
1775  {
1776  status = HAL_ERROR;
1777  }
1778  /* Return function status */
1779  return status;
1780 }
1781 
1824 {
1825  HAL_StatusTypeDef status = HAL_OK;
1826 
1827  /* Check parameters */
1829 
1830  /* Check DFSDM filter state */
1831  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
1832  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ))
1833  {
1834  /* Start regular conversion */
1835  DFSDM_RegConvStart(hdfsdm_filter);
1836  }
1837  else
1838  {
1839  status = HAL_ERROR;
1840  }
1841  /* Return function status */
1842  return status;
1843 }
1844 
1853  uint32_t Timeout)
1854 {
1855  uint32_t tickstart;
1856 
1857  /* Check parameters */
1859 
1860  /* Check DFSDM filter state */
1861  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG) && \
1862  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
1863  {
1864  /* Return error status */
1865  return HAL_ERROR;
1866  }
1867  else
1868  {
1869  /* Get timeout */
1870  tickstart = HAL_GetTick();
1871 
1872  /* Wait end of regular conversion */
1873  while((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_REOCF) != DFSDM_FLTISR_REOCF)
1874  {
1875  /* Check the Timeout */
1876  if(Timeout != HAL_MAX_DELAY)
1877  {
1878  if((Timeout == 0) || ((HAL_GetTick()-tickstart) > Timeout))
1879  {
1880  /* Return timeout status */
1881  return HAL_TIMEOUT;
1882  }
1883  }
1884  }
1885  /* Check if overrun occurs */
1886  if((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_ROVRF) == DFSDM_FLTISR_ROVRF)
1887  {
1888  /* Update error code and call error callback */
1890 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
1891  hdfsdm_filter->ErrorCallback(hdfsdm_filter);
1892 #else
1893  HAL_DFSDM_FilterErrorCallback(hdfsdm_filter);
1894 #endif
1895 
1896  /* Clear regular overrun flag */
1897  hdfsdm_filter->Instance->FLTICR = DFSDM_FLTICR_CLRROVRF;
1898  }
1899  /* Update DFSDM filter state only if not continuous conversion and SW trigger */
1900  if((hdfsdm_filter->RegularContMode == DFSDM_CONTINUOUS_CONV_OFF) && \
1901  (hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER))
1902  {
1903  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG) ? \
1905  }
1906  /* Return function status */
1907  return HAL_OK;
1908  }
1909 }
1910 
1918 {
1919  HAL_StatusTypeDef status = HAL_OK;
1920 
1921  /* Check parameters */
1923 
1924  /* Check DFSDM filter state */
1925  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG) && \
1926  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
1927  {
1928  /* Return error status */
1929  status = HAL_ERROR;
1930  }
1931  else
1932  {
1933  /* Stop regular conversion */
1934  DFSDM_RegConvStop(hdfsdm_filter);
1935  }
1936  /* Return function status */
1937  return status;
1938 }
1939 
1948 {
1949  HAL_StatusTypeDef status = HAL_OK;
1950 
1951  /* Check parameters */
1953 
1954  /* Check DFSDM filter state */
1955  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
1956  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ))
1957  {
1958  /* Enable interrupts for regular conversions */
1959  hdfsdm_filter->Instance->FLTCR2 |= (DFSDM_FLTCR2_REOCIE | DFSDM_FLTCR2_ROVRIE);
1960 
1961  /* Start regular conversion */
1962  DFSDM_RegConvStart(hdfsdm_filter);
1963  }
1964  else
1965  {
1966  status = HAL_ERROR;
1967  }
1968  /* Return function status */
1969  return status;
1970 }
1971 
1979 {
1980  HAL_StatusTypeDef status = HAL_OK;
1981 
1982  /* Check parameters */
1984 
1985  /* Check DFSDM filter state */
1986  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG) && \
1987  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
1988  {
1989  /* Return error status */
1990  status = HAL_ERROR;
1991  }
1992  else
1993  {
1994  /* Disable interrupts for regular conversions */
1995  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_REOCIE | DFSDM_FLTCR2_ROVRIE);
1996 
1997  /* Stop regular conversion */
1998  DFSDM_RegConvStop(hdfsdm_filter);
1999  }
2000  /* Return function status */
2001  return status;
2002 }
2003 
2017  int32_t *pData,
2018  uint32_t Length)
2019 {
2020  HAL_StatusTypeDef status = HAL_OK;
2021 
2022  /* Check parameters */
2024 
2025  /* Check destination address and length */
2026  if((pData == NULL) || (Length == 0))
2027  {
2028  status = HAL_ERROR;
2029  }
2030  /* Check that DMA is enabled for regular conversion */
2031  else if((hdfsdm_filter->Instance->FLTCR1 & DFSDM_FLTCR1_RDMAEN) != DFSDM_FLTCR1_RDMAEN)
2032  {
2033  status = HAL_ERROR;
2034  }
2035  /* Check parameters compatibility */
2036  else if((hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2037  (hdfsdm_filter->RegularContMode == DFSDM_CONTINUOUS_CONV_OFF) && \
2038  (hdfsdm_filter->hdmaReg->Init.Mode == DMA_NORMAL) && \
2039  (Length != 1))
2040  {
2041  status = HAL_ERROR;
2042  }
2043  else if((hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2044  (hdfsdm_filter->RegularContMode == DFSDM_CONTINUOUS_CONV_OFF) && \
2045  (hdfsdm_filter->hdmaReg->Init.Mode == DMA_CIRCULAR))
2046  {
2047  status = HAL_ERROR;
2048  }
2049  /* Check DFSDM filter state */
2050  else if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
2051  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ))
2052  {
2053  /* Set callbacks on DMA handler */
2054  hdfsdm_filter->hdmaReg->XferCpltCallback = DFSDM_DMARegularConvCplt;
2055  hdfsdm_filter->hdmaReg->XferErrorCallback = DFSDM_DMAError;
2056  hdfsdm_filter->hdmaReg->XferHalfCpltCallback = (hdfsdm_filter->hdmaReg->Init.Mode == DMA_CIRCULAR) ?\
2057  DFSDM_DMARegularHalfConvCplt : NULL;
2058 
2059  /* Start DMA in interrupt mode */
2060  if(HAL_DMA_Start_IT(hdfsdm_filter->hdmaReg, (uint32_t)&hdfsdm_filter->Instance->FLTRDATAR, \
2061  (uint32_t) pData, Length) != HAL_OK)
2062  {
2063  /* Set DFSDM filter in error state */
2064  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_ERROR;
2065  status = HAL_ERROR;
2066  }
2067  else
2068  {
2069  /* Start regular conversion */
2070  DFSDM_RegConvStart(hdfsdm_filter);
2071  }
2072  }
2073  else
2074  {
2075  status = HAL_ERROR;
2076  }
2077  /* Return function status */
2078  return status;
2079 }
2080 
2094  int16_t *pData,
2095  uint32_t Length)
2096 {
2097  HAL_StatusTypeDef status = HAL_OK;
2098 
2099  /* Check parameters */
2101 
2102  /* Check destination address and length */
2103  if((pData == NULL) || (Length == 0))
2104  {
2105  status = HAL_ERROR;
2106  }
2107  /* Check that DMA is enabled for regular conversion */
2108  else if((hdfsdm_filter->Instance->FLTCR1 & DFSDM_FLTCR1_RDMAEN) != DFSDM_FLTCR1_RDMAEN)
2109  {
2110  status = HAL_ERROR;
2111  }
2112  /* Check parameters compatibility */
2113  else if((hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2114  (hdfsdm_filter->RegularContMode == DFSDM_CONTINUOUS_CONV_OFF) && \
2115  (hdfsdm_filter->hdmaReg->Init.Mode == DMA_NORMAL) && \
2116  (Length != 1))
2117  {
2118  status = HAL_ERROR;
2119  }
2120  else if((hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2121  (hdfsdm_filter->RegularContMode == DFSDM_CONTINUOUS_CONV_OFF) && \
2122  (hdfsdm_filter->hdmaReg->Init.Mode == DMA_CIRCULAR))
2123  {
2124  status = HAL_ERROR;
2125  }
2126  /* Check DFSDM filter state */
2127  else if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
2128  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ))
2129  {
2130  /* Set callbacks on DMA handler */
2131  hdfsdm_filter->hdmaReg->XferCpltCallback = DFSDM_DMARegularConvCplt;
2132  hdfsdm_filter->hdmaReg->XferErrorCallback = DFSDM_DMAError;
2133  hdfsdm_filter->hdmaReg->XferHalfCpltCallback = (hdfsdm_filter->hdmaReg->Init.Mode == DMA_CIRCULAR) ?\
2134  DFSDM_DMARegularHalfConvCplt : NULL;
2135 
2136  /* Start DMA in interrupt mode */
2137  if(HAL_DMA_Start_IT(hdfsdm_filter->hdmaReg, (uint32_t)(&hdfsdm_filter->Instance->FLTRDATAR) + 2, \
2138  (uint32_t) pData, Length) != HAL_OK)
2139  {
2140  /* Set DFSDM filter in error state */
2141  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_ERROR;
2142  status = HAL_ERROR;
2143  }
2144  else
2145  {
2146  /* Start regular conversion */
2147  DFSDM_RegConvStart(hdfsdm_filter);
2148  }
2149  }
2150  else
2151  {
2152  status = HAL_ERROR;
2153  }
2154  /* Return function status */
2155  return status;
2156 }
2157 
2165 {
2166  HAL_StatusTypeDef status = HAL_OK;
2167 
2168  /* Check parameters */
2170 
2171  /* Check DFSDM filter state */
2172  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG) && \
2173  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
2174  {
2175  /* Return error status */
2176  status = HAL_ERROR;
2177  }
2178  else
2179  {
2180  /* Stop current DMA transfer */
2181  if(HAL_DMA_Abort(hdfsdm_filter->hdmaReg) != HAL_OK)
2182  {
2183  /* Set DFSDM filter in error state */
2184  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_ERROR;
2185  status = HAL_ERROR;
2186  }
2187  else
2188  {
2189  /* Stop regular conversion */
2190  DFSDM_RegConvStop(hdfsdm_filter);
2191  }
2192  }
2193  /* Return function status */
2194  return status;
2195 }
2196 
2204  uint32_t *Channel)
2205 {
2206  uint32_t reg = 0;
2207  int32_t value = 0;
2208 
2209  /* Check parameters */
2211  assert_param(Channel != NULL);
2212 
2213  /* Get value of data register for regular channel */
2214  reg = hdfsdm_filter->Instance->FLTRDATAR;
2215 
2216  /* Extract channel and regular conversion value */
2217  *Channel = (reg & DFSDM_FLTRDATAR_RDATACH);
2218  value = ((int32_t)(reg & DFSDM_FLTRDATAR_RDATA) >> DFSDM_FLTRDATAR_RDATA_Pos);
2219 
2220  /* return regular conversion value */
2221  return value;
2222 }
2223 
2232 {
2233  HAL_StatusTypeDef status = HAL_OK;
2234 
2235  /* Check parameters */
2237 
2238  /* Check DFSDM filter state */
2239  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
2240  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG))
2241  {
2242  /* Start injected conversion */
2243  DFSDM_InjConvStart(hdfsdm_filter);
2244  }
2245  else
2246  {
2247  status = HAL_ERROR;
2248  }
2249  /* Return function status */
2250  return status;
2251 }
2252 
2261  uint32_t Timeout)
2262 {
2263  uint32_t tickstart;
2264 
2265  /* Check parameters */
2267 
2268  /* Check DFSDM filter state */
2269  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_INJ) && \
2270  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
2271  {
2272  /* Return error status */
2273  return HAL_ERROR;
2274  }
2275  else
2276  {
2277  /* Get timeout */
2278  tickstart = HAL_GetTick();
2279 
2280  /* Wait end of injected conversions */
2281  while((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_JEOCF) != DFSDM_FLTISR_JEOCF)
2282  {
2283  /* Check the Timeout */
2284  if(Timeout != HAL_MAX_DELAY)
2285  {
2286  if((Timeout == 0) || ((HAL_GetTick()-tickstart) > Timeout))
2287  {
2288  /* Return timeout status */
2289  return HAL_TIMEOUT;
2290  }
2291  }
2292  }
2293  /* Check if overrun occurs */
2294  if((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_JOVRF) == DFSDM_FLTISR_JOVRF)
2295  {
2296  /* Update error code and call error callback */
2298 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
2299  hdfsdm_filter->ErrorCallback(hdfsdm_filter);
2300 #else
2301  HAL_DFSDM_FilterErrorCallback(hdfsdm_filter);
2302 #endif
2303 
2304  /* Clear injected overrun flag */
2305  hdfsdm_filter->Instance->FLTICR = DFSDM_FLTICR_CLRJOVRF;
2306  }
2307 
2308  /* Update remaining injected conversions */
2309  hdfsdm_filter->InjConvRemaining--;
2310  if(hdfsdm_filter->InjConvRemaining == 0)
2311  {
2312  /* Update DFSDM filter state only if trigger is software */
2313  if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER)
2314  {
2315  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ) ? \
2317  }
2318 
2319  /* end of injected sequence, reset the value */
2320  hdfsdm_filter->InjConvRemaining = (hdfsdm_filter->InjectedScanMode == ENABLE) ? \
2321  hdfsdm_filter->InjectedChannelsNbr : 1;
2322  }
2323 
2324  /* Return function status */
2325  return HAL_OK;
2326  }
2327 }
2328 
2336 {
2337  HAL_StatusTypeDef status = HAL_OK;
2338 
2339  /* Check parameters */
2341 
2342  /* Check DFSDM filter state */
2343  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_INJ) && \
2344  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
2345  {
2346  /* Return error status */
2347  status = HAL_ERROR;
2348  }
2349  else
2350  {
2351  /* Stop injected conversion */
2352  DFSDM_InjConvStop(hdfsdm_filter);
2353  }
2354  /* Return function status */
2355  return status;
2356 }
2357 
2366 {
2367  HAL_StatusTypeDef status = HAL_OK;
2368 
2369  /* Check parameters */
2371 
2372  /* Check DFSDM filter state */
2373  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
2374  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG))
2375  {
2376  /* Enable interrupts for injected conversions */
2377  hdfsdm_filter->Instance->FLTCR2 |= (DFSDM_FLTCR2_JEOCIE | DFSDM_FLTCR2_JOVRIE);
2378 
2379  /* Start injected conversion */
2380  DFSDM_InjConvStart(hdfsdm_filter);
2381  }
2382  else
2383  {
2384  status = HAL_ERROR;
2385  }
2386  /* Return function status */
2387  return status;
2388 }
2389 
2397 {
2398  HAL_StatusTypeDef status = HAL_OK;
2399 
2400  /* Check parameters */
2402 
2403  /* Check DFSDM filter state */
2404  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_INJ) && \
2405  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
2406  {
2407  /* Return error status */
2408  status = HAL_ERROR;
2409  }
2410  else
2411  {
2412  /* Disable interrupts for injected conversions */
2413  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_JEOCIE | DFSDM_FLTCR2_JOVRIE);
2414 
2415  /* Stop injected conversion */
2416  DFSDM_InjConvStop(hdfsdm_filter);
2417  }
2418  /* Return function status */
2419  return status;
2420 }
2421 
2435  int32_t *pData,
2436  uint32_t Length)
2437 {
2438  HAL_StatusTypeDef status = HAL_OK;
2439 
2440  /* Check parameters */
2442 
2443  /* Check destination address and length */
2444  if((pData == NULL) || (Length == 0))
2445  {
2446  status = HAL_ERROR;
2447  }
2448  /* Check that DMA is enabled for injected conversion */
2449  else if((hdfsdm_filter->Instance->FLTCR1 & DFSDM_FLTCR1_JDMAEN) != DFSDM_FLTCR1_JDMAEN)
2450  {
2451  status = HAL_ERROR;
2452  }
2453  /* Check parameters compatibility */
2454  else if((hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2455  (hdfsdm_filter->hdmaInj->Init.Mode == DMA_NORMAL) && \
2456  (Length > hdfsdm_filter->InjConvRemaining))
2457  {
2458  status = HAL_ERROR;
2459  }
2460  else if((hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2461  (hdfsdm_filter->hdmaInj->Init.Mode == DMA_CIRCULAR))
2462  {
2463  status = HAL_ERROR;
2464  }
2465  /* Check DFSDM filter state */
2466  else if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
2467  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG))
2468  {
2469  /* Set callbacks on DMA handler */
2470  hdfsdm_filter->hdmaInj->XferCpltCallback = DFSDM_DMAInjectedConvCplt;
2471  hdfsdm_filter->hdmaInj->XferErrorCallback = DFSDM_DMAError;
2472  hdfsdm_filter->hdmaInj->XferHalfCpltCallback = (hdfsdm_filter->hdmaInj->Init.Mode == DMA_CIRCULAR) ?\
2473  DFSDM_DMAInjectedHalfConvCplt : NULL;
2474 
2475  /* Start DMA in interrupt mode */
2476  if(HAL_DMA_Start_IT(hdfsdm_filter->hdmaInj, (uint32_t)&hdfsdm_filter->Instance->FLTJDATAR, \
2477  (uint32_t) pData, Length) != HAL_OK)
2478  {
2479  /* Set DFSDM filter in error state */
2480  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_ERROR;
2481  status = HAL_ERROR;
2482  }
2483  else
2484  {
2485  /* Start injected conversion */
2486  DFSDM_InjConvStart(hdfsdm_filter);
2487  }
2488  }
2489  else
2490  {
2491  status = HAL_ERROR;
2492  }
2493  /* Return function status */
2494  return status;
2495 }
2496 
2510  int16_t *pData,
2511  uint32_t Length)
2512 {
2513  HAL_StatusTypeDef status = HAL_OK;
2514 
2515  /* Check parameters */
2517 
2518  /* Check destination address and length */
2519  if((pData == NULL) || (Length == 0))
2520  {
2521  status = HAL_ERROR;
2522  }
2523  /* Check that DMA is enabled for injected conversion */
2524  else if((hdfsdm_filter->Instance->FLTCR1 & DFSDM_FLTCR1_JDMAEN) != DFSDM_FLTCR1_JDMAEN)
2525  {
2526  status = HAL_ERROR;
2527  }
2528  /* Check parameters compatibility */
2529  else if((hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2530  (hdfsdm_filter->hdmaInj->Init.Mode == DMA_NORMAL) && \
2531  (Length > hdfsdm_filter->InjConvRemaining))
2532  {
2533  status = HAL_ERROR;
2534  }
2535  else if((hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER) && \
2536  (hdfsdm_filter->hdmaInj->Init.Mode == DMA_CIRCULAR))
2537  {
2538  status = HAL_ERROR;
2539  }
2540  /* Check DFSDM filter state */
2541  else if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) || \
2542  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG))
2543  {
2544  /* Set callbacks on DMA handler */
2545  hdfsdm_filter->hdmaInj->XferCpltCallback = DFSDM_DMAInjectedConvCplt;
2546  hdfsdm_filter->hdmaInj->XferErrorCallback = DFSDM_DMAError;
2547  hdfsdm_filter->hdmaInj->XferHalfCpltCallback = (hdfsdm_filter->hdmaInj->Init.Mode == DMA_CIRCULAR) ?\
2548  DFSDM_DMAInjectedHalfConvCplt : NULL;
2549 
2550  /* Start DMA in interrupt mode */
2551  if(HAL_DMA_Start_IT(hdfsdm_filter->hdmaInj, (uint32_t)(&hdfsdm_filter->Instance->FLTJDATAR) + 2, \
2552  (uint32_t) pData, Length) != HAL_OK)
2553  {
2554  /* Set DFSDM filter in error state */
2555  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_ERROR;
2556  status = HAL_ERROR;
2557  }
2558  else
2559  {
2560  /* Start injected conversion */
2561  DFSDM_InjConvStart(hdfsdm_filter);
2562  }
2563  }
2564  else
2565  {
2566  status = HAL_ERROR;
2567  }
2568  /* Return function status */
2569  return status;
2570 }
2571 
2579 {
2580  HAL_StatusTypeDef status = HAL_OK;
2581 
2582  /* Check parameters */
2584 
2585  /* Check DFSDM filter state */
2586  if((hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_INJ) && \
2587  (hdfsdm_filter->State != HAL_DFSDM_FILTER_STATE_REG_INJ))
2588  {
2589  /* Return error status */
2590  status = HAL_ERROR;
2591  }
2592  else
2593  {
2594  /* Stop current DMA transfer */
2595  if(HAL_DMA_Abort(hdfsdm_filter->hdmaInj) != HAL_OK)
2596  {
2597  /* Set DFSDM filter in error state */
2598  hdfsdm_filter->State = HAL_DFSDM_FILTER_STATE_ERROR;
2599  status = HAL_ERROR;
2600  }
2601  else
2602  {
2603  /* Stop regular conversion */
2604  DFSDM_InjConvStop(hdfsdm_filter);
2605  }
2606  }
2607  /* Return function status */
2608  return status;
2609 }
2610 
2618  uint32_t *Channel)
2619 {
2620  uint32_t reg = 0;
2621  int32_t value = 0;
2622 
2623  /* Check parameters */
2625  assert_param(Channel != NULL);
2626 
2627  /* Get value of data register for injected channel */
2628  reg = hdfsdm_filter->Instance->FLTJDATAR;
2629 
2630  /* Extract channel and injected conversion value */
2631  *Channel = (reg & DFSDM_FLTJDATAR_JDATACH);
2632  value = ((int32_t)(reg & DFSDM_FLTJDATAR_JDATA) >> DFSDM_FLTJDATAR_JDATA_Pos);
2633 
2634  /* return regular conversion value */
2635  return value;
2636 }
2637 
2645  DFSDM_Filter_AwdParamTypeDef *awdParam)
2646 {
2647  HAL_StatusTypeDef status = HAL_OK;
2648 
2649  /* Check parameters */
2657 
2658  /* Check DFSDM filter state */
2659  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_RESET) || \
2660  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_ERROR))
2661  {
2662  /* Return error status */
2663  status = HAL_ERROR;
2664  }
2665  else
2666  {
2667  /* Set analog watchdog data source */
2668  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_AWFSEL);
2669  hdfsdm_filter->Instance->FLTCR1 |= awdParam->DataSource;
2670 
2671  /* Set thresholds and break signals */
2673  hdfsdm_filter->Instance->FLTAWHTR |= (((uint32_t) awdParam->HighThreshold << DFSDM_FLTAWHTR_AWHT_Pos) | \
2674  awdParam->HighBreakSignal);
2676  hdfsdm_filter->Instance->FLTAWLTR |= (((uint32_t) awdParam->LowThreshold << DFSDM_FLTAWLTR_AWLT_Pos) | \
2677  awdParam->LowBreakSignal);
2678 
2679  /* Set channels and interrupt for analog watchdog */
2680  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_AWDCH);
2681  hdfsdm_filter->Instance->FLTCR2 |= (((awdParam->Channel & DFSDM_LSB_MASK) << DFSDM_FLTCR2_AWDCH_Pos) | \
2682  DFSDM_FLTCR2_AWDIE);
2683  }
2684  /* Return function status */
2685  return status;
2686 }
2687 
2694 {
2695  HAL_StatusTypeDef status = HAL_OK;
2696 
2697  /* Check parameters */
2699 
2700  /* Check DFSDM filter state */
2701  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_RESET) || \
2702  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_ERROR))
2703  {
2704  /* Return error status */
2705  status = HAL_ERROR;
2706  }
2707  else
2708  {
2709  /* Reset channels for analog watchdog and deactivate interrupt */
2710  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_AWDCH | DFSDM_FLTCR2_AWDIE);
2711 
2712  /* Clear all analog watchdog flags */
2714 
2715  /* Reset thresholds and break signals */
2718 
2719  /* Reset analog watchdog data source */
2720  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_AWFSEL);
2721  }
2722  /* Return function status */
2723  return status;
2724 }
2725 
2734  uint32_t Channel)
2735 {
2736  HAL_StatusTypeDef status = HAL_OK;
2737 
2738  /* Check parameters */
2741 
2742  /* Check DFSDM filter state */
2743  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_RESET) || \
2744  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_ERROR))
2745  {
2746  /* Return error status */
2747  status = HAL_ERROR;
2748  }
2749  else
2750  {
2751  /* Set channels for extreme detector */
2752  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_EXCH);
2753  hdfsdm_filter->Instance->FLTCR2 |= ((Channel & DFSDM_LSB_MASK) << DFSDM_FLTCR2_EXCH_Pos);
2754  }
2755  /* Return function status */
2756  return status;
2757 }
2758 
2765 {
2766  HAL_StatusTypeDef status = HAL_OK;
2767  __IO uint32_t reg1;
2768  __IO uint32_t reg2;
2769 
2770  /* Check parameters */
2772 
2773  /* Check DFSDM filter state */
2774  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_RESET) || \
2775  (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_ERROR))
2776  {
2777  /* Return error status */
2778  status = HAL_ERROR;
2779  }
2780  else
2781  {
2782  /* Reset channels for extreme detector */
2783  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_EXCH);
2784 
2785  /* Clear extreme detector values */
2786  reg1 = hdfsdm_filter->Instance->FLTEXMAX;
2787  reg2 = hdfsdm_filter->Instance->FLTEXMIN;
2788  UNUSED(reg1); /* To avoid GCC warning */
2789  UNUSED(reg2); /* To avoid GCC warning */
2790  }
2791  /* Return function status */
2792  return status;
2793 }
2794 
2803  uint32_t *Channel)
2804 {
2805  uint32_t reg = 0;
2806  int32_t value = 0;
2807 
2808  /* Check parameters */
2810  assert_param(Channel != NULL);
2811 
2812  /* Get value of extreme detector maximum register */
2813  reg = hdfsdm_filter->Instance->FLTEXMAX;
2814 
2815  /* Extract channel and extreme detector maximum value */
2816  *Channel = (reg & DFSDM_FLTEXMAX_EXMAXCH);
2817  value = ((int32_t)(reg & DFSDM_FLTEXMAX_EXMAX) >> DFSDM_FLTEXMAX_EXMAX_Pos);
2818 
2819  /* return extreme detector maximum value */
2820  return value;
2821 }
2822 
2831  uint32_t *Channel)
2832 {
2833  uint32_t reg = 0;
2834  int32_t value = 0;
2835 
2836  /* Check parameters */
2838  assert_param(Channel != NULL);
2839 
2840  /* Get value of extreme detector minimum register */
2841  reg = hdfsdm_filter->Instance->FLTEXMIN;
2842 
2843  /* Extract channel and extreme detector minimum value */
2844  *Channel = (reg & DFSDM_FLTEXMIN_EXMINCH);
2845  value = ((int32_t)(reg & DFSDM_FLTEXMIN_EXMIN) >> DFSDM_FLTEXMIN_EXMIN_Pos);
2846 
2847  /* return extreme detector minimum value */
2848  return value;
2849 }
2850 
2858 {
2859  uint32_t reg = 0;
2860  uint32_t value = 0;
2861 
2862  /* Check parameters */
2864 
2865  /* Get value of conversion timer register */
2866  reg = hdfsdm_filter->Instance->FLTCNVTIMR;
2867 
2868  /* Extract conversion time value */
2870 
2871  /* return extreme detector minimum value */
2872  return value;
2873 }
2874 
2881 {
2882  /* Check if overrun occurs during regular conversion */
2883  if(((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_ROVRF) != 0) && \
2884  ((hdfsdm_filter->Instance->FLTCR2 & DFSDM_FLTCR2_ROVRIE) != 0))
2885  {
2886  /* Clear regular overrun flag */
2887  hdfsdm_filter->Instance->FLTICR = DFSDM_FLTICR_CLRROVRF;
2888 
2889  /* Update error code */
2891 
2892  /* Call error callback */
2893 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
2894  hdfsdm_filter->ErrorCallback(hdfsdm_filter);
2895 #else
2896  HAL_DFSDM_FilterErrorCallback(hdfsdm_filter);
2897 #endif
2898  }
2899  /* Check if overrun occurs during injected conversion */
2900  else if(((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_JOVRF) != 0) && \
2901  ((hdfsdm_filter->Instance->FLTCR2 & DFSDM_FLTCR2_JOVRIE) != 0))
2902  {
2903  /* Clear injected overrun flag */
2904  hdfsdm_filter->Instance->FLTICR = DFSDM_FLTICR_CLRJOVRF;
2905 
2906  /* Update error code */
2908 
2909  /* Call error callback */
2910 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
2911  hdfsdm_filter->ErrorCallback(hdfsdm_filter);
2912 #else
2913  HAL_DFSDM_FilterErrorCallback(hdfsdm_filter);
2914 #endif
2915  }
2916  /* Check if end of regular conversion */
2917  else if(((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_REOCF) != 0) && \
2918  ((hdfsdm_filter->Instance->FLTCR2 & DFSDM_FLTCR2_REOCIE) != 0))
2919  {
2920  /* Call regular conversion complete callback */
2921 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
2922  hdfsdm_filter->RegConvCpltCallback(hdfsdm_filter);
2923 #else
2924  HAL_DFSDM_FilterRegConvCpltCallback(hdfsdm_filter);
2925 #endif
2926 
2927  /* End of conversion if mode is not continuous and software trigger */
2928  if((hdfsdm_filter->RegularContMode == DFSDM_CONTINUOUS_CONV_OFF) && \
2929  (hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER))
2930  {
2931  /* Disable interrupts for regular conversions */
2932  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_REOCIE);
2933 
2934  /* Update DFSDM filter state */
2935  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG) ? \
2937  }
2938  }
2939  /* Check if end of injected conversion */
2940  else if(((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_JEOCF) != 0) && \
2941  ((hdfsdm_filter->Instance->FLTCR2 & DFSDM_FLTCR2_JEOCIE) != 0))
2942  {
2943  /* Call injected conversion complete callback */
2944 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
2945  hdfsdm_filter->InjConvCpltCallback(hdfsdm_filter);
2946 #else
2947  HAL_DFSDM_FilterInjConvCpltCallback(hdfsdm_filter);
2948 #endif
2949 
2950  /* Update remaining injected conversions */
2951  hdfsdm_filter->InjConvRemaining--;
2952  if(hdfsdm_filter->InjConvRemaining == 0)
2953  {
2954  /* End of conversion if trigger is software */
2955  if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER)
2956  {
2957  /* Disable interrupts for injected conversions */
2958  hdfsdm_filter->Instance->FLTCR2 &= ~(DFSDM_FLTCR2_JEOCIE);
2959 
2960  /* Update DFSDM filter state */
2961  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ) ? \
2963  }
2964  /* end of injected sequence, reset the value */
2965  hdfsdm_filter->InjConvRemaining = (hdfsdm_filter->InjectedScanMode == ENABLE) ? \
2966  hdfsdm_filter->InjectedChannelsNbr : 1;
2967  }
2968  }
2969  /* Check if analog watchdog occurs */
2970  else if(((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_AWDF) != 0) && \
2971  ((hdfsdm_filter->Instance->FLTCR2 & DFSDM_FLTCR2_AWDIE) != 0))
2972  {
2973  uint32_t reg = 0;
2974  uint32_t threshold = 0;
2975  uint32_t channel = 0;
2976 
2977  /* Get channel and threshold */
2978  reg = hdfsdm_filter->Instance->FLTAWSR;
2980  if(threshold == DFSDM_AWD_HIGH_THRESHOLD)
2981  {
2982  reg = reg >> DFSDM_FLTAWSR_AWHTF_Pos;
2983  }
2984  while((reg & 1) == 0)
2985  {
2986  channel++;
2987  reg = reg >> 1;
2988  }
2989  /* Clear analog watchdog flag */
2990  hdfsdm_filter->Instance->FLTAWCFR = (threshold == DFSDM_AWD_HIGH_THRESHOLD) ? \
2991  (1 << (DFSDM_FLTAWSR_AWHTF_Pos + channel)) : \
2992  (1 << channel);
2993 
2994  /* Call analog watchdog callback */
2995 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
2996  hdfsdm_filter->AwdCallback(hdfsdm_filter, channel, threshold);
2997 #else
2998  HAL_DFSDM_FilterAwdCallback(hdfsdm_filter, channel, threshold);
2999 #endif
3000  }
3001  /* Check if clock absence occurs */
3002  else if((hdfsdm_filter->Instance == DFSDM1_Filter0) && \
3003  ((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_CKABF) != 0) && \
3004  ((hdfsdm_filter->Instance->FLTCR2 & DFSDM_FLTCR2_CKABIE) != 0))
3005  {
3006  uint32_t reg = 0;
3007  uint32_t channel = 0;
3008 
3009  reg = ((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_CKABF) >> DFSDM_FLTISR_CKABF_Pos);
3010 
3011  while(channel < DFSDM1_CHANNEL_NUMBER)
3012  {
3013  /* Check if flag is set and corresponding channel is enabled */
3014  if(((reg & 1) != 0) && (a_dfsdm1ChannelHandle[channel] != NULL))
3015  {
3016  /* Check clock absence has been enabled for this channel */
3017  if((a_dfsdm1ChannelHandle[channel]->Instance->CHCFGR1 & DFSDM_CHCFGR1_CKABEN) != 0)
3018  {
3019  /* Clear clock absence flag */
3020  hdfsdm_filter->Instance->FLTICR = (1 << (DFSDM_FLTICR_CLRCKABF_Pos + channel));
3021 
3022  /* Call clock absence callback */
3023 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
3024  a_dfsdm1ChannelHandle[channel]->CkabCallback(a_dfsdm1ChannelHandle[channel]);
3025 #else
3026  HAL_DFSDM_ChannelCkabCallback(a_dfsdm1ChannelHandle[channel]);
3027 #endif
3028  }
3029  }
3030  channel++;
3031  reg = reg >> 1;
3032  }
3033  }
3034  /* Check if short circuit detection occurs */
3035  else if((hdfsdm_filter->Instance == DFSDM1_Filter0) && \
3036  ((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_SCDF) != 0) && \
3037  ((hdfsdm_filter->Instance->FLTCR2 & DFSDM_FLTCR2_SCDIE) != 0))
3038  {
3039  uint32_t reg = 0;
3040  uint32_t channel = 0;
3041 
3042  /* Get channel */
3043  reg = ((hdfsdm_filter->Instance->FLTISR & DFSDM_FLTISR_SCDF) >> DFSDM_FLTISR_SCDF_Pos);
3044  while((reg & 1) == 0)
3045  {
3046  channel++;
3047  reg = reg >> 1;
3048  }
3049 
3050  /* Clear short circuit detection flag */
3051  hdfsdm_filter->Instance->FLTICR = (1 << (DFSDM_FLTICR_CLRSCDF_Pos + channel));
3052 
3053  /* Call short circuit detection callback */
3054 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
3055  a_dfsdm1ChannelHandle[channel]->ScdCallback(a_dfsdm1ChannelHandle[channel]);
3056 #else
3057  HAL_DFSDM_ChannelScdCallback(a_dfsdm1ChannelHandle[channel]);
3058 #endif
3059  }
3060 }
3061 
3070 {
3071  /* Prevent unused argument(s) compilation warning */
3072  UNUSED(hdfsdm_filter);
3073 
3074  /* NOTE : This function should not be modified, when the callback is needed,
3075  the HAL_DFSDM_FilterRegConvCpltCallback could be implemented in the user file.
3076  */
3077 }
3078 
3085 {
3086  /* Prevent unused argument(s) compilation warning */
3087  UNUSED(hdfsdm_filter);
3088 
3089  /* NOTE : This function should not be modified, when the callback is needed,
3090  the HAL_DFSDM_FilterRegConvHalfCpltCallback could be implemented in the user file.
3091  */
3092 }
3093 
3102 {
3103  /* Prevent unused argument(s) compilation warning */
3104  UNUSED(hdfsdm_filter);
3105 
3106  /* NOTE : This function should not be modified, when the callback is needed,
3107  the HAL_DFSDM_FilterInjConvCpltCallback could be implemented in the user file.
3108  */
3109 }
3110 
3117 {
3118  /* Prevent unused argument(s) compilation warning */
3119  UNUSED(hdfsdm_filter);
3120 
3121  /* NOTE : This function should not be modified, when the callback is needed,
3122  the HAL_DFSDM_FilterInjConvHalfCpltCallback could be implemented in the user file.
3123  */
3124 }
3125 
3133 __weak void HAL_DFSDM_FilterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter,
3134  uint32_t Channel, uint32_t Threshold)
3135 {
3136  /* Prevent unused argument(s) compilation warning */
3137  UNUSED(hdfsdm_filter);
3138  UNUSED(Channel);
3139  UNUSED(Threshold);
3140 
3141  /* NOTE : This function should not be modified, when the callback is needed,
3142  the HAL_DFSDM_FilterAwdCallback could be implemented in the user file.
3143  */
3144 }
3145 
3152 {
3153  /* Prevent unused argument(s) compilation warning */
3154  UNUSED(hdfsdm_filter);
3155 
3156  /* NOTE : This function should not be modified, when the callback is needed,
3157  the HAL_DFSDM_FilterErrorCallback could be implemented in the user file.
3158  */
3159 }
3160 
3185 {
3186  /* Return DFSDM filter handle state */
3187  return hdfsdm_filter->State;
3188 }
3189 
3196 {
3197  return hdfsdm_filter->ErrorCode;
3198 }
3199 
3207 /* End of exported functions -------------------------------------------------*/
3208 
3209 /* Private functions ---------------------------------------------------------*/
3219 static void DFSDM_DMARegularHalfConvCplt(DMA_HandleTypeDef *hdma)
3220 {
3221  /* Get DFSDM filter handle */
3222  DFSDM_Filter_HandleTypeDef* hdfsdm_filter = (DFSDM_Filter_HandleTypeDef*) ((DMA_HandleTypeDef*)hdma)->Parent;
3223 
3224  /* Call regular half conversion complete callback */
3225 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
3226  hdfsdm_filter->RegConvHalfCpltCallback(hdfsdm_filter);
3227 #else
3229 #endif
3230 }
3231 
3237 static void DFSDM_DMARegularConvCplt(DMA_HandleTypeDef *hdma)
3238 {
3239  /* Get DFSDM filter handle */
3240  DFSDM_Filter_HandleTypeDef* hdfsdm_filter = (DFSDM_Filter_HandleTypeDef*) ((DMA_HandleTypeDef*)hdma)->Parent;
3241 
3242  /* Call regular conversion complete callback */
3243 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
3244  hdfsdm_filter->RegConvCpltCallback(hdfsdm_filter);
3245 #else
3246  HAL_DFSDM_FilterRegConvCpltCallback(hdfsdm_filter);
3247 #endif
3248 }
3249 
3255 static void DFSDM_DMAInjectedHalfConvCplt(DMA_HandleTypeDef *hdma)
3256 {
3257  /* Get DFSDM filter handle */
3258  DFSDM_Filter_HandleTypeDef* hdfsdm_filter = (DFSDM_Filter_HandleTypeDef*) ((DMA_HandleTypeDef*)hdma)->Parent;
3259 
3260  /* Call injected half conversion complete callback */
3261 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
3262  hdfsdm_filter->InjConvHalfCpltCallback(hdfsdm_filter);
3263 #else
3265 #endif
3266 }
3267 
3273 static void DFSDM_DMAInjectedConvCplt(DMA_HandleTypeDef *hdma)
3274 {
3275  /* Get DFSDM filter handle */
3276  DFSDM_Filter_HandleTypeDef* hdfsdm_filter = (DFSDM_Filter_HandleTypeDef*) ((DMA_HandleTypeDef*)hdma)->Parent;
3277 
3278  /* Call injected conversion complete callback */
3279 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
3280  hdfsdm_filter->InjConvCpltCallback(hdfsdm_filter);
3281 #else
3282  HAL_DFSDM_FilterInjConvCpltCallback(hdfsdm_filter);
3283 #endif
3284 }
3285 
3291 static void DFSDM_DMAError(DMA_HandleTypeDef *hdma)
3292 {
3293  /* Get DFSDM filter handle */
3294  DFSDM_Filter_HandleTypeDef* hdfsdm_filter = (DFSDM_Filter_HandleTypeDef*) ((DMA_HandleTypeDef*)hdma)->Parent;
3295 
3296  /* Update error code */
3297  hdfsdm_filter->ErrorCode = DFSDM_FILTER_ERROR_DMA;
3298 
3299  /* Call error callback */
3300 #if (USE_HAL_DFSDM_REGISTER_CALLBACKS == 1)
3301  hdfsdm_filter->ErrorCallback(hdfsdm_filter);
3302 #else
3303  HAL_DFSDM_FilterErrorCallback(hdfsdm_filter);
3304 #endif
3305 }
3306 
3312 static uint32_t DFSDM_GetInjChannelsNbr(uint32_t Channels)
3313 {
3314  uint32_t nbChannels = 0;
3315  uint32_t tmp;
3316 
3317  /* Get the number of channels from bitfield */
3318  tmp = (uint32_t) (Channels & DFSDM_LSB_MASK);
3319  while(tmp != 0)
3320  {
3321  if((tmp & 1) != 0)
3322  {
3323  nbChannels++;
3324  }
3325  tmp = (uint32_t) (tmp >> 1);
3326  }
3327  return nbChannels;
3328 }
3329 
3335 static uint32_t DFSDM_GetChannelFromInstance(DFSDM_Channel_TypeDef* Instance)
3336 {
3337  uint32_t channel = 0xFF;
3338 
3339  /* Get channel from instance */
3340  if(Instance == DFSDM1_Channel0)
3341  {
3342  channel = 0;
3343  }
3344  else if(Instance == DFSDM1_Channel1)
3345  {
3346  channel = 1;
3347  }
3348  else if(Instance == DFSDM1_Channel2)
3349  {
3350  channel = 2;
3351  }
3352  else if(Instance == DFSDM1_Channel3)
3353  {
3354  channel = 3;
3355  }
3356  else if(Instance == DFSDM1_Channel4)
3357  {
3358  channel = 4;
3359  }
3360  else if(Instance == DFSDM1_Channel5)
3361  {
3362  channel = 5;
3363  }
3364  else if(Instance == DFSDM1_Channel6)
3365  {
3366  channel = 6;
3367  }
3368  else if(Instance == DFSDM1_Channel7)
3369  {
3370  channel = 7;
3371  }
3372 
3373  return channel;
3374 }
3375 
3381 static void DFSDM_RegConvStart(DFSDM_Filter_HandleTypeDef* hdfsdm_filter)
3382 {
3383  /* Check regular trigger */
3384  if(hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER)
3385  {
3386  /* Software start of regular conversion */
3387  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_RSWSTART;
3388  }
3389  else /* synchronous trigger */
3390  {
3391  /* Disable DFSDM filter */
3392  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_DFEN);
3393 
3394  /* Set RSYNC bit in DFSDM_FLTCR1 register */
3395  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_RSYNC;
3396 
3397  /* Enable DFSDM filter */
3398  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_DFEN;
3399 
3400  /* If injected conversion was in progress, restart it */
3401  if(hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ)
3402  {
3403  if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER)
3404  {
3405  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_JSWSTART;
3406  }
3407  /* Update remaining injected conversions */
3408  hdfsdm_filter->InjConvRemaining = (hdfsdm_filter->InjectedScanMode == ENABLE) ? \
3409  hdfsdm_filter->InjectedChannelsNbr : 1;
3410  }
3411  }
3412  /* Update DFSDM filter state */
3413  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) ? \
3415 }
3416 
3422 static void DFSDM_RegConvStop(DFSDM_Filter_HandleTypeDef* hdfsdm_filter)
3423 {
3424  /* Disable DFSDM filter */
3425  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_DFEN);
3426 
3427  /* If regular trigger was synchronous, reset RSYNC bit in DFSDM_FLTCR1 register */
3428  if(hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SYNC_TRIGGER)
3429  {
3430  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_RSYNC);
3431  }
3432 
3433  /* Enable DFSDM filter */
3434  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_DFEN;
3435 
3436  /* If injected conversion was in progress, restart it */
3437  if(hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG_INJ)
3438  {
3439  if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER)
3440  {
3441  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_JSWSTART;
3442  }
3443  /* Update remaining injected conversions */
3444  hdfsdm_filter->InjConvRemaining = (hdfsdm_filter->InjectedScanMode == ENABLE) ? \
3445  hdfsdm_filter->InjectedChannelsNbr : 1;
3446  }
3447 
3448  /* Update DFSDM filter state */
3449  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG) ? \
3451 }
3452 
3458 static void DFSDM_InjConvStart(DFSDM_Filter_HandleTypeDef* hdfsdm_filter)
3459 {
3460  /* Check injected trigger */
3461  if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SW_TRIGGER)
3462  {
3463  /* Software start of injected conversion */
3464  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_JSWSTART;
3465  }
3466  else /* external or synchronous trigger */
3467  {
3468  /* Disable DFSDM filter */
3469  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_DFEN);
3470 
3471  if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SYNC_TRIGGER)
3472  {
3473  /* Set JSYNC bit in DFSDM_FLTCR1 register */
3474  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_JSYNC;
3475  }
3476  else /* external trigger */
3477  {
3478  /* Set JEXTEN[1:0] bits in DFSDM_FLTCR1 register */
3479  hdfsdm_filter->Instance->FLTCR1 |= hdfsdm_filter->ExtTriggerEdge;
3480  }
3481 
3482  /* Enable DFSDM filter */
3483  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_DFEN;
3484 
3485  /* If regular conversion was in progress, restart it */
3486  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG) && \
3487  (hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER))
3488  {
3489  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_RSWSTART;
3490  }
3491  }
3492  /* Update DFSDM filter state */
3493  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_READY) ? \
3495 }
3496 
3502 static void DFSDM_InjConvStop(DFSDM_Filter_HandleTypeDef* hdfsdm_filter)
3503 {
3504  /* Disable DFSDM filter */
3505  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_DFEN);
3506 
3507  /* If injected trigger was synchronous, reset JSYNC bit in DFSDM_FLTCR1 register */
3508  if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_SYNC_TRIGGER)
3509  {
3510  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_JSYNC);
3511  }
3512  else if(hdfsdm_filter->InjectedTrigger == DFSDM_FILTER_EXT_TRIGGER)
3513  {
3514  /* Reset JEXTEN[1:0] bits in DFSDM_FLTCR1 register */
3515  hdfsdm_filter->Instance->FLTCR1 &= ~(DFSDM_FLTCR1_JEXTEN);
3516  }
3517 
3518  /* Enable DFSDM filter */
3519  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_DFEN;
3520 
3521  /* If regular conversion was in progress, restart it */
3522  if((hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_REG_INJ) && \
3523  (hdfsdm_filter->RegularTrigger == DFSDM_FILTER_SW_TRIGGER))
3524  {
3525  hdfsdm_filter->Instance->FLTCR1 |= DFSDM_FLTCR1_RSWSTART;
3526  }
3527 
3528  /* Update remaining injected conversions */
3529  hdfsdm_filter->InjConvRemaining = (hdfsdm_filter->InjectedScanMode == ENABLE) ? \
3530  hdfsdm_filter->InjectedChannelsNbr : 1;
3531 
3532  /* Update DFSDM filter state */
3533  hdfsdm_filter->State = (hdfsdm_filter->State == HAL_DFSDM_FILTER_STATE_INJ) ? \
3534  HAL_DFSDM_FILTER_STATE_READY : HAL_DFSDM_FILTER_STATE_REG;
3535 }
3536 
3540 /* End of private functions --------------------------------------------------*/
3541 
3545 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
3546 #endif /* HAL_DFSDM_MODULE_ENABLED */
3547 
3551 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
DFSDM_Filter_TypeDef::FLTAWLTR
__IO uint32_t FLTAWLTR
Definition: stm32f769xx.h:363
assert_param
#define assert_param(expr)
Include module's header file.
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:353
HAL_DFSDM_FilterPollForInjConversion
HAL_StatusTypeDef HAL_DFSDM_FilterPollForInjConversion(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Timeout)
IS_DFSDM_FILTER_OVS_RATIO
#define IS_DFSDM_FILTER_OVS_RATIO(RATIO)
Definition: stm32h7xx_hal_dfsdm.h:819
DFSDM_CHCFGR1_CKOUTSRC
#define DFSDM_CHCFGR1_CKOUTSRC
Definition: stm32f769xx.h:6114
DFSDM_FLTCR1_RSWSTART
#define DFSDM_FLTCR1_RSWSTART
Definition: stm32f769xx.h:6211
__IO
#define __IO
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:237
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
IS_DFSDM_FILTER_REG_TRIGGER
#define IS_DFSDM_FILTER_REG_TRIGGER(TRIG)
Definition: stm32h7xx_hal_dfsdm.h:752
IS_DFSDM_CONTINUOUS_MODE
#define IS_DFSDM_CONTINUOUS_MODE(MODE)
Definition: stm32h7xx_hal_dfsdm.h:834
DFSDM_Channel_TypeDef::CHCFGR1
__IO uint32_t CHCFGR1
Definition: stm32f769xx.h:376
DFSDM_FLTCR2_SCDIE
#define DFSDM_FLTCR2_SCDIE
Definition: stm32f769xx.h:6253
DFSDM_CONTINUOUS_CONV_ON
#define DFSDM_CONTINUOUS_CONV_ON
Definition: stm32h7xx_hal_dfsdm.h:501
IS_DFSDM_BREAK_SIGNALS
#define IS_DFSDM_BREAK_SIGNALS(VALUE)
Definition: stm32h7xx_hal_dfsdm.h:824
DFSDM_Channel_InitTypeDef::OutputClock
DFSDM_Channel_OutputClockTypeDef OutputClock
Definition: stm32h7xx_hal_dfsdm.h:106
DFSDM_FLTICR_CLRSCDF_Pos
#define DFSDM_FLTICR_CLRSCDF_Pos
Definition: stm32f769xx.h:6300
DFSDM_FLTCR2_REOCIE
#define DFSDM_FLTCR2_REOCIE
Definition: stm32f769xx.h:6265
DFSDM_Filter_AwdParamTypeDef::DataSource
uint32_t DataSource
Definition: stm32h7xx_hal_dfsdm.h:256
DFSDM_FLTCR2_AWDCH_Pos
#define DFSDM_FLTCR2_AWDCH_Pos
Definition: stm32f769xx.h:6242
DFSDM_Channel_InputTypeDef::DataPacking
uint32_t DataPacking
Definition: stm32h7xx_hal_dfsdm.h:73
__DMA_HandleTypeDef::XferHalfCpltCallback
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:153
DFSDM_FLTAWCFR_CLRAWLTF
#define DFSDM_FLTAWCFR_CLRAWLTF
Definition: stm32f769xx.h:6381
DFSDM_FLTAWSR_AWHTF_Pos
#define DFSDM_FLTAWSR_AWHTF_Pos
Definition: stm32f769xx.h:6368
__DMA_HandleTypeDef
DMA handle Structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:139
NULL
#define NULL
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/speex_resampler/thirdparty/resample.c:92
DFSDM_FLTCNVTIMR_CNVCNT
#define DFSDM_FLTCNVTIMR_CNVCNT
Definition: stm32f769xx.h:6402
HAL_DFSDM_FilterGetExdMaxValue
int32_t HAL_DFSDM_FilterGetExdMaxValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
HAL_DFSDM_FilterDeInit
HAL_StatusTypeDef HAL_DFSDM_FilterDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
IS_DFSDM_REGULAR_CHANNEL
#define IS_DFSDM_REGULAR_CHANNEL(CHANNEL)
Definition: stm32h7xx_hal_dfsdm.h:825
DFSDM_CHCFGR1_CHINSEL
#define DFSDM_CHCFGR1_CHINSEL
Definition: stm32f769xx.h:6130
IS_DFSDM_CHANNEL_INPUT_PINS
#define IS_DFSDM_CHANNEL_INPUT_PINS(PINS)
Definition: stm32h7xx_hal_dfsdm.h:734
HAL_DFSDM_FilterInit
HAL_StatusTypeDef HAL_DFSDM_FilterInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM1_Channel5
#define DFSDM1_Channel5
Definition: stm32f769xx.h:1668
HAL_DFSDM_FILTER_STATE_REG
@ HAL_DFSDM_FILTER_STATE_REG
Definition: stm32h7xx_hal_dfsdm.h:161
DFSDM_FLTEXMAX_EXMAX_Pos
#define DFSDM_FLTEXMAX_EXMAX_Pos
Definition: stm32f769xx.h:6384
IS_DFSDM_CHANNEL_ALL_INSTANCE
#define IS_DFSDM_CHANNEL_ALL_INSTANCE(INSTANCE)
Definition: stm32f769xx.h:21512
DFSDM_FLTJDATAR_JDATA_Pos
#define DFSDM_FLTJDATAR_JDATA_Pos
Definition: stm32f769xx.h:6333
DFSDM_FLTCR1_JSCAN
#define DFSDM_FLTCR1_JSCAN
Definition: stm32f769xx.h:6230
DFSDM_FLTICR_CLRCKABF_Pos
#define DFSDM_FLTICR_CLRCKABF_Pos
Definition: stm32f769xx.h:6303
DFSDM_Filter_RegularParamTypeDef::DmaMode
FunctionalState DmaMode
Definition: stm32h7xx_hal_dfsdm.h:175
DFSDM_Filter_TypeDef::FLTAWCFR
__IO uint32_t FLTAWCFR
Definition: stm32f769xx.h:365
DFSDM_Filter_TypeDef::FLTISR
__IO uint32_t FLTISR
Definition: stm32f769xx.h:356
DFSDM_CONTINUOUS_CONV_OFF
#define DFSDM_CONTINUOUS_CONV_OFF
Definition: stm32h7xx_hal_dfsdm.h:500
HAL_DFSDM_FILTER_STATE_REG_INJ
@ HAL_DFSDM_FILTER_STATE_REG_INJ
Definition: stm32h7xx_hal_dfsdm.h:163
DFSDM_Filter_HandleTypeDef::hdmaInj
DMA_HandleTypeDef * hdmaInj
Definition: stm32h7xx_hal_dfsdm.h:228
DFSDM_CHAWSCDR_BKSCD_Pos
#define DFSDM_CHAWSCDR_BKSCD_Pos
Definition: stm32f769xx.h:6168
IS_DFSDM_CHANNEL_SCD_THRESHOLD
#define IS_DFSDM_CHANNEL_SCD_THRESHOLD(VALUE)
Definition: stm32h7xx_hal_dfsdm.h:751
HAL_DFSDM_ChannelCkabStart_IT
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_Filter_TypeDef::FLTCR2
__IO uint32_t FLTCR2
Definition: stm32f769xx.h:355
HAL_DFSDM_ChannelScdCallback
void HAL_DFSDM_ChannelScdCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_Channel_InitTypeDef::SerialInterface
DFSDM_Channel_SerialInterfaceTypeDef SerialInterface
Definition: stm32h7xx_hal_dfsdm.h:108
DFSDM_Channel_AwdTypeDef::FilterOrder
uint32_t FilterOrder
Definition: stm32h7xx_hal_dfsdm.h:95
DFSDM_FLTCR1_DFEN
#define DFSDM_FLTCR1_DFEN
Definition: stm32f769xx.h:6239
IS_DFSDM_CHANNEL_RIGHT_BIT_SHIFT
#define IS_DFSDM_CHANNEL_RIGHT_BIT_SHIFT(VALUE)
Definition: stm32h7xx_hal_dfsdm.h:750
DFSDM_Filter_TypeDef::FLTEXMIN
__IO uint32_t FLTEXMIN
Definition: stm32f769xx.h:367
IS_DFSDM_CHANNEL_OUTPUT_CLOCK_DIVIDER
#define IS_DFSDM_CHANNEL_OUTPUT_CLOCK_DIVIDER(DIVIDER)
Definition: stm32h7xx_hal_dfsdm.h:727
DFSDM_FLTEXMIN_EXMINCH
#define DFSDM_FLTEXMIN_EXMINCH
Definition: stm32f769xx.h:6397
DFSDM_FLTCR1_JDMAEN
#define DFSDM_FLTCR1_JDMAEN
Definition: stm32f769xx.h:6227
HAL_DFSDM_FilterRegularStart_IT
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
HAL_DFSDM_FilterGetState
HAL_DFSDM_Filter_StateTypeDef HAL_DFSDM_FilterGetState(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
HAL_DFSDM_ChannelGetState
HAL_DFSDM_Channel_StateTypeDef HAL_DFSDM_ChannelGetState(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_FILTER_EXT_TRIGGER
#define DFSDM_FILTER_EXT_TRIGGER
Definition: stm32h7xx_hal_dfsdm.h:378
DFSDM_Channel_InitTypeDef::Offset
int32_t Offset
Definition: stm32h7xx_hal_dfsdm.h:110
DFSDM_FILTER_ERROR_DMA
#define DFSDM_FILTER_ERROR_DMA
Definition: stm32h7xx_hal_dfsdm.h:454
DFSDM_Channel_SerialInterfaceTypeDef::Type
uint32_t Type
Definition: stm32h7xx_hal_dfsdm.h:84
__DMA_HandleTypeDef::Init
DMA_InitTypeDef Init
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:143
DFSDM_Filter_InjectedParamTypeDef::DmaMode
FunctionalState DmaMode
Definition: stm32h7xx_hal_dfsdm.h:186
DFSDM_FLTCR1_JEXTSEL
#define DFSDM_FLTCR1_JEXTSEL
Definition: stm32f769xx.h:6219
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
HAL_DFSDM_ChannelMspInit
void HAL_DFSDM_ChannelMspInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_Channel MSP Initialization This function configures the hardware resources used in this example...
Definition: stm32h7xx_hal_msp.c:207
DFSDM_CHCFGR2_DTRBS
#define DFSDM_CHCFGR2_DTRBS
Definition: stm32f769xx.h:6157
IS_DFSDM_FILTER_INTEGRATOR_OVS_RATIO
#define IS_DFSDM_FILTER_INTEGRATOR_OVS_RATIO(RATIO)
Definition: stm32h7xx_hal_dfsdm.h:820
DFSDM_FLTAWLTR_AWLT_Pos
#define DFSDM_FLTAWLTR_AWLT_Pos
Definition: stm32f769xx.h:6360
DFSDM_FLTCR2_AWDIE
#define DFSDM_FLTCR2_AWDIE
Definition: stm32f769xx.h:6256
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:323
DFSDM1_Channel0
#define DFSDM1_Channel0
Definition: stm32f769xx.h:1663
DFSDM_FLTCR2_ROVRIE
#define DFSDM_FLTCR2_ROVRIE
Definition: stm32f769xx.h:6259
DMA_CIRCULAR
#define DMA_CIRCULAR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:282
DFSDM_Filter_HandleTypeDef::RegularTrigger
uint32_t RegularTrigger
Definition: stm32h7xx_hal_dfsdm.h:230
HAL_DFSDM_ChannelGetAwdValue
int16_t HAL_DFSDM_ChannelGetAwdValue(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
HAL_DFSDM_ChannelModifyOffset
HAL_StatusTypeDef HAL_DFSDM_ChannelModifyOffset(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, int32_t Offset)
HAL_DFSDM_FILTER_STATE_INJ
@ HAL_DFSDM_FILTER_STATE_INJ
Definition: stm32h7xx_hal_dfsdm.h:162
HAL_DFSDM_ChannelScdStop
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_FLTAWHTR_AWHT_Pos
#define DFSDM_FLTAWHTR_AWHT_Pos
Definition: stm32f769xx.h:6352
DFSDM_Filter_TypeDef::FLTAWHTR
__IO uint32_t FLTAWHTR
Definition: stm32f769xx.h:362
DFSDM1_Filter0
#define DFSDM1_Filter0
Definition: stm32f769xx.h:1671
DFSDM_CHCFGR1_DFSDMEN
#define DFSDM_CHCFGR1_DFSDMEN
Definition: stm32f769xx.h:6111
HAL_DFSDM_FilterMspDeInit
void HAL_DFSDM_FilterMspDeInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter MSP De-Initialization This function freeze the hardware resources used in this example.
Definition: stm32h7xx_hal_msp.c:257
DFSDM_FILTER_ERROR_REGULAR_OVERRUN
#define DFSDM_FILTER_ERROR_REGULAR_OVERRUN
Definition: stm32h7xx_hal_dfsdm.h:452
HAL_DFSDM_FilterInjectedStart_DMA
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int32_t *pData, uint32_t Length)
DFSDM_AWD_LOW_THRESHOLD
#define DFSDM_AWD_LOW_THRESHOLD
Definition: stm32h7xx_hal_dfsdm.h:510
DFSDM_FLTCR1_JSYNC
#define DFSDM_FLTCR1_JSYNC
Definition: stm32f769xx.h:6233
IS_DFSDM_FILTER_ALL_INSTANCE
#define IS_DFSDM_FILTER_ALL_INSTANCE(INSTANCE)
Definition: stm32f769xx.h:21507
DFSDM_FLTCR1_AWFSEL
#define DFSDM_FLTCR1_AWFSEL
Definition: stm32f769xx.h:6193
HAL_DFSDM_FilterGetInjectedValue
int32_t HAL_DFSDM_FilterGetInjectedValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
ENABLE
@ ENABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:194
HAL_DFSDM_FilterPollForRegConversion
HAL_StatusTypeDef HAL_DFSDM_FilterPollForRegConversion(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Timeout)
HAL_DFSDM_ChannelPollForCkab
HAL_StatusTypeDef HAL_DFSDM_ChannelPollForCkab(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout)
DFSDM_Filter_AwdParamTypeDef::Channel
uint32_t Channel
Definition: stm32h7xx_hal_dfsdm.h:258
DFSDM_FLTISR_REOCF
#define DFSDM_FLTISR_REOCF
Definition: stm32f769xx.h:6294
DFSDM_CHCFGR1_SCDEN
#define DFSDM_CHCFGR1_SCDEN
Definition: stm32f769xx.h:6139
HAL_DFSDM_FilterInjConvHalfCpltCallback
void HAL_DFSDM_FilterInjConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_FLTCR2_AWDCH
#define DFSDM_FLTCR2_AWDCH
Definition: stm32f769xx.h:6244
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
IS_DFSDM_FILTER_EXT_TRIG
#define IS_DFSDM_FILTER_EXT_TRIG(TRIG)
Definition: stm32h7xx_hal_dfsdm.h:793
HAL_DFSDM_FilterRegularMsbStart_DMA
HAL_StatusTypeDef HAL_DFSDM_FilterRegularMsbStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int16_t *pData, uint32_t Length)
DFSDM_FLTFCR_IOSR
#define DFSDM_FLTFCR_IOSR
Definition: stm32f769xx.h:6330
HAL_DFSDM_Channel_StateTypeDef
HAL_DFSDM_Channel_StateTypeDef
HAL DFSDM Channel states definition.
Definition: stm32h7xx_hal_dfsdm.h:47
DFSDM_FLTCR1_RDMAEN
#define DFSDM_FLTCR1_RDMAEN
Definition: stm32f769xx.h:6202
HAL_DFSDM_FilterRegularStop_DMA
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter_HandleTypeDef
DFSDM filter handle structure definition.
Definition: stm32h7xx_hal_dfsdm.h:222
DFSDM_Channel_HandleTypeDef::State
HAL_DFSDM_Channel_StateTypeDef State
Definition: stm32h7xx_hal_dfsdm.h:127
DFSDM_Filter_TypeDef::FLTEXMAX
__IO uint32_t FLTEXMAX
Definition: stm32f769xx.h:366
IS_FUNCTIONAL_STATE
#define IS_FUNCTIONAL_STATE(STATE)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:196
HAL_DFSDM_FilterRegularStop_IT
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter_HandleTypeDef::ErrorCode
uint32_t ErrorCode
Definition: stm32h7xx_hal_dfsdm.h:237
DFSDM_Filter_TypeDef::FLTRDATAR
__IO uint32_t FLTRDATAR
Definition: stm32f769xx.h:361
IS_DFSDM_CHANNEL_INPUT
#define IS_DFSDM_CHANNEL_INPUT(INPUT)
Definition: stm32h7xx_hal_dfsdm.h:728
HAL_DFSDM_FilterInjectedStop_IT
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
DFSDM_Channel_HandleTypeDef::Instance
DFSDM_Channel_TypeDef * Instance
Definition: stm32h7xx_hal_dfsdm.h:125
DFSDM_FLTCR2_JOVRIE
#define DFSDM_FLTCR2_JOVRIE
Definition: stm32f769xx.h:6262
DFSDM_Filter_HandleTypeDef::RegularContMode
uint32_t RegularContMode
Definition: stm32h7xx_hal_dfsdm.h:229
DFSDM1_Channel7
#define DFSDM1_Channel7
Definition: stm32f769xx.h:1670
DFSDM_FLTCR1_JSWSTART
#define DFSDM_FLTCR1_JSWSTART
Definition: stm32f769xx.h:6236
DFSDM_Filter_HandleTypeDef::hdmaReg
DMA_HandleTypeDef * hdmaReg
Definition: stm32h7xx_hal_dfsdm.h:227
DFSDM_CHCFGR1_CKOUTDIV_Pos
#define DFSDM_CHCFGR1_CKOUTDIV_Pos
Definition: stm32f769xx.h:6115
HAL_DFSDM_FilterAwdStop_IT
HAL_StatusTypeDef HAL_DFSDM_FilterAwdStop_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
HAL_DFSDM_ChannelCkabStop_IT
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_Filter_HandleTypeDef::State
HAL_DFSDM_Filter_StateTypeDef State
Definition: stm32h7xx_hal_dfsdm.h:236
DFSDM_CHCFGR2_OFFSET
#define DFSDM_CHCFGR2_OFFSET
Definition: stm32f769xx.h:6154
DFSDM_FLTCR2_EXCH
#define DFSDM_FLTCR2_EXCH
Definition: stm32f769xx.h:6247
DFSDM_Filter_HandleTypeDef::Instance
DFSDM_Filter_TypeDef * Instance
Definition: stm32h7xx_hal_dfsdm.h:225
IS_DFSDM_FILTER_AWD_DATA_SOURCE
#define IS_DFSDM_FILTER_AWD_DATA_SOURCE(DATA)
Definition: stm32h7xx_hal_dfsdm.h:821
HAL_DFSDM_FilterRegularStart_DMA
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int32_t *pData, uint32_t Length)
HAL_DFSDM_FilterRegularStart
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_FLTCR2_JEOCIE
#define DFSDM_FLTCR2_JEOCIE
Definition: stm32f769xx.h:6268
DFSDM_CHCFGR2_OFFSET_Pos
#define DFSDM_CHCFGR2_OFFSET_Pos
Definition: stm32f769xx.h:6152
DFSDM_Filter_HandleTypeDef::ExtTriggerEdge
uint32_t ExtTriggerEdge
Definition: stm32h7xx_hal_dfsdm.h:232
DFSDM_FLTAWLTR_AWLT
#define DFSDM_FLTAWLTR_AWLT
Definition: stm32f769xx.h:6362
DFSDM_Filter_FilterParamTypeDef::Oversampling
uint32_t Oversampling
Definition: stm32h7xx_hal_dfsdm.h:200
HAL_DFSDM_FilterGetExdMinValue
int32_t HAL_DFSDM_FilterGetExdMinValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
DFSDM_CHAWSCDR_AWFOSR
#define DFSDM_CHAWSCDR_AWFOSR
Definition: stm32f769xx.h:6167
DFSDM_Channel_InitTypeDef::Awd
DFSDM_Channel_AwdTypeDef Awd
Definition: stm32h7xx_hal_dfsdm.h:109
DFSDM_FLTAWHTR_BKAWH
#define DFSDM_FLTAWHTR_BKAWH
Definition: stm32f769xx.h:6357
HAL_DFSDM_FilterGetError
uint32_t HAL_DFSDM_FilterGetError(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
HAL_DFSDM_ChannelScdStop_IT
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStop_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_FLTRDATAR_RDATACH
#define DFSDM_FLTRDATAR_RDATACH
Definition: stm32f769xx.h:6349
DFSDM_Channel_TypeDef
DFSDM channel configuration registers.
Definition: stm32f769xx.h:374
HAL_DFSDM_ChannelMspDeInit
void HAL_DFSDM_ChannelMspDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_Channel MSP De-Initialization This function freeze the hardware resources used in this example.
Definition: stm32h7xx_hal_msp.c:290
DFSDM_FLTCR1_FAST
#define DFSDM_FLTCR1_FAST
Definition: stm32f769xx.h:6196
HAL_DFSDM_FilterGetConvTimeValue
uint32_t HAL_DFSDM_FilterGetConvTimeValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
HAL_DFSDM_ChannelDeInit
HAL_StatusTypeDef HAL_DFSDM_ChannelDeInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_Filter_InjectedParamTypeDef::Trigger
uint32_t Trigger
Definition: stm32h7xx_hal_dfsdm.h:183
DFSDM_FLTCR1_RCH
#define DFSDM_FLTCR1_RCH
Definition: stm32f769xx.h:6199
DFSDM_Channel_AwdTypeDef::Oversampling
uint32_t Oversampling
Definition: stm32h7xx_hal_dfsdm.h:97
DFSDM_Filter_TypeDef::FLTICR
__IO uint32_t FLTICR
Definition: stm32f769xx.h:357
DFSDM1_Channel4
#define DFSDM1_Channel4
Definition: stm32f769xx.h:1667
DFSDM_FLTAWHTR_AWHT
#define DFSDM_FLTAWHTR_AWHT
Definition: stm32f769xx.h:6354
DFSDM_FILTER_ERROR_INJECTED_OVERRUN
#define DFSDM_FILTER_ERROR_INJECTED_OVERRUN
Definition: stm32h7xx_hal_dfsdm.h:453
DFSDM_FLTRDATAR_RDATA_Pos
#define DFSDM_FLTRDATAR_RDATA_Pos
Definition: stm32f769xx.h:6341
HAL_DFSDM_FilterRegConvCpltCallback
void HAL_DFSDM_FilterRegConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Regular conversion complete callback.
Definition: stm32f769i_discovery_audio.c:1441
HAL_DMA_Start_IT
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
DFSDM_Filter_InjectedParamTypeDef::ExtTriggerEdge
uint32_t ExtTriggerEdge
Definition: stm32h7xx_hal_dfsdm.h:189
DFSDM_Filter_HandleTypeDef::InjectedScanMode
FunctionalState InjectedScanMode
Definition: stm32h7xx_hal_dfsdm.h:233
DFSDM_FLTAWCFR_CLRAWHTF
#define DFSDM_FLTAWCFR_CLRAWHTF
Definition: stm32f769xx.h:6378
IS_DFSDM_CHANNEL_FILTER_ORDER
#define IS_DFSDM_CHANNEL_FILTER_ORDER(ORDER)
Definition: stm32h7xx_hal_dfsdm.h:744
DFSDM_FLTISR_SCDF
#define DFSDM_FLTISR_SCDF
Definition: stm32f769xx.h:6273
DFSDM_CHCFGR1_SPICKSEL
#define DFSDM_CHCFGR1_SPICKSEL
Definition: stm32f769xx.h:6142
HAL_DFSDM_ChannelInit
HAL_StatusTypeDef HAL_DFSDM_ChannelInit(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM1_Channel6
#define DFSDM1_Channel6
Definition: stm32f769xx.h:1669
DFSDM_FLTICR_CLRROVRF
#define DFSDM_FLTICR_CLRROVRF
Definition: stm32f769xx.h:6308
DFSDM_FILTER_ERROR_NONE
#define DFSDM_FILTER_ERROR_NONE
Definition: stm32h7xx_hal_dfsdm.h:451
DFSDM_CHCFGR1_CKOUTDIV
#define DFSDM_CHCFGR1_CKOUTDIV
Definition: stm32f769xx.h:6117
DFSDM_Filter_AwdParamTypeDef
DFSDM filter analog watchdog parameters structure definition.
Definition: stm32h7xx_hal_dfsdm.h:254
DFSDM_FLTFCR_FORD
#define DFSDM_FLTFCR_FORD
Definition: stm32f769xx.h:6321
DFSDM_Filter_RegularParamTypeDef::Trigger
uint32_t Trigger
Definition: stm32h7xx_hal_dfsdm.h:172
IS_DFSDM_INJECTED_CHANNEL
#define IS_DFSDM_INJECTED_CHANNEL(CHANNEL)
Definition: stm32h7xx_hal_dfsdm.h:833
DFSDM_Filter_FilterParamTypeDef::IntOversampling
uint32_t IntOversampling
Definition: stm32h7xx_hal_dfsdm.h:202
HAL_DFSDM_FilterMspInit
void HAL_DFSDM_FilterMspInit(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter MSP Initialization This function configures the hardware resources used in this example.
Definition: stm32h7xx_hal_msp.c:133
DFSDM_Channel_OutputClockTypeDef::Selection
uint32_t Selection
Definition: stm32h7xx_hal_dfsdm.h:60
DFSDM_Filter_TypeDef::FLTJDATAR
__IO uint32_t FLTJDATAR
Definition: stm32f769xx.h:360
DFSDM_FLTFCR_FOSR
#define DFSDM_FLTFCR_FOSR
Definition: stm32f769xx.h:6327
HAL_DFSDM_ChannelCkabCallback
void HAL_DFSDM_ChannelCkabCallback(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
HAL_DFSDM_FilterRegConvHalfCpltCallback
void HAL_DFSDM_FilterRegConvHalfCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
Half regular conversion complete callback.
Definition: stm32f769i_discovery_audio.c:1517
HAL_DFSDM_IRQHandler
void HAL_DFSDM_IRQHandler(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter_HandleTypeDef::InjConvRemaining
uint32_t InjConvRemaining
Definition: stm32h7xx_hal_dfsdm.h:235
HAL_DFSDM_CHANNEL_STATE_READY
@ HAL_DFSDM_CHANNEL_STATE_READY
Definition: stm32h7xx_hal_dfsdm.h:50
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:61
DFSDM_CHAWSCDR_BKSCD
#define DFSDM_CHAWSCDR_BKSCD
Definition: stm32f769xx.h:6170
DFSDM_CHCFGR1_SITP
#define DFSDM_CHCFGR1_SITP
Definition: stm32f769xx.h:6147
HAL_DMA_Abort
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
HAL_DFSDM_FilterInjectedMsbStart_DMA
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedMsbStart_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, int16_t *pData, uint32_t Length)
DFSDM_FLTCR1_JEXTEN
#define DFSDM_FLTCR1_JEXTEN
Definition: stm32f769xx.h:6214
IS_DFSDM_FILTER_AWD_THRESHOLD
#define IS_DFSDM_FILTER_AWD_THRESHOLD(VALUE)
Definition: stm32h7xx_hal_dfsdm.h:823
DFSDM_FLTEXMIN_EXMIN
#define DFSDM_FLTEXMIN_EXMIN
Definition: stm32f769xx.h:6394
HAL_DFSDM_FilterErrorCallback
void HAL_DFSDM_FilterErrorCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter_AwdParamTypeDef::LowThreshold
int32_t LowThreshold
Definition: stm32h7xx_hal_dfsdm.h:262
DFSDM_Filter_RegularParamTypeDef::FastMode
FunctionalState FastMode
Definition: stm32h7xx_hal_dfsdm.h:174
DFSDM_FLTCR1_RSYNC
#define DFSDM_FLTCR1_RSYNC
Definition: stm32f769xx.h:6205
DFSDM_Channel_InputTypeDef::Multiplexer
uint32_t Multiplexer
Definition: stm32h7xx_hal_dfsdm.h:71
DFSDM_Filter_AwdParamTypeDef::HighThreshold
int32_t HighThreshold
Definition: stm32h7xx_hal_dfsdm.h:260
HAL_DFSDM_FilterInjectedStart
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM1_Channel1
#define DFSDM1_Channel1
Definition: stm32f769xx.h:1664
DFSDM_Channel_HandleTypeDef
DFSDM channel handle structure definition.
Definition: stm32h7xx_hal_dfsdm.h:122
DFSDM_CHAWSCDR_SCDT
#define DFSDM_CHAWSCDR_SCDT
Definition: stm32f769xx.h:6173
HAL_DFSDM_FilterInjectedStart_IT
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Channel_SerialInterfaceTypeDef::SpiClock
uint32_t SpiClock
Definition: stm32h7xx_hal_dfsdm.h:86
DFSDM_Filter_HandleTypeDef::Init
DFSDM_Filter_InitTypeDef Init
Definition: stm32h7xx_hal_dfsdm.h:226
DFSDM_FLTISR_SCDF_Pos
#define DFSDM_FLTISR_SCDF_Pos
Definition: stm32f769xx.h:6271
DFSDM_FLTCR1_RCONT
#define DFSDM_FLTCR1_RCONT
Definition: stm32f769xx.h:6208
DFSDM_Channel_InputTypeDef::Pins
uint32_t Pins
Definition: stm32h7xx_hal_dfsdm.h:75
HAL_DFSDM_FilterConfigRegChannel
HAL_StatusTypeDef HAL_DFSDM_FilterConfigRegChannel(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel, uint32_t ContinuousMode)
HAL_TIMEOUT
@ HAL_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:45
DFSDM_FLTRDATAR_RDATA
#define DFSDM_FLTRDATAR_RDATA
Definition: stm32f769xx.h:6343
DFSDM_Channel_OutputClockTypeDef::Activation
FunctionalState Activation
Definition: stm32h7xx_hal_dfsdm.h:59
DFSDM_FLTCNVTIMR_CNVCNT_Pos
#define DFSDM_FLTCNVTIMR_CNVCNT_Pos
Definition: stm32f769xx.h:6400
DFSDM_Filter_AwdParamTypeDef::LowBreakSignal
uint32_t LowBreakSignal
Definition: stm32h7xx_hal_dfsdm.h:266
DFSDM_CHCFGR1_DATMPX
#define DFSDM_CHCFGR1_DATMPX
Definition: stm32f769xx.h:6125
DFSDM_Channel_TypeDef::CHAWSCDR
__IO uint32_t CHAWSCDR
Definition: stm32f769xx.h:378
DMA_NORMAL
#define DMA_NORMAL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:281
IS_DFSDM_FILTER_SINC_ORDER
#define IS_DFSDM_FILTER_SINC_ORDER(ORDER)
Definition: stm32h7xx_hal_dfsdm.h:813
HAL_DFSDM_ChannelScdStart
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal)
HAL_DFSDM_FilterInjectedStop_DMA
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop_DMA(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter_InitTypeDef::FilterParam
DFSDM_Filter_FilterParamTypeDef FilterParam
Definition: stm32h7xx_hal_dfsdm.h:213
HAL_DFSDM_FilterExdStart
HAL_StatusTypeDef HAL_DFSDM_FilterExdStart(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel)
DFSDM_CHAWSCDR_AWFOSR_Pos
#define DFSDM_CHAWSCDR_AWFOSR_Pos
Definition: stm32f769xx.h:6165
DFSDM_Filter_HandleTypeDef::InjectedChannelsNbr
uint32_t InjectedChannelsNbr
Definition: stm32h7xx_hal_dfsdm.h:234
HAL_DFSDM_FilterInjConvCpltCallback
void HAL_DFSDM_FilterInjConvCpltCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
IS_DFSDM_CHANNEL_FILTER_OVS_RATIO
#define IS_DFSDM_CHANNEL_FILTER_OVS_RATIO(RATIO)
Definition: stm32h7xx_hal_dfsdm.h:748
__DMA_HandleTypeDef::XferCpltCallback
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:151
IS_DFSDM_CHANNEL_SERIAL_INTERFACE_TYPE
#define IS_DFSDM_CHANNEL_SERIAL_INTERFACE_TYPE(MODE)
Definition: stm32h7xx_hal_dfsdm.h:736
DFSDM_Filter_HandleTypeDef::InjectedTrigger
uint32_t InjectedTrigger
Definition: stm32h7xx_hal_dfsdm.h:231
DFSDM_FLTISR_CKABF
#define DFSDM_FLTISR_CKABF
Definition: stm32f769xx.h:6276
HAL_DFSDM_FilterRegularStop
HAL_StatusTypeDef HAL_DFSDM_FilterRegularStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Channel_InitTypeDef::Input
DFSDM_Channel_InputTypeDef Input
Definition: stm32h7xx_hal_dfsdm.h:107
DFSDM_Channel_InitTypeDef::RightBitShift
uint32_t RightBitShift
Definition: stm32h7xx_hal_dfsdm.h:112
DFSDM_Filter_TypeDef::FLTCNVTIMR
__IO uint32_t FLTCNVTIMR
Definition: stm32f769xx.h:368
HAL_DFSDM_FilterConfigInjChannel
HAL_StatusTypeDef HAL_DFSDM_FilterConfigInjChannel(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel)
DFSDM_CHAWSCDR_AWFORD
#define DFSDM_CHAWSCDR_AWFORD
Definition: stm32f769xx.h:6162
IS_DFSDM_CHANNEL_OFFSET
#define IS_DFSDM_CHANNEL_OFFSET(VALUE)
Definition: stm32h7xx_hal_dfsdm.h:749
HAL_DFSDM_Filter_StateTypeDef
HAL_DFSDM_Filter_StateTypeDef
HAL DFSDM Filter states definition.
Definition: stm32h7xx_hal_dfsdm.h:157
DFSDM_FLTCR2_EXCH_Pos
#define DFSDM_FLTCR2_EXCH_Pos
Definition: stm32f769xx.h:6245
DFSDM_FILTER_SYNC_TRIGGER
#define DFSDM_FILTER_SYNC_TRIGGER
Definition: stm32h7xx_hal_dfsdm.h:377
HAL_DFSDM_FilterInjectedStop
HAL_StatusTypeDef HAL_DFSDM_FilterInjectedStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_Filter_TypeDef::FLTJCHGR
__IO uint32_t FLTJCHGR
Definition: stm32f769xx.h:358
HAL_DFSDM_FilterGetRegularValue
int32_t HAL_DFSDM_FilterGetRegularValue(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t *Channel)
DFSDM_FLTISR_CKABF_Pos
#define DFSDM_FLTISR_CKABF_Pos
Definition: stm32f769xx.h:6274
DFSDM_FILTER_SW_TRIGGER
#define DFSDM_FILTER_SW_TRIGGER
Definition: stm32h7xx_hal_dfsdm.h:376
DFSDM_FLTFCR_FOSR_Pos
#define DFSDM_FLTFCR_FOSR_Pos
Definition: stm32f769xx.h:6325
DFSDM_FLTISR_JOVRF
#define DFSDM_FLTISR_JOVRF
Definition: stm32f769xx.h:6291
DFSDM_Channel_OutputClockTypeDef::Divider
uint32_t Divider
Definition: stm32h7xx_hal_dfsdm.h:62
DFSDM_Channel_TypeDef::CHWDATAR
__IO uint32_t CHWDATAR
Definition: stm32f769xx.h:380
DFSDM_FLTAWSR_AWLTF
#define DFSDM_FLTAWSR_AWLTF
Definition: stm32f769xx.h:6373
DFSDM_FLTEXMIN_EXMIN_Pos
#define DFSDM_FLTEXMIN_EXMIN_Pos
Definition: stm32f769xx.h:6392
IS_DFSDM_CHANNEL_DATA_PACKING
#define IS_DFSDM_CHANNEL_DATA_PACKING(MODE)
Definition: stm32h7xx_hal_dfsdm.h:731
DFSDM1_Channel2
#define DFSDM1_Channel2
Definition: stm32f769xx.h:1665
DFSDM_Filter_InjectedParamTypeDef::ScanMode
FunctionalState ScanMode
Definition: stm32h7xx_hal_dfsdm.h:185
HAL_DFSDM_FilterExdStop
HAL_StatusTypeDef HAL_DFSDM_FilterExdStop(DFSDM_Filter_HandleTypeDef *hdfsdm_filter)
DFSDM_FLTISR_ROVRF
#define DFSDM_FLTISR_ROVRF
Definition: stm32f769xx.h:6288
DFSDM_Filter_InitTypeDef::InjectedParam
DFSDM_Filter_InjectedParamTypeDef InjectedParam
Definition: stm32h7xx_hal_dfsdm.h:212
DFSDM_CHCFGR1_CKABEN
#define DFSDM_CHCFGR1_CKABEN
Definition: stm32f769xx.h:6136
HAL_DFSDM_FILTER_STATE_READY
@ HAL_DFSDM_FILTER_STATE_READY
Definition: stm32h7xx_hal_dfsdm.h:160
HAL_DFSDM_ChannelScdStart_IT
HAL_StatusTypeDef HAL_DFSDM_ChannelScdStart_IT(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Threshold, uint32_t BreakSignal)
DFSDM_Filter_TypeDef::FLTFCR
__IO uint32_t FLTFCR
Definition: stm32f769xx.h:359
DFSDM_FLTAWLTR_BKAWL
#define DFSDM_FLTAWLTR_BKAWL
Definition: stm32f769xx.h:6365
DMA_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:70
DFSDM_Filter_InjectedParamTypeDef::ExtTrigger
uint32_t ExtTrigger
Definition: stm32h7xx_hal_dfsdm.h:187
HAL_DFSDM_ChannelCkabStop
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStop(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
HAL_DFSDM_FilterAwdStart_IT
HAL_StatusTypeDef HAL_DFSDM_FilterAwdStart_IT(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, DFSDM_Filter_AwdParamTypeDef *awdParam)
DFSDM_FLTEXMAX_EXMAX
#define DFSDM_FLTEXMAX_EXMAX
Definition: stm32f769xx.h:6386
IS_DFSDM_CHANNEL_SPI_CLOCK
#define IS_DFSDM_CHANNEL_SPI_CLOCK(TYPE)
Definition: stm32h7xx_hal_dfsdm.h:740
DFSDM_Filter_FilterParamTypeDef::SincOrder
uint32_t SincOrder
Definition: stm32h7xx_hal_dfsdm.h:198
HAL_DFSDM_FILTER_STATE_RESET
@ HAL_DFSDM_FILTER_STATE_RESET
Definition: stm32h7xx_hal_dfsdm.h:159
DFSDM_Channel_HandleTypeDef::Init
DFSDM_Channel_InitTypeDef Init
Definition: stm32h7xx_hal_dfsdm.h:126
DFSDM_FLTICR_CLRJOVRF
#define DFSDM_FLTICR_CLRJOVRF
Definition: stm32f769xx.h:6311
HAL_DFSDM_FILTER_STATE_ERROR
@ HAL_DFSDM_FILTER_STATE_ERROR
Definition: stm32h7xx_hal_dfsdm.h:164
HAL_DFSDM_ChannelPollForScd
HAL_StatusTypeDef HAL_DFSDM_ChannelPollForScd(DFSDM_Channel_HandleTypeDef *hdfsdm_channel, uint32_t Timeout)
DFSDM_FLTCR2_CKABIE
#define DFSDM_FLTCR2_CKABIE
Definition: stm32f769xx.h:6250
DFSDM_CHCFGR1_CHEN
#define DFSDM_CHCFGR1_CHEN
Definition: stm32f769xx.h:6133
DFSDM_FLTISR_JEOCF
#define DFSDM_FLTISR_JEOCF
Definition: stm32f769xx.h:6297
DFSDM_Filter_TypeDef::FLTCR1
__IO uint32_t FLTCR1
Definition: stm32f769xx.h:354
DFSDM_FLTJDATAR_JDATA
#define DFSDM_FLTJDATAR_JDATA
Definition: stm32f769xx.h:6335
DFSDM_CHCFGR2_DTRBS_Pos
#define DFSDM_CHCFGR2_DTRBS_Pos
Definition: stm32f769xx.h:6155
HAL_DFSDM_FilterAwdCallback
void HAL_DFSDM_FilterAwdCallback(DFSDM_Filter_HandleTypeDef *hdfsdm_filter, uint32_t Channel, uint32_t Threshold)
DFSDM_Channel_TypeDef::CHCFGR2
__IO uint32_t CHCFGR2
Definition: stm32f769xx.h:377
DFSDM_AWD_HIGH_THRESHOLD
#define DFSDM_AWD_HIGH_THRESHOLD
Definition: stm32h7xx_hal_dfsdm.h:509
DFSDM_CHCFGR1_DATPACK
#define DFSDM_CHCFGR1_DATPACK
Definition: stm32f769xx.h:6120
HAL_DFSDM_CHANNEL_STATE_RESET
@ HAL_DFSDM_CHANNEL_STATE_RESET
Definition: stm32h7xx_hal_dfsdm.h:49
DFSDM_FLTJDATAR_JDATACH
#define DFSDM_FLTJDATAR_JDATACH
Definition: stm32f769xx.h:6338
IS_DFSDM_FILTER_INJ_TRIGGER
#define IS_DFSDM_FILTER_INJ_TRIGGER(TRIG)
Definition: stm32h7xx_hal_dfsdm.h:754
DFSDM_Filter_TypeDef::FLTAWSR
__IO uint32_t FLTAWSR
Definition: stm32f769xx.h:364
HAL_DFSDM_ChannelCkabStart
HAL_StatusTypeDef HAL_DFSDM_ChannelCkabStart(DFSDM_Channel_HandleTypeDef *hdfsdm_channel)
DFSDM_Filter_InitTypeDef::RegularParam
DFSDM_Filter_RegularParamTypeDef RegularParam
Definition: stm32h7xx_hal_dfsdm.h:211
stm32f7xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
__DMA_HandleTypeDef::XferErrorCallback
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:159
DFSDM_FLTEXMAX_EXMAXCH
#define DFSDM_FLTEXMAX_EXMAXCH
Definition: stm32f769xx.h:6389
DFSDM_FLTISR_AWDF
#define DFSDM_FLTISR_AWDF
Definition: stm32f769xx.h:6285
DFSDM1_Channel3
#define DFSDM1_Channel3
Definition: stm32f769xx.h:1666
IS_DFSDM_FILTER_EXT_TRIG_EDGE
#define IS_DFSDM_FILTER_EXT_TRIG_EDGE(EDGE)
Definition: stm32h7xx_hal_dfsdm.h:810
IS_DFSDM_CHANNEL_OUTPUT_CLOCK
#define IS_DFSDM_CHANNEL_OUTPUT_CLOCK(CLOCK)
Definition: stm32h7xx_hal_dfsdm.h:725
DFSDM_Filter_AwdParamTypeDef::HighBreakSignal
uint32_t HighBreakSignal
Definition: stm32h7xx_hal_dfsdm.h:264


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53