stm32f469/stm32f469i-disco/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
Go to the documentation of this file.
1 
97 /* Includes ------------------------------------------------------------------*/
98 #include "stm32f4xx_hal.h"
99 
109 #ifdef HAL_DMA_MODULE_ENABLED
110 
111 /* Private types -------------------------------------------------------------*/
112 typedef struct
113 {
114  __IO uint32_t ISR;
115  __IO uint32_t Reserved0;
116  __IO uint32_t IFCR;
117 } DMA_Base_Registers;
118 
119 /* Private variables ---------------------------------------------------------*/
120 /* Private constants ---------------------------------------------------------*/
124  #define HAL_TIMEOUT_DMA_ABORT 5U /* 5 ms */
125 
128 /* Private macros ------------------------------------------------------------*/
129 /* Private functions ---------------------------------------------------------*/
133 static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
134 static uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma);
135 static HAL_StatusTypeDef DMA_CheckFifoParam(DMA_HandleTypeDef *hdma);
136 
141 /* Exported functions ---------------------------------------------------------*/
172 {
173  uint32_t tmp = 0U;
174  uint32_t tickstart = HAL_GetTick();
175  DMA_Base_Registers *regs;
176 
177  /* Check the DMA peripheral state */
178  if(hdma == NULL)
179  {
180  return HAL_ERROR;
181  }
182 
183  /* Check the parameters */
194  /* Check the memory burst, peripheral burst and FIFO threshold parameters only
195  when FIFO mode is enabled */
196  if(hdma->Init.FIFOMode != DMA_FIFOMODE_DISABLE)
197  {
201  }
202 
203  /* Allocate lock resource */
204  __HAL_UNLOCK(hdma);
205 
206  /* Change DMA peripheral state */
207  hdma->State = HAL_DMA_STATE_BUSY;
208 
209  /* Disable the peripheral */
210  __HAL_DMA_DISABLE(hdma);
211 
212  /* Check if the DMA Stream is effectively disabled */
213  while((hdma->Instance->CR & DMA_SxCR_EN) != RESET)
214  {
215  /* Check for the Timeout */
216  if((HAL_GetTick() - tickstart ) > HAL_TIMEOUT_DMA_ABORT)
217  {
218  /* Update error code */
220 
221  /* Change the DMA state */
223 
224  return HAL_TIMEOUT;
225  }
226  }
227 
228  /* Get the CR register value */
229  tmp = hdma->Instance->CR;
230 
231  /* Clear CHSEL, MBURST, PBURST, PL, MSIZE, PSIZE, MINC, PINC, CIRC, DIR, CT and DBM bits */
232  tmp &= ((uint32_t)~(DMA_SxCR_CHSEL | DMA_SxCR_MBURST | DMA_SxCR_PBURST | \
236 
237  /* Prepare the DMA Stream configuration */
238  tmp |= hdma->Init.Channel | hdma->Init.Direction |
239  hdma->Init.PeriphInc | hdma->Init.MemInc |
241  hdma->Init.Mode | hdma->Init.Priority;
242 
243  /* the Memory burst and peripheral burst are not used when the FIFO is disabled */
244  if(hdma->Init.FIFOMode == DMA_FIFOMODE_ENABLE)
245  {
246  /* Get memory burst and peripheral burst */
247  tmp |= hdma->Init.MemBurst | hdma->Init.PeriphBurst;
248  }
249 
250  /* Write to DMA Stream CR register */
251  hdma->Instance->CR = tmp;
252 
253  /* Get the FCR register value */
254  tmp = hdma->Instance->FCR;
255 
256  /* Clear Direct mode and FIFO threshold bits */
257  tmp &= (uint32_t)~(DMA_SxFCR_DMDIS | DMA_SxFCR_FTH);
258 
259  /* Prepare the DMA Stream FIFO configuration */
260  tmp |= hdma->Init.FIFOMode;
261 
262  /* The FIFO threshold is not used when the FIFO mode is disabled */
263  if(hdma->Init.FIFOMode == DMA_FIFOMODE_ENABLE)
264  {
265  /* Get the FIFO threshold */
266  tmp |= hdma->Init.FIFOThreshold;
267 
268  /* Check compatibility between FIFO threshold level and size of the memory burst */
269  /* for INCR4, INCR8, INCR16 bursts */
270  if (hdma->Init.MemBurst != DMA_MBURST_SINGLE)
271  {
272  if (DMA_CheckFifoParam(hdma) != HAL_OK)
273  {
274  /* Update error code */
276 
277  /* Change the DMA state */
278  hdma->State = HAL_DMA_STATE_READY;
279 
280  return HAL_ERROR;
281  }
282  }
283  }
284 
285  /* Write to DMA Stream FCR */
286  hdma->Instance->FCR = tmp;
287 
288  /* Initialize StreamBaseAddress and StreamIndex parameters to be used to calculate
289  DMA steam Base Address needed by HAL_DMA_IRQHandler() and HAL_DMA_PollForTransfer() */
290  regs = (DMA_Base_Registers *)DMA_CalcBaseAndBitshift(hdma);
291 
292  /* Clear all interrupt flags */
293  regs->IFCR = 0x3FU << hdma->StreamIndex;
294 
295  /* Initialize the error code */
297 
298  /* Initialize the DMA state */
299  hdma->State = HAL_DMA_STATE_READY;
300 
301  return HAL_OK;
302 }
303 
311 {
312  DMA_Base_Registers *regs;
313 
314  /* Check the DMA peripheral state */
315  if(hdma == NULL)
316  {
317  return HAL_ERROR;
318  }
319 
320  /* Check the DMA peripheral state */
321  if(hdma->State == HAL_DMA_STATE_BUSY)
322  {
323  /* Return error status */
324  return HAL_BUSY;
325  }
326 
327  /* Check the parameters */
329 
330  /* Disable the selected DMA Streamx */
331  __HAL_DMA_DISABLE(hdma);
332 
333  /* Reset DMA Streamx control register */
334  hdma->Instance->CR = 0U;
335 
336  /* Reset DMA Streamx number of data to transfer register */
337  hdma->Instance->NDTR = 0U;
338 
339  /* Reset DMA Streamx peripheral address register */
340  hdma->Instance->PAR = 0U;
341 
342  /* Reset DMA Streamx memory 0 address register */
343  hdma->Instance->M0AR = 0U;
344 
345  /* Reset DMA Streamx memory 1 address register */
346  hdma->Instance->M1AR = 0U;
347 
348  /* Reset DMA Streamx FIFO control register */
349  hdma->Instance->FCR = 0x00000021U;
350 
351  /* Get DMA steam Base Address */
352  regs = (DMA_Base_Registers *)DMA_CalcBaseAndBitshift(hdma);
353 
354  /* Clean all callbacks */
355  hdma->XferCpltCallback = NULL;
356  hdma->XferHalfCpltCallback = NULL;
357  hdma->XferM1CpltCallback = NULL;
359  hdma->XferErrorCallback = NULL;
360  hdma->XferAbortCallback = NULL;
361 
362  /* Clear all interrupt flags at correct offset within the register */
363  regs->IFCR = 0x3FU << hdma->StreamIndex;
364 
365  /* Reset the error code */
367 
368  /* Reset the DMA state */
369  hdma->State = HAL_DMA_STATE_RESET;
370 
371  /* Release Lock */
372  __HAL_UNLOCK(hdma);
373 
374  return HAL_OK;
375 }
376 
408 HAL_StatusTypeDef HAL_DMA_Start(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
409 {
410  HAL_StatusTypeDef status = HAL_OK;
411 
412  /* Check the parameters */
413  assert_param(IS_DMA_BUFFER_SIZE(DataLength));
414 
415  /* Process locked */
416  __HAL_LOCK(hdma);
417 
418  if(HAL_DMA_STATE_READY == hdma->State)
419  {
420  /* Change DMA peripheral state */
421  hdma->State = HAL_DMA_STATE_BUSY;
422 
423  /* Initialize the error code */
425 
426  /* Configure the source, destination address and the data length */
427  DMA_SetConfig(hdma, SrcAddress, DstAddress, DataLength);
428 
429  /* Enable the Peripheral */
430  __HAL_DMA_ENABLE(hdma);
431  }
432  else
433  {
434  /* Process unlocked */
435  __HAL_UNLOCK(hdma);
436 
437  /* Return error status */
438  status = HAL_BUSY;
439  }
440  return status;
441 }
442 
452 HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
453 {
454  HAL_StatusTypeDef status = HAL_OK;
455 
456  /* calculate DMA base and stream number */
457  DMA_Base_Registers *regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
458 
459  /* Check the parameters */
460  assert_param(IS_DMA_BUFFER_SIZE(DataLength));
461 
462  /* Process locked */
463  __HAL_LOCK(hdma);
464 
465  if(HAL_DMA_STATE_READY == hdma->State)
466  {
467  /* Change DMA peripheral state */
468  hdma->State = HAL_DMA_STATE_BUSY;
469 
470  /* Initialize the error code */
472 
473  /* Configure the source, destination address and the data length */
474  DMA_SetConfig(hdma, SrcAddress, DstAddress, DataLength);
475 
476  /* Clear all interrupt flags at correct offset within the register */
477  regs->IFCR = 0x3FU << hdma->StreamIndex;
478 
479  /* Enable Common interrupts*/
480  hdma->Instance->CR |= DMA_IT_TC | DMA_IT_TE | DMA_IT_DME;
481 
482  if(hdma->XferHalfCpltCallback != NULL)
483  {
484  hdma->Instance->CR |= DMA_IT_HT;
485  }
486 
487  /* Enable the Peripheral */
488  __HAL_DMA_ENABLE(hdma);
489  }
490  else
491  {
492  /* Process unlocked */
493  __HAL_UNLOCK(hdma);
494 
495  /* Return error status */
496  status = HAL_BUSY;
497  }
498 
499  return status;
500 }
501 
515 {
516  /* calculate DMA base and stream number */
517  DMA_Base_Registers *regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
518 
519  uint32_t tickstart = HAL_GetTick();
520 
521  if(hdma->State != HAL_DMA_STATE_BUSY)
522  {
524 
525  /* Process Unlocked */
526  __HAL_UNLOCK(hdma);
527 
528  return HAL_ERROR;
529  }
530  else
531  {
532  /* Disable all the transfer interrupts */
533  hdma->Instance->CR &= ~(DMA_IT_TC | DMA_IT_TE | DMA_IT_DME);
534  hdma->Instance->FCR &= ~(DMA_IT_FE);
535 
536  if((hdma->XferHalfCpltCallback != NULL) || (hdma->XferM1HalfCpltCallback != NULL))
537  {
538  hdma->Instance->CR &= ~(DMA_IT_HT);
539  }
540 
541  /* Disable the stream */
542  __HAL_DMA_DISABLE(hdma);
543 
544  /* Check if the DMA Stream is effectively disabled */
545  while((hdma->Instance->CR & DMA_SxCR_EN) != RESET)
546  {
547  /* Check for the Timeout */
548  if((HAL_GetTick() - tickstart ) > HAL_TIMEOUT_DMA_ABORT)
549  {
550  /* Update error code */
552 
553  /* Process Unlocked */
554  __HAL_UNLOCK(hdma);
555 
556  /* Change the DMA state */
558 
559  return HAL_TIMEOUT;
560  }
561  }
562 
563  /* Clear all interrupt flags at correct offset within the register */
564  regs->IFCR = 0x3FU << hdma->StreamIndex;
565 
566  /* Process Unlocked */
567  __HAL_UNLOCK(hdma);
568 
569  /* Change the DMA state*/
570  hdma->State = HAL_DMA_STATE_READY;
571  }
572  return HAL_OK;
573 }
574 
582 {
583  if(hdma->State != HAL_DMA_STATE_BUSY)
584  {
586  return HAL_ERROR;
587  }
588  else
589  {
590  /* Set Abort State */
591  hdma->State = HAL_DMA_STATE_ABORT;
592 
593  /* Disable the stream */
594  __HAL_DMA_DISABLE(hdma);
595  }
596 
597  return HAL_OK;
598 }
599 
612 {
613  HAL_StatusTypeDef status = HAL_OK;
614  uint32_t mask_cpltlevel;
615  uint32_t tickstart = HAL_GetTick();
616  uint32_t tmpisr;
617 
618  /* calculate DMA base and stream number */
619  DMA_Base_Registers *regs;
620 
621  if(HAL_DMA_STATE_BUSY != hdma->State)
622  {
623  /* No transfer ongoing */
625  __HAL_UNLOCK(hdma);
626  return HAL_ERROR;
627  }
628 
629  /* Polling mode not supported in circular mode and double buffering mode */
630  if ((hdma->Instance->CR & DMA_SxCR_CIRC) != RESET)
631  {
633  return HAL_ERROR;
634  }
635 
636  /* Get the level transfer complete flag */
637  if(CompleteLevel == HAL_DMA_FULL_TRANSFER)
638  {
639  /* Transfer Complete flag */
640  mask_cpltlevel = DMA_FLAG_TCIF0_4 << hdma->StreamIndex;
641  }
642  else
643  {
644  /* Half Transfer Complete flag */
645  mask_cpltlevel = DMA_FLAG_HTIF0_4 << hdma->StreamIndex;
646  }
647 
648  regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
649  tmpisr = regs->ISR;
650 
651  while(((tmpisr & mask_cpltlevel) == RESET) && ((hdma->ErrorCode & HAL_DMA_ERROR_TE) == RESET))
652  {
653  /* Check for the Timeout (Not applicable in circular mode)*/
654  if(Timeout != HAL_MAX_DELAY)
655  {
656  if((Timeout == 0U)||((HAL_GetTick() - tickstart ) > Timeout))
657  {
658  /* Update error code */
660 
661  /* Process Unlocked */
662  __HAL_UNLOCK(hdma);
663 
664  /* Change the DMA state */
665  hdma->State = HAL_DMA_STATE_READY;
666 
667  return HAL_TIMEOUT;
668  }
669  }
670 
671  /* Get the ISR register value */
672  tmpisr = regs->ISR;
673 
674  if((tmpisr & (DMA_FLAG_TEIF0_4 << hdma->StreamIndex)) != RESET)
675  {
676  /* Update error code */
677  hdma->ErrorCode |= HAL_DMA_ERROR_TE;
678 
679  /* Clear the transfer error flag */
680  regs->IFCR = DMA_FLAG_TEIF0_4 << hdma->StreamIndex;
681  }
682 
683  if((tmpisr & (DMA_FLAG_FEIF0_4 << hdma->StreamIndex)) != RESET)
684  {
685  /* Update error code */
686  hdma->ErrorCode |= HAL_DMA_ERROR_FE;
687 
688  /* Clear the FIFO error flag */
689  regs->IFCR = DMA_FLAG_FEIF0_4 << hdma->StreamIndex;
690  }
691 
692  if((tmpisr & (DMA_FLAG_DMEIF0_4 << hdma->StreamIndex)) != RESET)
693  {
694  /* Update error code */
695  hdma->ErrorCode |= HAL_DMA_ERROR_DME;
696 
697  /* Clear the Direct Mode error flag */
698  regs->IFCR = DMA_FLAG_DMEIF0_4 << hdma->StreamIndex;
699  }
700  }
701 
702  if(hdma->ErrorCode != HAL_DMA_ERROR_NONE)
703  {
704  if((hdma->ErrorCode & HAL_DMA_ERROR_TE) != RESET)
705  {
706  HAL_DMA_Abort(hdma);
707 
708  /* Clear the half transfer and transfer complete flags */
709  regs->IFCR = (DMA_FLAG_HTIF0_4 | DMA_FLAG_TCIF0_4) << hdma->StreamIndex;
710 
711  /* Process Unlocked */
712  __HAL_UNLOCK(hdma);
713 
714  /* Change the DMA state */
715  hdma->State= HAL_DMA_STATE_READY;
716 
717  return HAL_ERROR;
718  }
719  }
720 
721  /* Get the level transfer complete flag */
722  if(CompleteLevel == HAL_DMA_FULL_TRANSFER)
723  {
724  /* Clear the half transfer and transfer complete flags */
725  regs->IFCR = (DMA_FLAG_HTIF0_4 | DMA_FLAG_TCIF0_4) << hdma->StreamIndex;
726 
727  /* Process Unlocked */
728  __HAL_UNLOCK(hdma);
729 
730  hdma->State = HAL_DMA_STATE_READY;
731  }
732  else
733  {
734  /* Clear the half transfer and transfer complete flags */
735  regs->IFCR = (DMA_FLAG_HTIF0_4) << hdma->StreamIndex;
736  }
737 
738  return status;
739 }
740 
748 {
749  uint32_t tmpisr;
750  __IO uint32_t count = 0U;
751  uint32_t timeout = SystemCoreClock / 9600U;
752 
753  /* calculate DMA base and stream number */
754  DMA_Base_Registers *regs = (DMA_Base_Registers *)hdma->StreamBaseAddress;
755 
756  tmpisr = regs->ISR;
757 
758  /* Transfer Error Interrupt management ***************************************/
759  if ((tmpisr & (DMA_FLAG_TEIF0_4 << hdma->StreamIndex)) != RESET)
760  {
762  {
763  /* Disable the transfer error interrupt */
764  hdma->Instance->CR &= ~(DMA_IT_TE);
765 
766  /* Clear the transfer error flag */
767  regs->IFCR = DMA_FLAG_TEIF0_4 << hdma->StreamIndex;
768 
769  /* Update error code */
770  hdma->ErrorCode |= HAL_DMA_ERROR_TE;
771  }
772  }
773  /* FIFO Error Interrupt management ******************************************/
774  if ((tmpisr & (DMA_FLAG_FEIF0_4 << hdma->StreamIndex)) != RESET)
775  {
777  {
778  /* Clear the FIFO error flag */
779  regs->IFCR = DMA_FLAG_FEIF0_4 << hdma->StreamIndex;
780 
781  /* Update error code */
782  hdma->ErrorCode |= HAL_DMA_ERROR_FE;
783  }
784  }
785  /* Direct Mode Error Interrupt management ***********************************/
786  if ((tmpisr & (DMA_FLAG_DMEIF0_4 << hdma->StreamIndex)) != RESET)
787  {
789  {
790  /* Clear the direct mode error flag */
791  regs->IFCR = DMA_FLAG_DMEIF0_4 << hdma->StreamIndex;
792 
793  /* Update error code */
794  hdma->ErrorCode |= HAL_DMA_ERROR_DME;
795  }
796  }
797  /* Half Transfer Complete Interrupt management ******************************/
798  if ((tmpisr & (DMA_FLAG_HTIF0_4 << hdma->StreamIndex)) != RESET)
799  {
801  {
802  /* Clear the half transfer complete flag */
803  regs->IFCR = DMA_FLAG_HTIF0_4 << hdma->StreamIndex;
804 
805  /* Multi_Buffering mode enabled */
806  if(((hdma->Instance->CR) & (uint32_t)(DMA_SxCR_DBM)) != RESET)
807  {
808  /* Current memory buffer used is Memory 0 */
809  if((hdma->Instance->CR & DMA_SxCR_CT) == RESET)
810  {
811  if(hdma->XferHalfCpltCallback != NULL)
812  {
813  /* Half transfer callback */
814  hdma->XferHalfCpltCallback(hdma);
815  }
816  }
817  /* Current memory buffer used is Memory 1 */
818  else
819  {
820  if(hdma->XferM1HalfCpltCallback != NULL)
821  {
822  /* Half transfer callback */
823  hdma->XferM1HalfCpltCallback(hdma);
824  }
825  }
826  }
827  else
828  {
829  /* Disable the half transfer interrupt if the DMA mode is not CIRCULAR */
830  if((hdma->Instance->CR & DMA_SxCR_CIRC) == RESET)
831  {
832  /* Disable the half transfer interrupt */
833  hdma->Instance->CR &= ~(DMA_IT_HT);
834  }
835 
836  if(hdma->XferHalfCpltCallback != NULL)
837  {
838  /* Half transfer callback */
839  hdma->XferHalfCpltCallback(hdma);
840  }
841  }
842  }
843  }
844  /* Transfer Complete Interrupt management ***********************************/
845  if ((tmpisr & (DMA_FLAG_TCIF0_4 << hdma->StreamIndex)) != RESET)
846  {
848  {
849  /* Clear the transfer complete flag */
850  regs->IFCR = DMA_FLAG_TCIF0_4 << hdma->StreamIndex;
851 
852  if(HAL_DMA_STATE_ABORT == hdma->State)
853  {
854  /* Disable all the transfer interrupts */
855  hdma->Instance->CR &= ~(DMA_IT_TC | DMA_IT_TE | DMA_IT_DME);
856  hdma->Instance->FCR &= ~(DMA_IT_FE);
857 
858  if((hdma->XferHalfCpltCallback != NULL) || (hdma->XferM1HalfCpltCallback != NULL))
859  {
860  hdma->Instance->CR &= ~(DMA_IT_HT);
861  }
862 
863  /* Clear all interrupt flags at correct offset within the register */
864  regs->IFCR = 0x3FU << hdma->StreamIndex;
865 
866  /* Process Unlocked */
867  __HAL_UNLOCK(hdma);
868 
869  /* Change the DMA state */
870  hdma->State = HAL_DMA_STATE_READY;
871 
872  if(hdma->XferAbortCallback != NULL)
873  {
874  hdma->XferAbortCallback(hdma);
875  }
876  return;
877  }
878 
879  if(((hdma->Instance->CR) & (uint32_t)(DMA_SxCR_DBM)) != RESET)
880  {
881  /* Current memory buffer used is Memory 0 */
882  if((hdma->Instance->CR & DMA_SxCR_CT) == RESET)
883  {
884  if(hdma->XferM1CpltCallback != NULL)
885  {
886  /* Transfer complete Callback for memory1 */
887  hdma->XferM1CpltCallback(hdma);
888  }
889  }
890  /* Current memory buffer used is Memory 1 */
891  else
892  {
893  if(hdma->XferCpltCallback != NULL)
894  {
895  /* Transfer complete Callback for memory0 */
896  hdma->XferCpltCallback(hdma);
897  }
898  }
899  }
900  /* Disable the transfer complete interrupt if the DMA mode is not CIRCULAR */
901  else
902  {
903  if((hdma->Instance->CR & DMA_SxCR_CIRC) == RESET)
904  {
905  /* Disable the transfer complete interrupt */
906  hdma->Instance->CR &= ~(DMA_IT_TC);
907 
908  /* Process Unlocked */
909  __HAL_UNLOCK(hdma);
910 
911  /* Change the DMA state */
912  hdma->State = HAL_DMA_STATE_READY;
913  }
914 
915  if(hdma->XferCpltCallback != NULL)
916  {
917  /* Transfer complete callback */
918  hdma->XferCpltCallback(hdma);
919  }
920  }
921  }
922  }
923 
924  /* manage error case */
925  if(hdma->ErrorCode != HAL_DMA_ERROR_NONE)
926  {
927  if((hdma->ErrorCode & HAL_DMA_ERROR_TE) != RESET)
928  {
929  hdma->State = HAL_DMA_STATE_ABORT;
930 
931  /* Disable the stream */
932  __HAL_DMA_DISABLE(hdma);
933 
934  do
935  {
936  if (++count > timeout)
937  {
938  break;
939  }
940  }
941  while((hdma->Instance->CR & DMA_SxCR_EN) != RESET);
942 
943  /* Process Unlocked */
944  __HAL_UNLOCK(hdma);
945 
946  /* Change the DMA state */
947  hdma->State = HAL_DMA_STATE_READY;
948  }
949 
950  if(hdma->XferErrorCallback != NULL)
951  {
952  /* Transfer error callback */
953  hdma->XferErrorCallback(hdma);
954  }
955  }
956 }
957 
969 {
970 
971  HAL_StatusTypeDef status = HAL_OK;
972 
973  /* Process locked */
974  __HAL_LOCK(hdma);
975 
976  if(HAL_DMA_STATE_READY == hdma->State)
977  {
978  switch (CallbackID)
979  {
981  hdma->XferCpltCallback = pCallback;
982  break;
983 
985  hdma->XferHalfCpltCallback = pCallback;
986  break;
987 
989  hdma->XferM1CpltCallback = pCallback;
990  break;
991 
993  hdma->XferM1HalfCpltCallback = pCallback;
994  break;
995 
997  hdma->XferErrorCallback = pCallback;
998  break;
999 
1001  hdma->XferAbortCallback = pCallback;
1002  break;
1003 
1004  default:
1005  break;
1006  }
1007  }
1008  else
1009  {
1010  /* Return error status */
1011  status = HAL_ERROR;
1012  }
1013 
1014  /* Release Lock */
1015  __HAL_UNLOCK(hdma);
1016 
1017  return status;
1018 }
1019 
1029 {
1030  HAL_StatusTypeDef status = HAL_OK;
1031 
1032  /* Process locked */
1033  __HAL_LOCK(hdma);
1034 
1035  if(HAL_DMA_STATE_READY == hdma->State)
1036  {
1037  switch (CallbackID)
1038  {
1040  hdma->XferCpltCallback = NULL;
1041  break;
1042 
1044  hdma->XferHalfCpltCallback = NULL;
1045  break;
1046 
1048  hdma->XferM1CpltCallback = NULL;
1049  break;
1050 
1052  hdma->XferM1HalfCpltCallback = NULL;
1053  break;
1054 
1056  hdma->XferErrorCallback = NULL;
1057  break;
1058 
1060  hdma->XferAbortCallback = NULL;
1061  break;
1062 
1064  hdma->XferCpltCallback = NULL;
1065  hdma->XferHalfCpltCallback = NULL;
1066  hdma->XferM1CpltCallback = NULL;
1067  hdma->XferM1HalfCpltCallback = NULL;
1068  hdma->XferErrorCallback = NULL;
1069  hdma->XferAbortCallback = NULL;
1070  break;
1071 
1072  default:
1073  status = HAL_ERROR;
1074  break;
1075  }
1076  }
1077  else
1078  {
1079  status = HAL_ERROR;
1080  }
1081 
1082  /* Release Lock */
1083  __HAL_UNLOCK(hdma);
1084 
1085  return status;
1086 }
1087 
1114 {
1115  return hdma->State;
1116 }
1117 
1124 uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma)
1125 {
1126  return hdma->ErrorCode;
1127 }
1128 
1150 static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
1151 {
1152  /* Clear DBM bit */
1153  hdma->Instance->CR &= (uint32_t)(~DMA_SxCR_DBM);
1154 
1155  /* Configure DMA Stream data length */
1156  hdma->Instance->NDTR = DataLength;
1157 
1158  /* Memory to Peripheral */
1159  if((hdma->Init.Direction) == DMA_MEMORY_TO_PERIPH)
1160  {
1161  /* Configure DMA Stream destination address */
1162  hdma->Instance->PAR = DstAddress;
1163 
1164  /* Configure DMA Stream source address */
1165  hdma->Instance->M0AR = SrcAddress;
1166  }
1167  /* Peripheral to Memory */
1168  else
1169  {
1170  /* Configure DMA Stream source address */
1171  hdma->Instance->PAR = SrcAddress;
1172 
1173  /* Configure DMA Stream destination address */
1174  hdma->Instance->M0AR = DstAddress;
1175  }
1176 }
1177 
1184 static uint32_t DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma)
1185 {
1186  uint32_t stream_number = (((uint32_t)hdma->Instance & 0xFFU) - 16U) / 24U;
1187 
1188  /* lookup table for necessary bitshift of flags within status registers */
1189  static const uint8_t flagBitshiftOffset[8U] = {0U, 6U, 16U, 22U, 0U, 6U, 16U, 22U};
1190  hdma->StreamIndex = flagBitshiftOffset[stream_number];
1191 
1192  if (stream_number > 3U)
1193  {
1194  /* return pointer to HISR and HIFCR */
1195  hdma->StreamBaseAddress = (((uint32_t)hdma->Instance & (uint32_t)(~0x3FFU)) + 4U);
1196  }
1197  else
1198  {
1199  /* return pointer to LISR and LIFCR */
1200  hdma->StreamBaseAddress = ((uint32_t)hdma->Instance & (uint32_t)(~0x3FFU));
1201  }
1202 
1203  return hdma->StreamBaseAddress;
1204 }
1205 
1212 static HAL_StatusTypeDef DMA_CheckFifoParam(DMA_HandleTypeDef *hdma)
1213 {
1214  HAL_StatusTypeDef status = HAL_OK;
1215  uint32_t tmp = hdma->Init.FIFOThreshold;
1216 
1217  /* Memory Data size equal to Byte */
1219  {
1220  switch (tmp)
1221  {
1225  {
1226  status = HAL_ERROR;
1227  }
1228  break;
1230  if (hdma->Init.MemBurst == DMA_MBURST_INC16)
1231  {
1232  status = HAL_ERROR;
1233  }
1234  break;
1236  break;
1237  default:
1238  break;
1239  }
1240  }
1241 
1242  /* Memory Data size equal to Half-Word */
1243  else if (hdma->Init.MemDataAlignment == DMA_MDATAALIGN_HALFWORD)
1244  {
1245  switch (tmp)
1246  {
1249  status = HAL_ERROR;
1250  break;
1253  {
1254  status = HAL_ERROR;
1255  }
1256  break;
1258  if (hdma->Init.MemBurst == DMA_MBURST_INC16)
1259  {
1260  status = HAL_ERROR;
1261  }
1262  break;
1263  default:
1264  break;
1265  }
1266  }
1267 
1268  /* Memory Data size equal to Word */
1269  else
1270  {
1271  switch (tmp)
1272  {
1276  status = HAL_ERROR;
1277  break;
1280  {
1281  status = HAL_ERROR;
1282  }
1283  break;
1284  default:
1285  break;
1286  }
1287  }
1288 
1289  return status;
1290 }
1291 
1296 #endif /* HAL_DMA_MODULE_ENABLED */
1297 
1305 /************************ (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
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:52