stm32f7xx_hal_dma.c
Go to the documentation of this file.
1 
98 /* Includes ------------------------------------------------------------------*/
99 #include "stm32f7xx_hal.h"
100 
110 #ifdef HAL_DMA_MODULE_ENABLED
111 
112 /* Private types -------------------------------------------------------------*/
113 typedef struct
114 {
115  __IO uint32_t ISR;
116  __IO uint32_t Reserved0;
117  __IO uint32_t IFCR;
118 } DMA_Base_Registers;
119 
120 /* Private variables ---------------------------------------------------------*/
121 /* Private constants ---------------------------------------------------------*/
125  #define HAL_TIMEOUT_DMA_ABORT ((uint32_t)5) /* 5 ms */
126 
129 /* Private macros ------------------------------------------------------------*/
130 /* Private functions ---------------------------------------------------------*/
134 static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
135 static uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma);
136 static HAL_StatusTypeDef DMA_CheckFifoParam(DMA_HandleTypeDef *hdma);
137 
142 /* Exported functions ---------------------------------------------------------*/
173 {
174  uint32_t tmp = 0U;
175  uint32_t tickstart = HAL_GetTick();
176  DMA_Base_Registers *regs;
177 
178  /* Check the DMA peripheral state */
179  if(hdma == NULL)
180  {
181  return HAL_ERROR;
182  }
183 
184  /* Check the parameters */
195  /* Check the memory burst, peripheral burst and FIFO threshold parameters only
196  when FIFO mode is enabled */
197  if(hdma->Init.FIFOMode != DMA_FIFOMODE_DISABLE)
198  {
202  }
203 
204  /* Allocate lock resource */
205  __HAL_UNLOCK(hdma);
206 
207  /* Change DMA peripheral state */
208  hdma->State = HAL_DMA_STATE_BUSY;
209 
210  /* Disable the peripheral */
211  __HAL_DMA_DISABLE(hdma);
212 
213  /* Check if the DMA Stream is effectively disabled */
214  while((hdma->Instance->CR & DMA_SxCR_EN) != RESET)
215  {
216  /* Check for the Timeout */
217  if((HAL_GetTick() - tickstart ) > HAL_TIMEOUT_DMA_ABORT)
218  {
219  /* Update error code */
221 
222  /* Change the DMA state */
224 
225  return HAL_TIMEOUT;
226  }
227  }
228 
229  /* Get the CR register value */
230  tmp = hdma->Instance->CR;
231 
232  /* Clear CHSEL, MBURST, PBURST, PL, MSIZE, PSIZE, MINC, PINC, CIRC, DIR, CT and DBM bits */
233  tmp &= ((uint32_t)~(DMA_SxCR_CHSEL | DMA_SxCR_MBURST | DMA_SxCR_PBURST | \
237 
238  /* Prepare the DMA Stream configuration */
239  tmp |= hdma->Init.Channel | hdma->Init.Direction |
240  hdma->Init.PeriphInc | hdma->Init.MemInc |
242  hdma->Init.Mode | hdma->Init.Priority;
243 
244  /* the Memory burst and peripheral burst are not used when the FIFO is disabled */
245  if(hdma->Init.FIFOMode == DMA_FIFOMODE_ENABLE)
246  {
247  /* Get memory burst and peripheral burst */
248  tmp |= hdma->Init.MemBurst | hdma->Init.PeriphBurst;
249  }
250 
251  /* Write to DMA Stream CR register */
252  hdma->Instance->CR = tmp;
253 
254  /* Get the FCR register value */
255  tmp = hdma->Instance->FCR;
256 
257  /* Clear Direct mode and FIFO threshold bits */
258  tmp &= (uint32_t)~(DMA_SxFCR_DMDIS | DMA_SxFCR_FTH);
259 
260  /* Prepare the DMA Stream FIFO configuration */
261  tmp |= hdma->Init.FIFOMode;
262 
263  /* The FIFO threshold is not used when the FIFO mode is disabled */
264  if(hdma->Init.FIFOMode == DMA_FIFOMODE_ENABLE)
265  {
266  /* Get the FIFO threshold */
267  tmp |= hdma->Init.FIFOThreshold;
268 
269  /* Check compatibility between FIFO threshold level and size of the memory burst */
270  /* for INCR4, INCR8, INCR16 bursts */
271  if (hdma->Init.MemBurst != DMA_MBURST_SINGLE)
272  {
273  if (DMA_CheckFifoParam(hdma) != HAL_OK)
274  {
275  /* Update error code */
277 
278  /* Change the DMA state */
279  hdma->State = HAL_DMA_STATE_READY;
280 
281  return HAL_ERROR;
282  }
283  }
284  }
285 
286  /* Write to DMA Stream FCR */
287  hdma->Instance->FCR = tmp;
288 
289  /* Initialize StreamBaseAddress and StreamIndex parameters to be used to calculate
290  DMA steam Base Address needed by HAL_DMA_IRQHandler() and HAL_DMA_PollForTransfer() */
291  regs = (DMA_Base_Registers *)DMA_CalcBaseAndBitshift(hdma);
292 
293  /* Clear all interrupt flags */
294  regs->IFCR = 0x3FU << hdma->StreamIndex;
295 
296  /* Initialize the error code */
298 
299  /* Initialize the DMA state */
300  hdma->State = HAL_DMA_STATE_READY;
301 
302  return HAL_OK;
303 }
304 
312 {
313  DMA_Base_Registers *regs;
314 
315  /* Check the DMA peripheral state */
316  if(hdma == NULL)
317  {
318  return HAL_ERROR;
319  }
320 
321  /* Check the DMA peripheral state */
322  if(hdma->State == HAL_DMA_STATE_BUSY)
323  {
324  /* Return error status */
325  return HAL_BUSY;
326  }
327 
328  /* Check the parameters */
330 
331  /* Disable the selected DMA Streamx */
332  __HAL_DMA_DISABLE(hdma);
333 
334  /* Reset DMA Streamx control register */
335  hdma->Instance->CR = 0U;
336 
337  /* Reset DMA Streamx number of data to transfer register */
338  hdma->Instance->NDTR = 0U;
339 
340  /* Reset DMA Streamx peripheral address register */
341  hdma->Instance->PAR = 0U;
342 
343  /* Reset DMA Streamx memory 0 address register */
344  hdma->Instance->M0AR = 0U;
345 
346  /* Reset DMA Streamx memory 1 address register */
347  hdma->Instance->M1AR = 0U;
348 
349  /* Reset DMA Streamx FIFO control register */
350  hdma->Instance->FCR = (uint32_t)0x00000021U;
351 
352  /* Get DMA steam Base Address */
353  regs = (DMA_Base_Registers *)DMA_CalcBaseAndBitshift(hdma);
354 
355  /* Clear all interrupt flags at correct offset within the register */
356  regs->IFCR = 0x3FU << hdma->StreamIndex;
357 
358  /* Clean all callbacks */
359  hdma->XferCpltCallback = NULL;
360  hdma->XferHalfCpltCallback = NULL;
361  hdma->XferM1CpltCallback = NULL;
363  hdma->XferErrorCallback = NULL;
364  hdma->XferAbortCallback = NULL;
365 
366  /* Reset the error code */
368 
369  /* Reset the DMA state */
370  hdma->State = HAL_DMA_STATE_RESET;
371 
372  /* Release Lock */
373  __HAL_UNLOCK(hdma);
374 
375  return HAL_OK;
376 }
377 
409 HAL_StatusTypeDef HAL_DMA_Start(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
410 {
411  HAL_StatusTypeDef status = HAL_OK;
412 
413  /* Check the parameters */
414  assert_param(IS_DMA_BUFFER_SIZE(DataLength));
415 
416  /* Process locked */
417  __HAL_LOCK(hdma);
418 
419  if(HAL_DMA_STATE_READY == hdma->State)
420  {
421  /* Change DMA peripheral state */
422  hdma->State = HAL_DMA_STATE_BUSY;
423 
424  /* Initialize the error code */
426 
427  /* Configure the source, destination address and the data length */
428  DMA_SetConfig(hdma, SrcAddress, DstAddress, DataLength);
429 
430  /* Enable the Peripheral */
431  __HAL_DMA_ENABLE(hdma);
432  }
433  else
434  {
435  /* Process unlocked */
436  __HAL_UNLOCK(hdma);
437 
438  /* Return error status */
439  status = HAL_BUSY;
440  }
441  return status;
442 }
443 
453 HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
454 {
455  HAL_StatusTypeDef status = HAL_OK;
456 
457  /* calculate DMA base and stream number */
458  DMA_Base_Registers *regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
459 
460  /* Check the parameters */
461  assert_param(IS_DMA_BUFFER_SIZE(DataLength));
462 
463  /* Process locked */
464  __HAL_LOCK(hdma);
465 
466  if(HAL_DMA_STATE_READY == hdma->State)
467  {
468  /* Change DMA peripheral state */
469  hdma->State = HAL_DMA_STATE_BUSY;
470 
471  /* Initialize the error code */
473 
474  /* Configure the source, destination address and the data length */
475  DMA_SetConfig(hdma, SrcAddress, DstAddress, DataLength);
476 
477  /* Clear all interrupt flags at correct offset within the register */
478  regs->IFCR = 0x3FU << hdma->StreamIndex;
479 
480  /* Enable Common interrupts*/
481  hdma->Instance->CR |= DMA_IT_TC | DMA_IT_TE | DMA_IT_DME;
482  hdma->Instance->FCR |= DMA_IT_FE;
483 
484  if(hdma->XferHalfCpltCallback != NULL)
485  {
486  hdma->Instance->CR |= DMA_IT_HT;
487  }
488 
489  /* Enable the Peripheral */
490  __HAL_DMA_ENABLE(hdma);
491  }
492  else
493  {
494  /* Process unlocked */
495  __HAL_UNLOCK(hdma);
496 
497  /* Return error status */
498  status = HAL_BUSY;
499  }
500 
501  return status;
502 }
503 
517 {
518  /* calculate DMA base and stream number */
519  DMA_Base_Registers *regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
520 
521  uint32_t tickstart = HAL_GetTick();
522 
523  if(hdma->State != HAL_DMA_STATE_BUSY)
524  {
526 
527  /* Process Unlocked */
528  __HAL_UNLOCK(hdma);
529 
530  return HAL_ERROR;
531  }
532  else
533  {
534  /* Disable all the transfer interrupts */
535  hdma->Instance->CR &= ~(DMA_IT_TC | DMA_IT_TE | DMA_IT_DME);
536  hdma->Instance->FCR &= ~(DMA_IT_FE);
537 
538  if((hdma->XferHalfCpltCallback != NULL) || (hdma->XferM1HalfCpltCallback != NULL))
539  {
540  hdma->Instance->CR &= ~(DMA_IT_HT);
541  }
542 
543  /* Disable the stream */
544  __HAL_DMA_DISABLE(hdma);
545 
546  /* Check if the DMA Stream is effectively disabled */
547  while((hdma->Instance->CR & DMA_SxCR_EN) != RESET)
548  {
549  /* Check for the Timeout */
550  if((HAL_GetTick() - tickstart ) > HAL_TIMEOUT_DMA_ABORT)
551  {
552  /* Update error code */
554 
555  /* Process Unlocked */
556  __HAL_UNLOCK(hdma);
557 
558  /* Change the DMA state */
560 
561  return HAL_TIMEOUT;
562  }
563  }
564 
565  /* Clear all interrupt flags at correct offset within the register */
566  regs->IFCR = 0x3FU << hdma->StreamIndex;
567 
568  /* Process Unlocked */
569  __HAL_UNLOCK(hdma);
570 
571  /* Change the DMA state*/
572  hdma->State = HAL_DMA_STATE_READY;
573  }
574  return HAL_OK;
575 }
576 
584 {
585  if(hdma->State != HAL_DMA_STATE_BUSY)
586  {
588  return HAL_ERROR;
589  }
590  else
591  {
592  /* Set Abort State */
593  hdma->State = HAL_DMA_STATE_ABORT;
594 
595  /* Disable the stream */
596  __HAL_DMA_DISABLE(hdma);
597  }
598 
599  return HAL_OK;
600 }
601 
614 {
615  HAL_StatusTypeDef status = HAL_OK;
616  uint32_t mask_cpltlevel;
617  uint32_t tickstart = HAL_GetTick();
618  uint32_t tmpisr;
619 
620  /* calculate DMA base and stream number */
621  DMA_Base_Registers *regs;
622 
623  if(HAL_DMA_STATE_BUSY != hdma->State)
624  {
625  /* No transfer ongoing */
627  __HAL_UNLOCK(hdma);
628  return HAL_ERROR;
629  }
630 
631  /* Polling mode not supported in circular mode and double buffering mode */
632  if ((hdma->Instance->CR & DMA_SxCR_CIRC) != RESET)
633  {
635  return HAL_ERROR;
636  }
637 
638  /* Get the level transfer complete flag */
639  if(CompleteLevel == HAL_DMA_FULL_TRANSFER)
640  {
641  /* Transfer Complete flag */
642  mask_cpltlevel = DMA_FLAG_TCIF0_4 << hdma->StreamIndex;
643  }
644  else
645  {
646  /* Half Transfer Complete flag */
647  mask_cpltlevel = DMA_FLAG_HTIF0_4 << hdma->StreamIndex;
648  }
649 
650  regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
651  tmpisr = regs->ISR;
652 
653  while(((tmpisr & mask_cpltlevel) == RESET) && ((hdma->ErrorCode & HAL_DMA_ERROR_TE) == RESET))
654  {
655  /* Check for the Timeout (Not applicable in circular mode)*/
656  if(Timeout != HAL_MAX_DELAY)
657  {
658  if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
659  {
660  /* Update error code */
662 
663  /* Process Unlocked */
664  __HAL_UNLOCK(hdma);
665 
666  /* Change the DMA state */
667  hdma->State = HAL_DMA_STATE_READY;
668 
669  return HAL_TIMEOUT;
670  }
671  }
672 
673  /* Get the ISR register value */
674  tmpisr = regs->ISR;
675 
676  if((tmpisr & (DMA_FLAG_TEIF0_4 << hdma->StreamIndex)) != RESET)
677  {
678  /* Update error code */
679  hdma->ErrorCode |= HAL_DMA_ERROR_TE;
680 
681  /* Clear the transfer error flag */
682  regs->IFCR = DMA_FLAG_TEIF0_4 << hdma->StreamIndex;
683  }
684 
685  if((tmpisr & (DMA_FLAG_FEIF0_4 << hdma->StreamIndex)) != RESET)
686  {
687  /* Update error code */
688  hdma->ErrorCode |= HAL_DMA_ERROR_FE;
689 
690  /* Clear the FIFO error flag */
691  regs->IFCR = DMA_FLAG_FEIF0_4 << hdma->StreamIndex;
692  }
693 
694  if((tmpisr & (DMA_FLAG_DMEIF0_4 << hdma->StreamIndex)) != RESET)
695  {
696  /* Update error code */
697  hdma->ErrorCode |= HAL_DMA_ERROR_DME;
698 
699  /* Clear the Direct Mode error flag */
700  regs->IFCR = DMA_FLAG_DMEIF0_4 << hdma->StreamIndex;
701  }
702  }
703 
704  if(hdma->ErrorCode != HAL_DMA_ERROR_NONE)
705  {
706  if((hdma->ErrorCode & HAL_DMA_ERROR_TE) != RESET)
707  {
708  HAL_DMA_Abort(hdma);
709 
710  /* Clear the half transfer and transfer complete flags */
711  regs->IFCR = (DMA_FLAG_HTIF0_4 | DMA_FLAG_TCIF0_4) << hdma->StreamIndex;
712 
713  /* Process Unlocked */
714  __HAL_UNLOCK(hdma);
715 
716  /* Change the DMA state */
717  hdma->State= HAL_DMA_STATE_READY;
718 
719  return HAL_ERROR;
720  }
721  }
722 
723  /* Get the level transfer complete flag */
724  if(CompleteLevel == HAL_DMA_FULL_TRANSFER)
725  {
726  /* Clear the half transfer and transfer complete flags */
727  regs->IFCR = (DMA_FLAG_HTIF0_4 | DMA_FLAG_TCIF0_4) << hdma->StreamIndex;
728 
729  /* Process Unlocked */
730  __HAL_UNLOCK(hdma);
731 
732  hdma->State = HAL_DMA_STATE_READY;
733  }
734  else
735  {
736  /* Clear the half transfer flag */
737  regs->IFCR = (DMA_FLAG_HTIF0_4) << hdma->StreamIndex;
738  }
739 
740  return status;
741 }
742 
750 {
751  uint32_t tmpisr;
752  __IO uint32_t count = 0;
753  uint32_t timeout = SystemCoreClock / 9600;
754 
755  /* calculate DMA base and stream number */
756  DMA_Base_Registers *regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
757 
758  tmpisr = regs->ISR;
759 
760  /* Transfer Error Interrupt management ***************************************/
761  if ((tmpisr & (DMA_FLAG_TEIF0_4 << hdma->StreamIndex)) != RESET)
762  {
764  {
765  /* Disable the transfer error interrupt */
766  hdma->Instance->CR &= ~(DMA_IT_TE);
767 
768  /* Clear the transfer error flag */
769  regs->IFCR = DMA_FLAG_TEIF0_4 << hdma->StreamIndex;
770 
771  /* Update error code */
772  hdma->ErrorCode |= HAL_DMA_ERROR_TE;
773  }
774  }
775  /* FIFO Error Interrupt management ******************************************/
776  if ((tmpisr & (DMA_FLAG_FEIF0_4 << hdma->StreamIndex)) != RESET)
777  {
779  {
780  /* Clear the FIFO error flag */
781  regs->IFCR = DMA_FLAG_FEIF0_4 << hdma->StreamIndex;
782 
783  /* Update error code */
784  hdma->ErrorCode |= HAL_DMA_ERROR_FE;
785  }
786  }
787  /* Direct Mode Error Interrupt management ***********************************/
788  if ((tmpisr & (DMA_FLAG_DMEIF0_4 << hdma->StreamIndex)) != RESET)
789  {
791  {
792  /* Clear the direct mode error flag */
793  regs->IFCR = DMA_FLAG_DMEIF0_4 << hdma->StreamIndex;
794 
795  /* Update error code */
796  hdma->ErrorCode |= HAL_DMA_ERROR_DME;
797  }
798  }
799  /* Half Transfer Complete Interrupt management ******************************/
800  if ((tmpisr & (DMA_FLAG_HTIF0_4 << hdma->StreamIndex)) != RESET)
801  {
803  {
804  /* Clear the half transfer complete flag */
805  regs->IFCR = DMA_FLAG_HTIF0_4 << hdma->StreamIndex;
806 
807  /* Multi_Buffering mode enabled */
808  if(((hdma->Instance->CR) & (uint32_t)(DMA_SxCR_DBM)) != RESET)
809  {
810  /* Current memory buffer used is Memory 0 */
811  if((hdma->Instance->CR & DMA_SxCR_CT) == RESET)
812  {
813  if(hdma->XferHalfCpltCallback != NULL)
814  {
815  /* Half transfer callback */
816  hdma->XferHalfCpltCallback(hdma);
817  }
818  }
819  /* Current memory buffer used is Memory 1 */
820  else
821  {
822  if(hdma->XferM1HalfCpltCallback != NULL)
823  {
824  /* Half transfer callback */
825  hdma->XferM1HalfCpltCallback(hdma);
826  }
827  }
828  }
829  else
830  {
831  /* Disable the half transfer interrupt if the DMA mode is not CIRCULAR */
832  if((hdma->Instance->CR & DMA_SxCR_CIRC) == RESET)
833  {
834  /* Disable the half transfer interrupt */
835  hdma->Instance->CR &= ~(DMA_IT_HT);
836  }
837 
838  if(hdma->XferHalfCpltCallback != NULL)
839  {
840  /* Half transfer callback */
841  hdma->XferHalfCpltCallback(hdma);
842  }
843  }
844  }
845  }
846  /* Transfer Complete Interrupt management ***********************************/
847  if ((tmpisr & (DMA_FLAG_TCIF0_4 << hdma->StreamIndex)) != RESET)
848  {
850  {
851  /* Clear the transfer complete flag */
852  regs->IFCR = DMA_FLAG_TCIF0_4 << hdma->StreamIndex;
853 
854  if(HAL_DMA_STATE_ABORT == hdma->State)
855  {
856  /* Disable all the transfer interrupts */
857  hdma->Instance->CR &= ~(DMA_IT_TC | DMA_IT_TE | DMA_IT_DME);
858  hdma->Instance->FCR &= ~(DMA_IT_FE);
859 
860  if((hdma->XferHalfCpltCallback != NULL) || (hdma->XferM1HalfCpltCallback != NULL))
861  {
862  hdma->Instance->CR &= ~(DMA_IT_HT);
863  }
864 
865  /* Clear all interrupt flags at correct offset within the register */
866  regs->IFCR = 0x3FU << hdma->StreamIndex;
867 
868  /* Process Unlocked */
869  __HAL_UNLOCK(hdma);
870 
871  /* Change the DMA state */
872  hdma->State = HAL_DMA_STATE_READY;
873 
874  if(hdma->XferAbortCallback != NULL)
875  {
876  hdma->XferAbortCallback(hdma);
877  }
878  return;
879  }
880 
881  if(((hdma->Instance->CR) & (uint32_t)(DMA_SxCR_DBM)) != RESET)
882  {
883  /* Current memory buffer used is Memory 0 */
884  if((hdma->Instance->CR & DMA_SxCR_CT) == RESET)
885  {
886  if(hdma->XferM1CpltCallback != NULL)
887  {
888  /* Transfer complete Callback for memory1 */
889  hdma->XferM1CpltCallback(hdma);
890  }
891  }
892  /* Current memory buffer used is Memory 1 */
893  else
894  {
895  if(hdma->XferCpltCallback != NULL)
896  {
897  /* Transfer complete Callback for memory0 */
898  hdma->XferCpltCallback(hdma);
899  }
900  }
901  }
902  /* Disable the transfer complete interrupt if the DMA mode is not CIRCULAR */
903  else
904  {
905  if((hdma->Instance->CR & DMA_SxCR_CIRC) == RESET)
906  {
907  /* Disable the transfer complete interrupt */
908  hdma->Instance->CR &= ~(DMA_IT_TC);
909 
910  /* Process Unlocked */
911  __HAL_UNLOCK(hdma);
912 
913  /* Change the DMA state */
914  hdma->State = HAL_DMA_STATE_READY;
915  }
916 
917  if(hdma->XferCpltCallback != NULL)
918  {
919  /* Transfer complete callback */
920  hdma->XferCpltCallback(hdma);
921  }
922  }
923  }
924  }
925 
926  /* manage error case */
927  if(hdma->ErrorCode != HAL_DMA_ERROR_NONE)
928  {
929  if((hdma->ErrorCode & HAL_DMA_ERROR_TE) != RESET)
930  {
931  hdma->State = HAL_DMA_STATE_ABORT;
932 
933  /* Disable the stream */
934  __HAL_DMA_DISABLE(hdma);
935 
936  do
937  {
938  if (++count > timeout)
939  {
940  break;
941  }
942  }
943  while((hdma->Instance->CR & DMA_SxCR_EN) != RESET);
944 
945  /* Process Unlocked */
946  __HAL_UNLOCK(hdma);
947 
948  /* Change the DMA state */
949  hdma->State = HAL_DMA_STATE_READY;
950  }
951 
952  if(hdma->XferErrorCallback != NULL)
953  {
954  /* Transfer error callback */
955  hdma->XferErrorCallback(hdma);
956  }
957  }
958 }
959 
971 {
972 
973  HAL_StatusTypeDef status = HAL_OK;
974 
975  /* Process locked */
976  __HAL_LOCK(hdma);
977 
978  if(HAL_DMA_STATE_READY == hdma->State)
979  {
980  switch (CallbackID)
981  {
983  hdma->XferCpltCallback = pCallback;
984  break;
985 
987  hdma->XferHalfCpltCallback = pCallback;
988  break;
989 
991  hdma->XferM1CpltCallback = pCallback;
992  break;
993 
995  hdma->XferM1HalfCpltCallback = pCallback;
996  break;
997 
999  hdma->XferErrorCallback = pCallback;
1000  break;
1001 
1003  hdma->XferAbortCallback = pCallback;
1004  break;
1005 
1006  default:
1007  break;
1008  }
1009  }
1010  else
1011  {
1012  /* Return error status */
1013  status = HAL_ERROR;
1014  }
1015 
1016  /* Release Lock */
1017  __HAL_UNLOCK(hdma);
1018 
1019  return status;
1020 }
1021 
1031 {
1032  HAL_StatusTypeDef status = HAL_OK;
1033 
1034  /* Process locked */
1035  __HAL_LOCK(hdma);
1036 
1037  if(HAL_DMA_STATE_READY == hdma->State)
1038  {
1039  switch (CallbackID)
1040  {
1042  hdma->XferCpltCallback = NULL;
1043  break;
1044 
1046  hdma->XferHalfCpltCallback = NULL;
1047  break;
1048 
1050  hdma->XferM1CpltCallback = NULL;
1051  break;
1052 
1054  hdma->XferM1HalfCpltCallback = NULL;
1055  break;
1056 
1058  hdma->XferErrorCallback = NULL;
1059  break;
1060 
1062  hdma->XferAbortCallback = NULL;
1063  break;
1064 
1066  hdma->XferCpltCallback = NULL;
1067  hdma->XferHalfCpltCallback = NULL;
1068  hdma->XferM1CpltCallback = NULL;
1069  hdma->XferM1HalfCpltCallback = NULL;
1070  hdma->XferErrorCallback = NULL;
1071  hdma->XferAbortCallback = NULL;
1072  break;
1073 
1074  default:
1075  status = HAL_ERROR;
1076  break;
1077  }
1078  }
1079  else
1080  {
1081  status = HAL_ERROR;
1082  }
1083 
1084  /* Release Lock */
1085  __HAL_UNLOCK(hdma);
1086 
1087  return status;
1088 }
1089 
1116 {
1117  return hdma->State;
1118 }
1119 
1126 uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma)
1127 {
1128  return hdma->ErrorCode;
1129 }
1130 
1152 static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
1153 {
1154  /* Clear DBM bit */
1155  hdma->Instance->CR &= (uint32_t)(~DMA_SxCR_DBM);
1156 
1157  /* Configure DMA Stream data length */
1158  hdma->Instance->NDTR = DataLength;
1159 
1160  /* Memory to Peripheral */
1161  if((hdma->Init.Direction) == DMA_MEMORY_TO_PERIPH)
1162  {
1163  /* Configure DMA Stream destination address */
1164  hdma->Instance->PAR = DstAddress;
1165 
1166  /* Configure DMA Stream source address */
1167  hdma->Instance->M0AR = SrcAddress;
1168  }
1169  /* Peripheral to Memory */
1170  else
1171  {
1172  /* Configure DMA Stream source address */
1173  hdma->Instance->PAR = SrcAddress;
1174 
1175  /* Configure DMA Stream destination address */
1176  hdma->Instance->M0AR = DstAddress;
1177  }
1178 }
1179 
1186 static uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma)
1187 {
1188  uint32_t stream_number = (((uint32_t)hdma->Instance & 0xFFU) - 16U) / 24U;
1189 
1190  /* lookup table for necessary bitshift of flags within status registers */
1191  static const uint8_t flagBitshiftOffset[8U] = {0U, 6U, 16U, 22U, 0U, 6U, 16U, 22U};
1192  hdma->StreamIndex = flagBitshiftOffset[stream_number];
1193 
1194  if (stream_number > 3U)
1195  {
1196  /* return pointer to HISR and HIFCR */
1197  hdma->StreamBaseAddress = (((uint32_t)hdma->Instance & (uint32_t)(~0x3FFU)) + 4U);
1198  }
1199  else
1200  {
1201  /* return pointer to LISR and LIFCR */
1202  hdma->StreamBaseAddress = ((uint32_t)hdma->Instance & (uint32_t)(~0x3FFU));
1203  }
1204 
1205  return hdma->StreamBaseAddress;
1206 }
1207 
1214 static HAL_StatusTypeDef DMA_CheckFifoParam(DMA_HandleTypeDef *hdma)
1215 {
1216  HAL_StatusTypeDef status = HAL_OK;
1217  uint32_t tmp = hdma->Init.FIFOThreshold;
1218 
1219  /* Memory Data size equal to Byte */
1221  {
1222  switch (tmp)
1223  {
1227  {
1228  status = HAL_ERROR;
1229  }
1230  break;
1232  if (hdma->Init.MemBurst == DMA_MBURST_INC16)
1233  {
1234  status = HAL_ERROR;
1235  }
1236  break;
1238  break;
1239  default:
1240  break;
1241  }
1242  }
1243 
1244  /* Memory Data size equal to Half-Word */
1245  else if (hdma->Init.MemDataAlignment == DMA_MDATAALIGN_HALFWORD)
1246  {
1247  switch (tmp)
1248  {
1251  status = HAL_ERROR;
1252  break;
1255  {
1256  status = HAL_ERROR;
1257  }
1258  break;
1260  if (hdma->Init.MemBurst == DMA_MBURST_INC16)
1261  {
1262  status = HAL_ERROR;
1263  }
1264  break;
1265  default:
1266  break;
1267  }
1268  }
1269 
1270  /* Memory Data size equal to Word */
1271  else
1272  {
1273  switch (tmp)
1274  {
1278  status = HAL_ERROR;
1279  break;
1282  {
1283  status = HAL_ERROR;
1284  }
1285  break;
1286  default:
1287  break;
1288  }
1289  }
1290 
1291  return status;
1292 }
1293 
1298 #endif /* HAL_DMA_MODULE_ENABLED */
1299 
1307 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
assert_param
#define assert_param(expr)
Include module's header file.
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:353
DMA_IT_HT
#define DMA_IT_HT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:351
DMA_InitTypeDef::Channel
uint32_t Channel
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:51
HAL_DMA_STATE_BUSY
@ HAL_DMA_STATE_BUSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:107
__HAL_DMA_DISABLE
#define __HAL_DMA_DISABLE(__HANDLE__)
Disable the specified DMA Stream.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:425
__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_DMA_PRIORITY
#define IS_DMA_PRIORITY(PRIORITY)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:755
HAL_DMA_XFER_ERROR_CB_ID
@ HAL_DMA_XFER_ERROR_CB_ID
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:131
DMA_MDATAALIGN_BYTE
#define DMA_MDATAALIGN_BYTE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:270
__DMA_HandleTypeDef::XferHalfCpltCallback
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:153
__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
IS_DMA_STREAM_ALL_INSTANCE
#define IS_DMA_STREAM_ALL_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15100
__DMA_HandleTypeDef::StreamIndex
uint32_t StreamIndex
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:167
DMA_FLAG_FEIF0_4
#define DMA_FLAG_FEIF0_4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:363
HAL_DMA_ERROR_TIMEOUT
#define HAL_DMA_ERROR_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:190
DMA_InitTypeDef::Priority
uint32_t Priority
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:75
__DMA_HandleTypeDef::StreamBaseAddress
uint32_t StreamBaseAddress
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:165
DMA_InitTypeDef::PeriphInc
uint32_t PeriphInc
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:58
__DMA_HandleTypeDef::ErrorCode
__IO uint32_t ErrorCode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:163
HAL_DMA_Abort_IT
HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
__DMA_HandleTypeDef::XferM1CpltCallback
void(* XferM1CpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:155
DMA_IT_TC
#define DMA_IT_TC
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:350
__HAL_DMA_ENABLE
#define __HAL_DMA_ENABLE(__HANDLE__)
Enable the specified DMA Stream.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:418
IS_DMA_FIFO_THRESHOLD
#define IS_DMA_FIFO_THRESHOLD(THRESHOLD)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:763
__DMA_HandleTypeDef::XferAbortCallback
void(* XferAbortCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:161
HAL_DMA_ERROR_NO_XFER
#define HAL_DMA_ERROR_NO_XFER
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:192
__DMA_HandleTypeDef::Init
DMA_InitTypeDef Init
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:143
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
HAL_DMA_STATE_ABORT
@ HAL_DMA_STATE_ABORT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:110
IS_DMA_CHANNEL
#define IS_DMA_CHANNEL(CHANNEL)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:721
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
DMA_InitTypeDef::FIFOThreshold
uint32_t FIFOThreshold
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:83
HAL_DMA_STATE_TIMEOUT
@ HAL_DMA_STATE_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:108
DMA_InitTypeDef::PeriphDataAlignment
uint32_t PeriphDataAlignment
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:64
__DMA_HandleTypeDef::State
__IO HAL_DMA_StateTypeDef State
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:147
DMA_Stream_TypeDef::CR
__IO uint32_t CR
Definition: stm32f407xx.h:348
DMA_MBURST_SINGLE
#define DMA_MBURST_SINGLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:326
DMA_Stream_TypeDef::M1AR
__IO uint32_t M1AR
Definition: stm32f407xx.h:352
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
DMA_SxFCR_DMDIS
#define DMA_SxFCR_DMDIS
Definition: stm32f407xx.h:5915
DMA_SxCR_MBURST_1
#define DMA_SxCR_MBURST_1
Definition: stm32f407xx.h:5814
HAL_DMA_XFER_ABORT_CB_ID
@ HAL_DMA_XFER_ABORT_CB_ID
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:132
HAL_DMA_XFER_M1HALFCPLT_CB_ID
@ HAL_DMA_XFER_M1HALFCPLT_CB_ID
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:130
DMA_SxCR_PINC
#define DMA_SxCR_PINC
Definition: stm32f407xx.h:5849
IS_DMA_FIFO_MODE_STATE
#define IS_DMA_FIFO_MODE_STATE(STATE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:760
DMA_SxCR_PBURST
#define DMA_SxCR_PBURST
Definition: stm32f407xx.h:5817
DMA_SxCR_CHSEL
#define DMA_SxCR_CHSEL
Definition: stm32f407xx.h:5806
DMA_SxCR_EN
#define DMA_SxCR_EN
Definition: stm32f407xx.h:5875
DMA_InitTypeDef::MemInc
uint32_t MemInc
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:61
DMA_SxCR_CT
#define DMA_SxCR_CT
Definition: stm32f407xx.h:5822
IS_DMA_MEMORY_INC_STATE
#define IS_DMA_MEMORY_INC_STATE(STATE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:740
HAL_DMA_FULL_TRANSFER
@ HAL_DMA_FULL_TRANSFER
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:118
HAL_DMA_UnRegisterCallback
HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID)
HAL_DMA_XFER_ALL_CB_ID
@ HAL_DMA_XFER_ALL_CB_ID
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:133
HAL_DMA_PollForTransfer
HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout)
__HAL_DMA_GET_IT_SOURCE
#define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
Check whether the specified DMA Stream interrupt is enabled or disabled.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:607
IS_DMA_MODE
#define IS_DMA_MODE(MODE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:751
DMA_IT_DME
#define DMA_IT_DME
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:353
DMA_InitTypeDef::PeriphBurst
uint32_t PeriphBurst
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:92
__HAL_LOCK
#define __HAL_LOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:93
DMA_MDATAALIGN_HALFWORD
#define DMA_MDATAALIGN_HALFWORD
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:271
DMA_MBURST_INC16
#define DMA_MBURST_INC16
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:329
HAL_DMA_GetState
HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma)
__DMA_HandleTypeDef::Instance
DMA_Stream_TypeDef * Instance
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:141
SystemCoreClock
uint32_t SystemCoreClock
Definition: system_MIMXRT1052.c:69
DMA_FLAG_TCIF0_4
#define DMA_FLAG_TCIF0_4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:367
IS_DMA_PERIPHERAL_BURST
#define IS_DMA_PERIPHERAL_BURST(BURST)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:773
DMA_InitTypeDef::MemDataAlignment
uint32_t MemDataAlignment
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:67
DMA_SxCR_DIR
#define DMA_SxCR_DIR
Definition: stm32f407xx.h:5855
HAL_DMA_CallbackIDTypeDef
HAL_DMA_CallbackIDTypeDef
HAL DMA Error Code structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:125
RESET
@ RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:187
count
size_t count
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/tests/test_common/ma_test_common.c:31
HAL_BUSY
@ HAL_BUSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:44
HAL_DMA_Start_IT
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
DMA_Stream_TypeDef::FCR
__IO uint32_t FCR
Definition: stm32f407xx.h:353
DMA_SxCR_PL
#define DMA_SxCR_PL
Definition: stm32f407xx.h:5828
DMA_SxCR_MSIZE
#define DMA_SxCR_MSIZE
Definition: stm32f407xx.h:5836
HAL_DMA_XFER_M1CPLT_CB_ID
@ HAL_DMA_XFER_M1CPLT_CB_ID
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:129
DMA_IT_FE
#define DMA_IT_FE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:354
DMA_SxCR_DBM
#define DMA_SxCR_DBM
Definition: stm32f407xx.h:5825
DMA_FLAG_HTIF0_4
#define DMA_FLAG_HTIF0_4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:366
DMA_Stream_TypeDef::PAR
__IO uint32_t PAR
Definition: stm32f407xx.h:350
DMA_FIFO_THRESHOLD_3QUARTERSFULL
#define DMA_FIFO_THRESHOLD_3QUARTERSFULL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:316
IS_DMA_BUFFER_SIZE
#define IS_DMA_BUFFER_SIZE(SIZE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:735
__HAL_UNLOCK
#define __HAL_UNLOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:105
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:61
DMA_SxCR_PSIZE
#define DMA_SxCR_PSIZE
Definition: stm32f407xx.h:5841
HAL_DMA_Abort
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
DMA_FIFO_THRESHOLD_1QUARTERFULL
#define DMA_FIFO_THRESHOLD_1QUARTERFULL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:314
DMA_SxFCR_FTH
#define DMA_SxFCR_FTH
Definition: stm32f407xx.h:5918
IS_DMA_DIRECTION
#define IS_DMA_DIRECTION(DIRECTION)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:731
HAL_DMA_XFER_CPLT_CB_ID
@ HAL_DMA_XFER_CPLT_CB_ID
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:127
HAL_TIMEOUT
@ HAL_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:45
DMA_InitTypeDef::MemBurst
uint32_t MemBurst
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:86
HAL_DMA_ERROR_DME
#define HAL_DMA_ERROR_DME
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:189
DMA_FIFOMODE_ENABLE
#define DMA_FIFOMODE_ENABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:305
HAL_DMA_STATE_RESET
@ HAL_DMA_STATE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:105
DMA_InitTypeDef::FIFOMode
uint32_t FIFOMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:78
HAL_DMA_ERROR_NOT_SUPPORTED
#define HAL_DMA_ERROR_NOT_SUPPORTED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:193
DMA_FIFOMODE_DISABLE
#define DMA_FIFOMODE_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:304
DMA_Stream_TypeDef::NDTR
__IO uint32_t NDTR
Definition: stm32f407xx.h:349
__DMA_HandleTypeDef::XferCpltCallback
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:151
IS_DMA_MEMORY_DATA_SIZE
#define IS_DMA_MEMORY_DATA_SIZE(SIZE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:747
DMA_FLAG_TEIF0_4
#define DMA_FLAG_TEIF0_4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:365
DMA_MEMORY_TO_PERIPH
#define DMA_MEMORY_TO_PERIPH
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:229
IS_DMA_MEMORY_BURST
#define IS_DMA_MEMORY_BURST(BURST)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:768
HAL_DMA_Init
HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma)
DMA_FLAG_DMEIF0_4
#define DMA_FLAG_DMEIF0_4
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:364
IS_DMA_PERIPHERAL_INC_STATE
#define IS_DMA_PERIPHERAL_INC_STATE(STATE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:737
DMA_InitTypeDef::Direction
uint32_t Direction
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:54
HAL_DMA_DeInit
HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma)
IS_DMA_PERIPHERAL_DATA_SIZE
#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:743
HAL_DMA_ERROR_TE
#define HAL_DMA_ERROR_TE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:187
HAL_DMA_XFER_HALFCPLT_CB_ID
@ HAL_DMA_XFER_HALFCPLT_CB_ID
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:128
DMA_SxCR_MINC
#define DMA_SxCR_MINC
Definition: stm32f407xx.h:5846
__DMA_HandleTypeDef::XferM1HalfCpltCallback
void(* XferM1HalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:157
DMA_Stream_TypeDef::M0AR
__IO uint32_t M0AR
Definition: stm32f407xx.h:351
HAL_DMA_GetError
uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma)
HAL_DMA_ERROR_PARAM
#define HAL_DMA_ERROR_PARAM
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:191
DMA_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:70
HAL_DMA_Start
HAL_StatusTypeDef HAL_DMA_Start(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
HAL_DMA_ERROR_NONE
#define HAL_DMA_ERROR_NONE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:186
HAL_DMA_StateTypeDef
HAL_DMA_StateTypeDef
HAL DMA State structures definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:103
HAL_DMA_LevelCompleteTypeDef
HAL_DMA_LevelCompleteTypeDef
HAL DMA Error Code structure definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:116
HAL_DMA_ERROR_FE
#define HAL_DMA_ERROR_FE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:188
DMA_FIFO_THRESHOLD_FULL
#define DMA_FIFO_THRESHOLD_FULL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:317
DMA_SxCR_CIRC
#define DMA_SxCR_CIRC
Definition: stm32f407xx.h:5852
DMA_IT_TE
#define DMA_IT_TE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:352
stm32f7xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
HAL_DMA_IRQHandler
void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma)
__DMA_HandleTypeDef::XferErrorCallback
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:159
DMA_SxCR_MBURST
#define DMA_SxCR_MBURST
Definition: stm32f407xx.h:5812
HAL_DMA_RegisterCallback
HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void(*pCallback)(DMA_HandleTypeDef *_hdma))
HAL_DMA_STATE_READY
@ HAL_DMA_STATE_READY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:106
DMA_FIFO_THRESHOLD_HALFFULL
#define DMA_FIFO_THRESHOLD_HALFFULL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:315


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