stm32f7xx_hal_i2s.c
Go to the documentation of this file.
1 
176 /* Includes ------------------------------------------------------------------*/
177 #include "stm32f7xx_hal.h"
178 
179 #ifdef HAL_I2S_MODULE_ENABLED
180 
190 /* Private typedef -----------------------------------------------------------*/
191 /* Private define ------------------------------------------------------------*/
192 /* Private macro -------------------------------------------------------------*/
193 /* Private variables ---------------------------------------------------------*/
194 /* Private function prototypes -----------------------------------------------*/
198 static void I2S_DMATxCplt(DMA_HandleTypeDef *hdma);
199 static void I2S_DMATxHalfCplt(DMA_HandleTypeDef *hdma);
200 static void I2S_DMARxCplt(DMA_HandleTypeDef *hdma);
201 static void I2S_DMARxHalfCplt(DMA_HandleTypeDef *hdma);
202 static void I2S_DMAError(DMA_HandleTypeDef *hdma);
203 static void I2S_Transmit_IT(I2S_HandleTypeDef *hi2s);
204 static void I2S_Receive_IT(I2S_HandleTypeDef *hi2s);
205 static uint32_t I2S_GetClockFreq(I2S_HandleTypeDef *hi2s);
206 static HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag, FlagStatus State,
207  uint32_t Timeout);
212 /* Exported functions ---------------------------------------------------------*/
213 
254 {
255  uint32_t i2sdiv;
256  uint32_t i2sodd;
257  uint32_t packetlength;
258  uint32_t tmp;
259  uint32_t i2sclk;
260 
261  /* Check the I2S handle allocation */
262  if (hi2s == NULL)
263  {
264  return HAL_ERROR;
265  }
266 
267  /* Check the I2S parameters */
276 
277  if (hi2s->State == HAL_I2S_STATE_RESET)
278  {
279  /* Allocate lock resource and initialize it */
280  hi2s->Lock = HAL_UNLOCKED;
281 
282 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
283  /* Init the I2S Callback settings */
284  hi2s->TxCpltCallback = HAL_I2S_TxCpltCallback; /* Legacy weak TxCpltCallback */
285  hi2s->RxCpltCallback = HAL_I2S_RxCpltCallback; /* Legacy weak RxCpltCallback */
286  hi2s->TxHalfCpltCallback = HAL_I2S_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback */
287  hi2s->RxHalfCpltCallback = HAL_I2S_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback */
288  hi2s->ErrorCallback = HAL_I2S_ErrorCallback; /* Legacy weak ErrorCallback */
289 
290  if (hi2s->MspInitCallback == NULL)
291  {
292  hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit */
293  }
294 
295  /* Init the low level hardware : GPIO, CLOCK, NVIC... */
296  hi2s->MspInitCallback(hi2s);
297 #else
298  /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */
299  HAL_I2S_MspInit(hi2s);
300 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
301  }
302 
303  hi2s->State = HAL_I2S_STATE_BUSY;
304 
305  /*----------------------- SPIx I2SCFGR & I2SPR Configuration ----------------*/
306  /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */
310  hi2s->Instance->I2SPR = 0x0002U;
311 
312  /*----------------------- I2SPR: I2SDIV and ODD Calculation -----------------*/
313  /* If the requested audio frequency is not the default, compute the prescaler */
314  if (hi2s->Init.AudioFreq != I2S_AUDIOFREQ_DEFAULT)
315  {
316  /* Check the frame length (For the Prescaler computing) ********************/
317  if (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B)
318  {
319  /* Packet length is 16 bits */
320  packetlength = 16U;
321  }
322  else
323  {
324  /* Packet length is 32 bits */
325  packetlength = 32U;
326  }
327 
328  /* I2S standard */
329  if (hi2s->Init.Standard <= I2S_STANDARD_LSB)
330  {
331  /* In I2S standard packet lenght is multiplied by 2 */
332  packetlength = packetlength * 2U;
333  }
334 
335  /* If an external I2S clock has to be used, the specific define should be set
336  in the project configuration or in the stm32f3xx_conf.h file */
337  if (hi2s->Init.ClockSource == I2S_CLOCK_EXTERNAL)
338  {
339  /* Set the I2S clock to the external clock value */
340  i2sclk = EXTERNAL_CLOCK_VALUE;
341  }
342  else
343  {
344  /* Get the I2S source clock value */
345  i2sclk = I2S_GetClockFreq(hi2s);
346  }
347 
348  /* Compute the Real divider depending on the MCLK output state, with a floating point */
350  {
351  /* MCLK output is enabled */
352  if (hi2s->Init.DataFormat != I2S_DATAFORMAT_16B)
353  {
354  tmp = (uint32_t)(((((i2sclk / (packetlength * 4U)) * 10U) / hi2s->Init.AudioFreq)) + 5U);
355  }
356  else
357  {
358  tmp = (uint32_t)(((((i2sclk / (packetlength * 8U)) * 10U) / hi2s->Init.AudioFreq)) + 5U);
359  }
360  }
361  else
362  {
363  /* MCLK output is disabled */
364  tmp = (uint32_t)(((((i2sclk / packetlength) * 10U) / hi2s->Init.AudioFreq)) + 5U);
365  }
366 
367  /* Remove the flatting point */
368  tmp = tmp / 10U;
369 
370  /* Check the parity of the divider */
371  i2sodd = (uint32_t)(tmp & (uint32_t)1U);
372 
373  /* Compute the i2sdiv prescaler */
374  i2sdiv = (uint32_t)((tmp - i2sodd) / 2U);
375 
376  /* Get the Mask for the Odd bit (SPI_I2SPR[8]) register */
377  i2sodd = (uint32_t)(i2sodd << 8U);
378  }
379  else
380  {
381  /* Set the default values */
382  i2sdiv = 2U;
383  i2sodd = 0U;
384  }
385 
386  /* Test if the divider is 1 or 0 or greater than 0xFF */
387  if ((i2sdiv < 2U) || (i2sdiv > 0xFFU))
388  {
389  /* Set the error code and execute error callback*/
391  return HAL_ERROR;
392  }
393 
394  /*----------------------- SPIx I2SCFGR & I2SPR Configuration ----------------*/
395 
396  /* Write to SPIx I2SPR register the computed value */
397  hi2s->Instance->I2SPR = (uint32_t)((uint32_t)i2sdiv | (uint32_t)(i2sodd | (uint32_t)hi2s->Init.MCLKOutput));
398 
399  /* Clear I2SMOD, I2SE, I2SCFG, PCMSYNC, I2SSTD, CKPOL, DATLEN and CHLEN bits */
400  /* And configure the I2S with the I2S_InitStruct values */
405  (SPI_I2SCFGR_I2SMOD | hi2s->Init.Mode | \
406  hi2s->Init.Standard | hi2s->Init.DataFormat | \
407  hi2s->Init.CPOL));
408 
409 #if defined(SPI_I2SCFGR_ASTRTEN)
411  {
412  /* Write to SPIx I2SCFGR */
414  }
415 #endif
416 
418  hi2s->State = HAL_I2S_STATE_READY;
419 
420  return HAL_OK;
421 }
422 
430 {
431  /* Check the I2S handle allocation */
432  if (hi2s == NULL)
433  {
434  return HAL_ERROR;
435  }
436 
437  /* Check the parameters */
439 
440  hi2s->State = HAL_I2S_STATE_BUSY;
441 
442  /* Disable the I2S Peripheral Clock */
443  __HAL_I2S_DISABLE(hi2s);
444 
445 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
446  if (hi2s->MspDeInitCallback == NULL)
447  {
448  hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit */
449  }
450 
451  /* DeInit the low level hardware: GPIO, CLOCK, NVIC... */
452  hi2s->MspDeInitCallback(hi2s);
453 #else
454  /* DeInit the low level hardware: GPIO, CLOCK, NVIC... */
455  HAL_I2S_MspDeInit(hi2s);
456 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
457 
459  hi2s->State = HAL_I2S_STATE_RESET;
460 
461  /* Release Lock */
462  __HAL_UNLOCK(hi2s);
463 
464  return HAL_OK;
465 }
466 
473 __weak void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s)
474 {
475  /* Prevent unused argument(s) compilation warning */
476  UNUSED(hi2s);
477 
478  /* NOTE : This function Should not be modified, when the callback is needed,
479  the HAL_I2S_MspInit could be implemented in the user file
480  */
481 }
482 
489 __weak void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s)
490 {
491  /* Prevent unused argument(s) compilation warning */
492  UNUSED(hi2s);
493 
494  /* NOTE : This function Should not be modified, when the callback is needed,
495  the HAL_I2S_MspDeInit could be implemented in the user file
496  */
497 }
498 
499 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
500 
509 HAL_StatusTypeDef HAL_I2S_RegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef CallbackID, pI2S_CallbackTypeDef pCallback)
510 {
511  HAL_StatusTypeDef status = HAL_OK;
512 
513  if (pCallback == NULL)
514  {
515  /* Update the error code */
516  hi2s->ErrorCode |= HAL_I2S_ERROR_INVALID_CALLBACK;
517 
518  return HAL_ERROR;
519  }
520  /* Process locked */
521  __HAL_LOCK(hi2s);
522 
523  if (HAL_I2S_STATE_READY == hi2s->State)
524  {
525  switch (CallbackID)
526  {
527  case HAL_I2S_TX_COMPLETE_CB_ID :
528  hi2s->TxCpltCallback = pCallback;
529  break;
530 
531  case HAL_I2S_RX_COMPLETE_CB_ID :
532  hi2s->RxCpltCallback = pCallback;
533  break;
534 
535  case HAL_I2S_TX_HALF_COMPLETE_CB_ID :
536  hi2s->TxHalfCpltCallback = pCallback;
537  break;
538 
539  case HAL_I2S_RX_HALF_COMPLETE_CB_ID :
540  hi2s->RxHalfCpltCallback = pCallback;
541  break;
542 
543  case HAL_I2S_ERROR_CB_ID :
544  hi2s->ErrorCallback = pCallback;
545  break;
546 
547  case HAL_I2S_MSPINIT_CB_ID :
548  hi2s->MspInitCallback = pCallback;
549  break;
550 
551  case HAL_I2S_MSPDEINIT_CB_ID :
552  hi2s->MspDeInitCallback = pCallback;
553  break;
554 
555  default :
556  /* Update the error code */
557  SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK);
558 
559  /* Return error status */
560  status = HAL_ERROR;
561  break;
562  }
563  }
564  else if (HAL_I2S_STATE_RESET == hi2s->State)
565  {
566  switch (CallbackID)
567  {
568  case HAL_I2S_MSPINIT_CB_ID :
569  hi2s->MspInitCallback = pCallback;
570  break;
571 
572  case HAL_I2S_MSPDEINIT_CB_ID :
573  hi2s->MspDeInitCallback = pCallback;
574  break;
575 
576  default :
577  /* Update the error code */
578  SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK);
579 
580  /* Return error status */
581  status = HAL_ERROR;
582  break;
583  }
584  }
585  else
586  {
587  /* Update the error code */
588  SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK);
589 
590  /* Return error status */
591  status = HAL_ERROR;
592  }
593 
594  /* Release Lock */
595  __HAL_UNLOCK(hi2s);
596  return status;
597 }
598 
607 HAL_StatusTypeDef HAL_I2S_UnRegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef CallbackID)
608 {
609  HAL_StatusTypeDef status = HAL_OK;
610 
611  /* Process locked */
612  __HAL_LOCK(hi2s);
613 
614  if (HAL_I2S_STATE_READY == hi2s->State)
615  {
616  switch (CallbackID)
617  {
618  case HAL_I2S_TX_COMPLETE_CB_ID :
619  hi2s->TxCpltCallback = HAL_I2S_TxCpltCallback; /* Legacy weak TxCpltCallback */
620  break;
621 
622  case HAL_I2S_RX_COMPLETE_CB_ID :
623  hi2s->RxCpltCallback = HAL_I2S_RxCpltCallback; /* Legacy weak RxCpltCallback */
624  break;
625 
626  case HAL_I2S_TX_HALF_COMPLETE_CB_ID :
627  hi2s->TxHalfCpltCallback = HAL_I2S_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback */
628  break;
629 
630  case HAL_I2S_RX_HALF_COMPLETE_CB_ID :
631  hi2s->RxHalfCpltCallback = HAL_I2S_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback */
632  break;
633 
634  case HAL_I2S_ERROR_CB_ID :
635  hi2s->ErrorCallback = HAL_I2S_ErrorCallback; /* Legacy weak ErrorCallback */
636  break;
637 
638  case HAL_I2S_MSPINIT_CB_ID :
639  hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit */
640  break;
641 
642  case HAL_I2S_MSPDEINIT_CB_ID :
643  hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit */
644  break;
645 
646  default :
647  /* Update the error code */
648  SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK);
649 
650  /* Return error status */
651  status = HAL_ERROR;
652  break;
653  }
654  }
655  else if (HAL_I2S_STATE_RESET == hi2s->State)
656  {
657  switch (CallbackID)
658  {
659  case HAL_I2S_MSPINIT_CB_ID :
660  hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit */
661  break;
662 
663  case HAL_I2S_MSPDEINIT_CB_ID :
664  hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit */
665  break;
666 
667  default :
668  /* Update the error code */
669  SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK);
670 
671  /* Return error status */
672  status = HAL_ERROR;
673  break;
674  }
675  }
676  else
677  {
678  /* Update the error code */
679  SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK);
680 
681  /* Return error status */
682  status = HAL_ERROR;
683  }
684 
685  /* Release Lock */
686  __HAL_UNLOCK(hi2s);
687  return status;
688 }
689 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
690 
751 HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout)
752 {
753  uint32_t tmpreg_cfgr;
754 
755  if ((pData == NULL) || (Size == 0U))
756  {
757  return HAL_ERROR;
758  }
759 
760  /* Process Locked */
761  __HAL_LOCK(hi2s);
762 
763  if (hi2s->State != HAL_I2S_STATE_READY)
764  {
765  __HAL_UNLOCK(hi2s);
766  return HAL_BUSY;
767  }
768 
769  /* Set state and reset error code */
772  hi2s->pTxBuffPtr = pData;
773 
774  tmpreg_cfgr = hi2s->Instance->I2SCFGR & (SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN);
775 
776  if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
777  {
778  hi2s->TxXferSize = (Size << 1U);
779  hi2s->TxXferCount = (Size << 1U);
780  }
781  else
782  {
783  hi2s->TxXferSize = Size;
784  hi2s->TxXferCount = Size;
785  }
786 
787  tmpreg_cfgr = hi2s->Instance->I2SCFGR;
788 
789  /* Check if the I2S is already enabled */
791  {
792  /* Enable I2S peripheral */
793  __HAL_I2S_ENABLE(hi2s);
794  }
795 
796  /* Wait until TXE flag is set */
797  if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXE, SET, Timeout) != HAL_OK)
798  {
799  /* Set the error code */
801  hi2s->State = HAL_I2S_STATE_READY;
802  __HAL_UNLOCK(hi2s);
803  return HAL_ERROR;
804  }
805 
806  while (hi2s->TxXferCount > 0U)
807  {
808  hi2s->Instance->DR = (*hi2s->pTxBuffPtr);
809  hi2s->pTxBuffPtr++;
810  hi2s->TxXferCount--;
811 
812  /* Wait until TXE flag is set */
813  if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXE, SET, Timeout) != HAL_OK)
814  {
815  /* Set the error code */
817  hi2s->State = HAL_I2S_STATE_READY;
818  __HAL_UNLOCK(hi2s);
819  return HAL_ERROR;
820  }
821 
822  /* Check if an underrun occurs */
823  if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR) == SET)
824  {
825  /* Clear underrun flag */
827 
828  /* Set the error code */
830  }
831  }
832 
833  /* Check if Slave mode is selected */
834  if (((tmpreg_cfgr & SPI_I2SCFGR_I2SCFG) == I2S_MODE_SLAVE_TX) || ((tmpreg_cfgr & SPI_I2SCFGR_I2SCFG) == I2S_MODE_SLAVE_RX))
835  {
836  /* Wait until Busy flag is reset */
837  if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_BSY, RESET, Timeout) != HAL_OK)
838  {
839  /* Set the error code */
841  hi2s->State = HAL_I2S_STATE_READY;
842  __HAL_UNLOCK(hi2s);
843  return HAL_ERROR;
844  }
845  }
846 
847  hi2s->State = HAL_I2S_STATE_READY;
848  __HAL_UNLOCK(hi2s);
849  return HAL_OK;
850 }
851 
869 HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout)
870 {
871  uint32_t tmpreg_cfgr;
872 
873  if ((pData == NULL) || (Size == 0U))
874  {
875  return HAL_ERROR;
876  }
877 
878  /* Process Locked */
879  __HAL_LOCK(hi2s);
880 
881  if (hi2s->State != HAL_I2S_STATE_READY)
882  {
883  __HAL_UNLOCK(hi2s);
884  return HAL_BUSY;
885  }
886 
887  /* Set state and reset error code */
890  hi2s->pRxBuffPtr = pData;
891 
892  tmpreg_cfgr = hi2s->Instance->I2SCFGR & (SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN);
893 
894  if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
895  {
896  hi2s->RxXferSize = (Size << 1U);
897  hi2s->RxXferCount = (Size << 1U);
898  }
899  else
900  {
901  hi2s->RxXferSize = Size;
902  hi2s->RxXferCount = Size;
903  }
904 
905  /* Check if the I2S is already enabled */
907  {
908  /* Enable I2S peripheral */
909  __HAL_I2S_ENABLE(hi2s);
910  }
911 
912  /* Check if Master Receiver mode is selected */
914  {
915  /* Clear the Overrun Flag by a read operation on the SPI_DR register followed by a read
916  access to the SPI_SR register. */
918  }
919 
920  /* Receive data */
921  while (hi2s->RxXferCount > 0U)
922  {
923  /* Wait until RXNE flag is set */
924  if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_RXNE, SET, Timeout) != HAL_OK)
925  {
926  /* Set the error code */
928  hi2s->State = HAL_I2S_STATE_READY;
929  __HAL_UNLOCK(hi2s);
930  return HAL_ERROR;
931  }
932 
933  (*hi2s->pRxBuffPtr) = (uint16_t)hi2s->Instance->DR;
934  hi2s->pRxBuffPtr++;
935  hi2s->RxXferCount--;
936 
937  /* Check if an overrun occurs */
938  if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR) == SET)
939  {
940  /* Clear overrun flag */
942 
943  /* Set the error code */
945  }
946  }
947 
948  hi2s->State = HAL_I2S_STATE_READY;
949  __HAL_UNLOCK(hi2s);
950  return HAL_OK;
951 }
952 
967 HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
968 {
969  uint32_t tmpreg_cfgr;
970 
971  if ((pData == NULL) || (Size == 0U))
972  {
973  return HAL_ERROR;
974  }
975 
976  /* Process Locked */
977  __HAL_LOCK(hi2s);
978 
979  if (hi2s->State != HAL_I2S_STATE_READY)
980  {
981  __HAL_UNLOCK(hi2s);
982  return HAL_BUSY;
983  }
984 
985  /* Set state and reset error code */
988  hi2s->pTxBuffPtr = pData;
989 
990  tmpreg_cfgr = hi2s->Instance->I2SCFGR & (SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN);
991 
992  if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
993  {
994  hi2s->TxXferSize = (Size << 1U);
995  hi2s->TxXferCount = (Size << 1U);
996  }
997  else
998  {
999  hi2s->TxXferSize = Size;
1000  hi2s->TxXferCount = Size;
1001  }
1002 
1003  /* Enable TXE and ERR interrupt */
1005 
1006  /* Check if the I2S is already enabled */
1008  {
1009  /* Enable I2S peripheral */
1010  __HAL_I2S_ENABLE(hi2s);
1011  }
1012 
1013  __HAL_UNLOCK(hi2s);
1014  return HAL_OK;
1015 }
1016 
1033 HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
1034 {
1035  uint32_t tmpreg_cfgr;
1036 
1037  if ((pData == NULL) || (Size == 0U))
1038  {
1039  return HAL_ERROR;
1040  }
1041 
1042  /* Process Locked */
1043  __HAL_LOCK(hi2s);
1044 
1045  if (hi2s->State != HAL_I2S_STATE_READY)
1046  {
1047  __HAL_UNLOCK(hi2s);
1048  return HAL_BUSY;
1049  }
1050 
1051  /* Set state and reset error code */
1052  hi2s->State = HAL_I2S_STATE_BUSY_RX;
1053  hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
1054  hi2s->pRxBuffPtr = pData;
1055 
1056  tmpreg_cfgr = hi2s->Instance->I2SCFGR & (SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN);
1057 
1058  if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
1059  {
1060  hi2s->RxXferSize = (Size << 1U);
1061  hi2s->RxXferCount = (Size << 1U);
1062  }
1063  else
1064  {
1065  hi2s->RxXferSize = Size;
1066  hi2s->RxXferCount = Size;
1067  }
1068 
1069  /* Enable RXNE and ERR interrupt */
1071 
1072  /* Check if the I2S is already enabled */
1074  {
1075  /* Enable I2S peripheral */
1076  __HAL_I2S_ENABLE(hi2s);
1077  }
1078 
1079  __HAL_UNLOCK(hi2s);
1080  return HAL_OK;
1081 }
1082 
1097 HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
1098 {
1099  uint32_t tmpreg_cfgr;
1100 
1101  if ((pData == NULL) || (Size == 0U))
1102  {
1103  return HAL_ERROR;
1104  }
1105 
1106  /* Process Locked */
1107  __HAL_LOCK(hi2s);
1108 
1109  if (hi2s->State != HAL_I2S_STATE_READY)
1110  {
1111  __HAL_UNLOCK(hi2s);
1112  return HAL_BUSY;
1113  }
1114 
1115  /* Set state and reset error code */
1116  hi2s->State = HAL_I2S_STATE_BUSY_TX;
1117  hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
1118  hi2s->pTxBuffPtr = pData;
1119 
1120  tmpreg_cfgr = hi2s->Instance->I2SCFGR & (SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN);
1121 
1122  if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
1123  {
1124  hi2s->TxXferSize = (Size << 1U);
1125  hi2s->TxXferCount = (Size << 1U);
1126  }
1127  else
1128  {
1129  hi2s->TxXferSize = Size;
1130  hi2s->TxXferCount = Size;
1131  }
1132 
1133  /* Set the I2S Tx DMA Half transfer complete callback */
1134  hi2s->hdmatx->XferHalfCpltCallback = I2S_DMATxHalfCplt;
1135 
1136  /* Set the I2S Tx DMA transfer complete callback */
1137  hi2s->hdmatx->XferCpltCallback = I2S_DMATxCplt;
1138 
1139  /* Set the DMA error callback */
1140  hi2s->hdmatx->XferErrorCallback = I2S_DMAError;
1141 
1142  /* Enable the Tx DMA Stream/Channel */
1143  if (HAL_OK != HAL_DMA_Start_IT(hi2s->hdmatx, (uint32_t)hi2s->pTxBuffPtr, (uint32_t)&hi2s->Instance->DR, hi2s->TxXferSize))
1144  {
1145  /* Update SPI error code */
1147  hi2s->State = HAL_I2S_STATE_READY;
1148 
1149  __HAL_UNLOCK(hi2s);
1150  return HAL_ERROR;
1151  }
1152 
1153  /* Check if the I2S is already enabled */
1155  {
1156  /* Enable I2S peripheral */
1157  __HAL_I2S_ENABLE(hi2s);
1158  }
1159 
1160  /* Check if the I2S Tx request is already enabled */
1162  {
1163  /* Enable Tx DMA Request */
1165  }
1166 
1167  __HAL_UNLOCK(hi2s);
1168  return HAL_OK;
1169 }
1170 
1185 HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
1186 {
1187  uint32_t tmpreg_cfgr;
1188 
1189  if ((pData == NULL) || (Size == 0U))
1190  {
1191  return HAL_ERROR;
1192  }
1193 
1194  /* Process Locked */
1195  __HAL_LOCK(hi2s);
1196 
1197  if (hi2s->State != HAL_I2S_STATE_READY)
1198  {
1199  __HAL_UNLOCK(hi2s);
1200  return HAL_BUSY;
1201  }
1202 
1203  /* Set state and reset error code */
1204  hi2s->State = HAL_I2S_STATE_BUSY_RX;
1205  hi2s->ErrorCode = HAL_I2S_ERROR_NONE;
1206  hi2s->pRxBuffPtr = pData;
1207 
1208  tmpreg_cfgr = hi2s->Instance->I2SCFGR & (SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN);
1209 
1210  if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
1211  {
1212  hi2s->RxXferSize = (Size << 1U);
1213  hi2s->RxXferCount = (Size << 1U);
1214  }
1215  else
1216  {
1217  hi2s->RxXferSize = Size;
1218  hi2s->RxXferCount = Size;
1219  }
1220 
1221  /* Set the I2S Rx DMA Half transfer complete callback */
1222  hi2s->hdmarx->XferHalfCpltCallback = I2S_DMARxHalfCplt;
1223 
1224  /* Set the I2S Rx DMA transfer complete callback */
1225  hi2s->hdmarx->XferCpltCallback = I2S_DMARxCplt;
1226 
1227  /* Set the DMA error callback */
1228  hi2s->hdmarx->XferErrorCallback = I2S_DMAError;
1229 
1230  /* Check if Master Receiver mode is selected */
1232  {
1233  /* Clear the Overrun Flag by a read operation to the SPI_DR register followed by a read
1234  access to the SPI_SR register. */
1236  }
1237 
1238  /* Enable the Rx DMA Stream/Channel */
1239  if (HAL_OK != HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->DR, (uint32_t)hi2s->pRxBuffPtr, hi2s->RxXferSize))
1240  {
1241  /* Update SPI error code */
1243  hi2s->State = HAL_I2S_STATE_READY;
1244 
1245  __HAL_UNLOCK(hi2s);
1246  return HAL_ERROR;
1247  }
1248 
1249  /* Check if the I2S is already enabled */
1251  {
1252  /* Enable I2S peripheral */
1253  __HAL_I2S_ENABLE(hi2s);
1254  }
1255 
1256  /* Check if the I2S Rx request is already enabled */
1258  {
1259  /* Enable Rx DMA Request */
1261  }
1262 
1263  __HAL_UNLOCK(hi2s);
1264  return HAL_OK;
1265 }
1266 
1274 {
1275  /* Process Locked */
1276  __HAL_LOCK(hi2s);
1277 
1278  if (hi2s->State == HAL_I2S_STATE_BUSY_TX)
1279  {
1280  /* Disable the I2S DMA Tx request */
1282  }
1283  else if (hi2s->State == HAL_I2S_STATE_BUSY_RX)
1284  {
1285  /* Disable the I2S DMA Rx request */
1287  }
1288  else
1289  {
1290  /* nothing to do */
1291  }
1292 
1293  /* Process Unlocked */
1294  __HAL_UNLOCK(hi2s);
1295 
1296  return HAL_OK;
1297 }
1298 
1306 {
1307  /* Process Locked */
1308  __HAL_LOCK(hi2s);
1309 
1310  if (hi2s->State == HAL_I2S_STATE_BUSY_TX)
1311  {
1312  /* Enable the I2S DMA Tx request */
1314  }
1315  else if (hi2s->State == HAL_I2S_STATE_BUSY_RX)
1316  {
1317  /* Enable the I2S DMA Rx request */
1319  }
1320  else
1321  {
1322  /* nothing to do */
1323  }
1324 
1325  /* If the I2S peripheral is still not enabled, enable it */
1327  {
1328  /* Enable I2S peripheral */
1329  __HAL_I2S_ENABLE(hi2s);
1330  }
1331 
1332  /* Process Unlocked */
1333  __HAL_UNLOCK(hi2s);
1334 
1335  return HAL_OK;
1336 }
1337 
1345 {
1346  HAL_StatusTypeDef errorcode = HAL_OK;
1347  /* The Lock is not implemented on this API to allow the user application
1348  to call the HAL SPI API under callbacks HAL_I2S_TxCpltCallback() or HAL_I2S_RxCpltCallback()
1349  when calling HAL_DMA_Abort() API the DMA TX or RX Transfer complete interrupt is generated
1350  and the correspond call back is executed HAL_I2S_TxCpltCallback() or HAL_I2S_RxCpltCallback()
1351  */
1352 
1353  /* Disable the I2S Tx/Rx DMA requests */
1356 
1357  /* Abort the I2S DMA tx Stream/Channel */
1358  if (hi2s->hdmatx != NULL)
1359  {
1360  /* Disable the I2S DMA tx Stream/Channel */
1361  if (HAL_OK != HAL_DMA_Abort(hi2s->hdmatx))
1362  {
1364  errorcode = HAL_ERROR;
1365  }
1366  }
1367 
1368  /* Abort the I2S DMA rx Stream/Channel */
1369  if (hi2s->hdmarx != NULL)
1370  {
1371  /* Disable the I2S DMA rx Stream/Channel */
1372  if (HAL_OK != HAL_DMA_Abort(hi2s->hdmarx))
1373  {
1375  errorcode = HAL_ERROR;
1376  }
1377  }
1378 
1379  /* Disable I2S peripheral */
1380  __HAL_I2S_DISABLE(hi2s);
1381 
1382  hi2s->State = HAL_I2S_STATE_READY;
1383 
1384  return errorcode;
1385 }
1386 
1394 {
1395  uint32_t itsource = hi2s->Instance->CR2;
1396  uint32_t itflag = hi2s->Instance->SR;
1397 
1398  /* I2S in mode Receiver ------------------------------------------------*/
1399  if ((I2S_CHECK_FLAG(itflag, I2S_FLAG_OVR) == RESET) &&
1400  (I2S_CHECK_FLAG(itflag, I2S_FLAG_RXNE) != RESET) && (I2S_CHECK_IT_SOURCE(itsource, I2S_IT_RXNE) != RESET))
1401  {
1402  I2S_Receive_IT(hi2s);
1403  return;
1404  }
1405 
1406  /* I2S in mode Tramitter -----------------------------------------------*/
1407  if ((I2S_CHECK_FLAG(itflag, I2S_FLAG_TXE) != RESET) && (I2S_CHECK_IT_SOURCE(itsource, I2S_IT_TXE) != RESET))
1408  {
1409  I2S_Transmit_IT(hi2s);
1410  return;
1411  }
1412 
1413  /* I2S interrupt error -------------------------------------------------*/
1414  if (I2S_CHECK_IT_SOURCE(itsource, I2S_IT_ERR) != RESET)
1415  {
1416  /* I2S Overrun error interrupt occurred ---------------------------------*/
1417  if (I2S_CHECK_FLAG(itflag, I2S_FLAG_OVR) != RESET)
1418  {
1419  /* Disable RXNE and ERR interrupt */
1421 
1422  /* Set the error code and execute error callback*/
1424  }
1425 
1426  /* I2S Underrun error interrupt occurred --------------------------------*/
1427  if (I2S_CHECK_FLAG(itflag, I2S_FLAG_UDR) != RESET)
1428  {
1429  /* Disable TXE and ERR interrupt */
1431 
1432  /* Set the error code and execute error callback*/
1434  }
1435 
1436  /* Set the I2S State ready */
1437  hi2s->State = HAL_I2S_STATE_READY;
1438 
1439  /* Call user error callback */
1440 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1441  hi2s->ErrorCallback(hi2s);
1442 #else
1443  HAL_I2S_ErrorCallback(hi2s);
1444 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1445  }
1446 }
1447 
1455 {
1456  /* Prevent unused argument(s) compilation warning */
1457  UNUSED(hi2s);
1458 
1459  /* NOTE : This function Should not be modified, when the callback is needed,
1460  the HAL_I2S_TxHalfCpltCallback could be implemented in the user file
1461  */
1462 }
1463 
1470 __weak void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s)
1471 {
1472  /* Prevent unused argument(s) compilation warning */
1473  UNUSED(hi2s);
1474 
1475  /* NOTE : This function Should not be modified, when the callback is needed,
1476  the HAL_I2S_TxCpltCallback could be implemented in the user file
1477  */
1478 }
1479 
1487 {
1488  /* Prevent unused argument(s) compilation warning */
1489  UNUSED(hi2s);
1490 
1491  /* NOTE : This function Should not be modified, when the callback is needed,
1492  the HAL_I2S_RxHalfCpltCallback could be implemented in the user file
1493  */
1494 }
1495 
1502 __weak void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s)
1503 {
1504  /* Prevent unused argument(s) compilation warning */
1505  UNUSED(hi2s);
1506 
1507  /* NOTE : This function Should not be modified, when the callback is needed,
1508  the HAL_I2S_RxCpltCallback could be implemented in the user file
1509  */
1510 }
1511 
1518 __weak void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s)
1519 {
1520  /* Prevent unused argument(s) compilation warning */
1521  UNUSED(hi2s);
1522 
1523  /* NOTE : This function Should not be modified, when the callback is needed,
1524  the HAL_I2S_ErrorCallback could be implemented in the user file
1525  */
1526 }
1527 
1554 {
1555  return hi2s->State;
1556 }
1557 
1564 uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s)
1565 {
1566  return hi2s->ErrorCode;
1567 }
1585 static uint32_t I2S_GetClockFreq(I2S_HandleTypeDef *hi2s)
1586 {
1587  uint32_t tmpreg;
1588  /* This variable used to store the VCO Input (value in Hz) */
1589  uint32_t vcoinput;
1590  /* This variable used to store the I2S_CK_x (value in Hz) */
1591  uint32_t i2sclocksource;
1592 
1593  /* Configure I2S Clock based on I2S source clock selection */
1594 
1595  /* I2S_CLK_x : I2S Block Clock configuration for different clock sources selected */
1596  switch (hi2s->Init.ClockSource)
1597  {
1598  case I2S_CLOCK_PLL :
1599  {
1600  /* Configure the PLLI2S division factor */
1601  /* PLLI2S_VCO Input = PLL_SOURCE/PLLI2SM */
1602  if ((RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) == RCC_PLLSOURCE_HSI)
1603  {
1604  /* In Case the PLL Source is HSI (Internal Clock) */
1605  vcoinput = (HSI_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM));
1606  }
1607  else
1608  {
1609  /* In Case the PLL Source is HSE (External Clock) */
1610  vcoinput = ((HSE_VALUE / (uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLM)));
1611  }
1612 
1613  /* PLLI2S_VCO Output = PLLI2S_VCO Input * PLLI2SN */
1614  /* I2S_CLK(first level) = PLLI2S_VCO Output/PLLI2SR */
1615  tmpreg = (RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SR) >> 28U;
1616  i2sclocksource = (vcoinput * ((RCC->PLLI2SCFGR & RCC_PLLI2SCFGR_PLLI2SN) >> 6U)) / (tmpreg);
1617 
1618  break;
1619  }
1620  case I2S_CLOCK_EXTERNAL :
1621  {
1622  i2sclocksource = EXTERNAL_CLOCK_VALUE;
1623  break;
1624  }
1625  default :
1626  {
1627  i2sclocksource = 0U;
1628  break;
1629  }
1630  }
1631 
1632  /* the return result is the value of I2S clock */
1633  return i2sclocksource;
1634 }
1635 
1642 static void I2S_DMATxCplt(DMA_HandleTypeDef *hdma)
1643 {
1644  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; /* Derogation MISRAC2012-Rule-11.5 */
1645 
1646  /* if DMA is configured in DMA_NORMAL Mode */
1647  if (hdma->Init.Mode == DMA_NORMAL)
1648  {
1649  /* Disable Tx DMA Request */
1651 
1652  hi2s->TxXferCount = 0U;
1653  hi2s->State = HAL_I2S_STATE_READY;
1654  }
1655  /* Call user Tx complete callback */
1656 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1657  hi2s->TxCpltCallback(hi2s);
1658 #else
1659  HAL_I2S_TxCpltCallback(hi2s);
1660 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1661 }
1662 
1669 static void I2S_DMATxHalfCplt(DMA_HandleTypeDef *hdma)
1670 {
1671  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; /* Derogation MISRAC2012-Rule-11.5 */
1672 
1673  /* Call user Tx half complete callback */
1674 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1675  hi2s->TxHalfCpltCallback(hi2s);
1676 #else
1678 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1679 }
1680 
1687 static void I2S_DMARxCplt(DMA_HandleTypeDef *hdma)
1688 {
1689  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; /* Derogation MISRAC2012-Rule-11.5 */
1690 
1691  /* if DMA is configured in DMA_NORMAL Mode */
1692  if (hdma->Init.Mode == DMA_NORMAL)
1693  {
1694  /* Disable Rx DMA Request */
1696  hi2s->RxXferCount = 0U;
1697  hi2s->State = HAL_I2S_STATE_READY;
1698  }
1699  /* Call user Rx complete callback */
1700 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1701  hi2s->RxCpltCallback(hi2s);
1702 #else
1703  HAL_I2S_RxCpltCallback(hi2s);
1704 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1705 }
1706 
1713 static void I2S_DMARxHalfCplt(DMA_HandleTypeDef *hdma)
1714 {
1715  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; /* Derogation MISRAC2012-Rule-11.5 */
1716 
1717  /* Call user Rx half complete callback */
1718 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1719  hi2s->RxHalfCpltCallback(hi2s);
1720 #else
1722 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1723 }
1724 
1731 static void I2S_DMAError(DMA_HandleTypeDef *hdma)
1732 {
1733  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; /* Derogation MISRAC2012-Rule-11.5 */
1734 
1735  /* Disable Rx and Tx DMA Request */
1737  hi2s->TxXferCount = 0U;
1738  hi2s->RxXferCount = 0U;
1739 
1740  hi2s->State = HAL_I2S_STATE_READY;
1741 
1742  /* Set the error code and execute error callback*/
1744  /* Call user error callback */
1745 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1746  hi2s->ErrorCallback(hi2s);
1747 #else
1748  HAL_I2S_ErrorCallback(hi2s);
1749 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1750 }
1751 
1758 static void I2S_Transmit_IT(I2S_HandleTypeDef *hi2s)
1759 {
1760  /* Transmit data */
1761  hi2s->Instance->DR = (*hi2s->pTxBuffPtr);
1762  hi2s->pTxBuffPtr++;
1763  hi2s->TxXferCount--;
1764 
1765  if (hi2s->TxXferCount == 0U)
1766  {
1767  /* Disable TXE and ERR interrupt */
1769 
1770  hi2s->State = HAL_I2S_STATE_READY;
1771  /* Call user Tx complete callback */
1772 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1773  hi2s->TxCpltCallback(hi2s);
1774 #else
1775  HAL_I2S_TxCpltCallback(hi2s);
1776 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1777  }
1778 }
1779 
1786 static void I2S_Receive_IT(I2S_HandleTypeDef *hi2s)
1787 {
1788  /* Receive data */
1789  (*hi2s->pRxBuffPtr) = (uint16_t)hi2s->Instance->DR;
1790  hi2s->pRxBuffPtr++;
1791  hi2s->RxXferCount--;
1792 
1793  if (hi2s->RxXferCount == 0U)
1794  {
1795  /* Disable RXNE and ERR interrupt */
1797 
1798  hi2s->State = HAL_I2S_STATE_READY;
1799  /* Call user Rx complete callback */
1800 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1801  hi2s->RxCpltCallback(hi2s);
1802 #else
1803  HAL_I2S_RxCpltCallback(hi2s);
1804 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1805  }
1806 }
1807 
1817 static HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag, FlagStatus State, uint32_t Timeout)
1818 {
1819  uint32_t tickstart;
1820 
1821  /* Get tick */
1822  tickstart = HAL_GetTick();
1823 
1824  /* Wait until flag is set to status*/
1825  while (((__HAL_I2S_GET_FLAG(hi2s, Flag)) ? SET : RESET) != State)
1826  {
1827  if (Timeout != HAL_MAX_DELAY)
1828  {
1829  if (((HAL_GetTick() - tickstart) >= Timeout) || (Timeout == 0U))
1830  {
1831  /* Set the I2S State ready */
1832  hi2s->State = HAL_I2S_STATE_READY;
1833 
1834  /* Process Unlocked */
1835  __HAL_UNLOCK(hi2s);
1836 
1837  return HAL_TIMEOUT;
1838  }
1839  }
1840  }
1841  return HAL_OK;
1842 }
1843 
1856 #endif /* HAL_I2S_MODULE_ENABLED */
1857 
1858 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
__HAL_I2S_DISABLE_IT
#define __HAL_I2S_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the specified I2S interrupts.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:376
HAL_I2S_ERROR_TIMEOUT
#define HAL_I2S_ERROR_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:176
assert_param
#define assert_param(expr)
Include module's header file.
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:353
SPI_I2SCFGR_CHLEN
#define SPI_I2SCFGR_CHLEN
Definition: stm32f407xx.h:11563
I2S_STANDARD_LSB
#define I2S_STANDARD_LSB
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:205
RCC_PLLI2SCFGR_PLLI2SN
#define RCC_PLLI2SCFGR_PLLI2SN
Definition: stm32f407xx.h:10348
HAL_I2S_MspDeInit
void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s)
SPI_TypeDef::DR
__IO uint32_t DR
Definition: stm32f407xx.h:716
__HAL_I2S_CLEAR_OVRFLAG
#define __HAL_I2S_CLEAR_OVRFLAG(__HANDLE__)
Clears the I2S OVR pending flag.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:410
HAL_I2S_TxHalfCpltCallback
void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s)
Tx Half Transfer completed callbacks.
Definition: stm32f4_discovery_audio.c:469
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
SPI_I2SCFGR_I2SE
#define SPI_I2SCFGR_I2SE
Definition: stm32f407xx.h:11593
RCC_PLLSOURCE_HSI
#define RCC_PLLSOURCE_HSI
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h:181
__HAL_I2S_ENABLE
#define __HAL_I2S_ENABLE(__HANDLE__)
Enable the specified SPI peripheral (in I2S mode).
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:348
HAL_IS_BIT_CLR
#define HAL_IS_BIT_CLR(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:64
SPI_I2SCFGR_ASTRTEN
#define SPI_I2SCFGR_ASTRTEN
Definition: stm32f469xx.h:16112
__DMA_HandleTypeDef::XferHalfCpltCallback
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:153
SPI_CR2_RXDMAEN
#define SPI_CR2_RXDMAEN
Definition: stm32f407xx.h:11491
I2S_DATAFORMAT_32B
#define I2S_DATAFORMAT_32B
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:218
__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
SPI_I2SCFGR_CKPOL
#define SPI_I2SCFGR_CKPOL
Definition: stm32f407xx.h:11573
__HAL_I2S_GET_FLAG
#define __HAL_I2S_GET_FLAG(__HANDLE__, __FLAG__)
Checks whether the specified I2S flag is set or not.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:404
I2S_InitTypeDef::CPOL
uint32_t CPOL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:64
I2S_HandleTypeDef::pRxBuffPtr
uint16_t * pRxBuffPtr
Definition: stm32f7xx_hal_i2s.h:104
HAL_I2S_Receive
HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout)
HAL_UNLOCKED
@ HAL_UNLOCKED
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:53
HAL_I2S_TxCpltCallback
void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s)
Tx Transfer completed callbacks.
Definition: stm32f4_discovery_audio.c:456
I2S_InitTypeDef::MCLKOutput
uint32_t MCLKOutput
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:58
HAL_I2S_STATE_BUSY_TX
@ HAL_I2S_STATE_BUSY_TX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:81
I2S_MODE_SLAVE_TX
#define I2S_MODE_SLAVE_TX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:192
IS_I2S_ALL_INSTANCE
#define IS_I2S_ALL_INSTANCE(INSTANCE)
Definition: stm32f407xx.h:15138
HAL_I2S_RxCpltCallback
void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s)
Rx Transfer completed callbacks.
Definition: stm32f4_discovery_audio.c:844
SPI_TypeDef::I2SPR
__IO uint32_t I2SPR
Definition: stm32f407xx.h:721
I2S_HandleTypeDef
I2S handle Structure definition.
Definition: stm32f7xx_hal_i2s.h:91
I2S_InitTypeDef::Standard
uint32_t Standard
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:52
I2S_HandleTypeDef::hdmatx
DMA_HandleTypeDef * hdmatx
Definition: stm32f7xx_hal_i2s.h:114
I2S_CHECK_FLAG
#define I2S_CHECK_FLAG(__SR__, __FLAG__)
Check whether the specified SPI flag is set or not.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:530
I2S_IT_RXNE
#define I2S_IT_RXNE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:271
__DMA_HandleTypeDef::Init
DMA_InitTypeDef Init
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:143
HAL_I2S_STATE_BUSY
@ HAL_I2S_STATE_BUSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:80
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
IS_I2S_AUDIO_FREQ
#define IS_I2S_AUDIO_FREQ(__FREQ__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:569
CLEAR_BIT
#define CLEAR_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:214
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
IS_I2S_STANDARD
#define IS_I2S_STANDARD(__STANDARD__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:555
SPI_TypeDef::CR2
__IO uint32_t CR2
Definition: stm32f407xx.h:714
I2S_IT_ERR
#define I2S_IT_ERR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:272
I2S_HandleTypeDef::TxXferSize
__IO uint16_t TxXferSize
Definition: stm32f7xx_hal_i2s.h:100
HAL_I2S_Transmit
HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout)
HAL_I2S_DMAPause
HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s)
I2S_HandleTypeDef::ErrorCode
__IO uint32_t ErrorCode
Definition: stm32f7xx_hal_i2s.h:122
I2S_HandleTypeDef::pTxBuffPtr
uint16_t * pTxBuffPtr
Definition: stm32f7xx_hal_i2s.h:98
HAL_I2S_GetError
uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s)
I2S_FLAG_BSY
#define I2S_FLAG_BSY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:288
RCC_PLLCFGR_PLLSRC
#define RCC_PLLCFGR_PLLSRC
Definition: stm32f407xx.h:9516
I2S_HandleTypeDef::Instance
SPI_TypeDef * Instance
Definition: stm32f7xx_hal_i2s.h:94
HAL_I2S_STATE_BUSY_RX
@ HAL_I2S_STATE_BUSY_RX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:82
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
I2S_STANDARD_PCM_SHORT
#define I2S_STANDARD_PCM_SHORT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:206
HAL_I2S_Receive_DMA
HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
HAL_I2S_ERROR_DMA
#define HAL_I2S_ERROR_DMA
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:179
HAL_I2S_RxHalfCpltCallback
void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s)
Rx Half Transfer completed callbacks.
Definition: stm32f4_discovery_audio.c:854
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
RCC_PLLCFGR_PLLM
#define RCC_PLLCFGR_PLLM
Definition: stm32f407xx.h:9487
HAL_I2S_DMAResume
HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s)
HAL_I2S_GetState
HAL_I2S_StateTypeDef HAL_I2S_GetState(I2S_HandleTypeDef *hi2s)
HAL_I2S_STATE_READY
@ HAL_I2S_STATE_READY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:79
HSI_VALUE
#define HSI_VALUE
Internal High Speed oscillator (HSI) value. This value is used by the RCC HAL module to compute the s...
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:82
I2S_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:49
HAL_I2S_Transmit_IT
HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
HAL_I2S_Init
HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s)
__HAL_LOCK
#define __HAL_LOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:93
IS_I2S_DATA_FORMAT
#define IS_I2S_DATA_FORMAT(__FORMAT__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:561
I2S_IT_TXE
#define I2S_IT_TXE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:270
MODIFY_REG
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:224
HAL_I2S_ERROR_NONE
#define HAL_I2S_ERROR_NONE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:175
RESET
@ RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:187
EXTERNAL_CLOCK_VALUE
#define EXTERNAL_CLOCK_VALUE
External clock source for I2S peripheral This value is used by the I2S HAL module to compute the I2S ...
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:110
HAL_I2S_ErrorCallback
void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s)
I2S error callbacks.
Definition: stm32f4_discovery_audio.c:1110
HAL_I2S_IRQHandler
void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s)
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)
SPI_I2SCFGR_DATLEN
#define SPI_I2SCFGR_DATLEN
Definition: stm32f407xx.h:11567
I2S_MCLKOUTPUT_ENABLE
#define I2S_MCLKOUTPUT_ENABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:226
I2S_HandleTypeDef::RxXferSize
__IO uint16_t RxXferSize
Definition: stm32f7xx_hal_i2s.h:106
__HAL_I2S_CLEAR_UDRFLAG
#define __HAL_I2S_CLEAR_UDRFLAG(__HANDLE__)
Clears the I2S UDR pending flag.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:420
__HAL_UNLOCK
#define __HAL_UNLOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:105
HAL_I2S_ERROR_UDR
#define HAL_I2S_ERROR_UDR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:178
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:61
SPI_TypeDef::I2SCFGR
__IO uint32_t I2SCFGR
Definition: stm32f407xx.h:720
HAL_DMA_Abort
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
I2S_FLAG_OVR
#define I2S_FLAG_OVR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:284
IS_I2S_MCLK_OUTPUT
#define IS_I2S_MCLK_OUTPUT(__OUTPUT__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:566
IS_I2S_CPOL
#define IS_I2S_CPOL(__CPOL__)
Checks if I2S Serial clock steady state parameter is in allowed range.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:581
SPI_I2SCFGR_I2SMOD
#define SPI_I2SCFGR_I2SMOD
Definition: stm32f407xx.h:11596
RCC
#define RCC
Definition: stm32f407xx.h:1113
I2S_FLAG_TXE
#define I2S_FLAG_TXE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:280
I2S_HandleTypeDef::State
__IO HAL_I2S_StateTypeDef State
Definition: stm32f7xx_hal_i2s.h:120
I2S_HandleTypeDef::hdmarx
DMA_HandleTypeDef * hdmarx
Definition: stm32f7xx_hal_i2s.h:116
I2S_DATAFORMAT_24B
#define I2S_DATAFORMAT_24B
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:217
HAL_TIMEOUT
@ HAL_TIMEOUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:45
__I2C_HandleTypeDef::State
__IO HAL_I2C_StateTypeDef State
Definition: stm32f7xx_hal_i2c.h:211
I2S_HandleTypeDef::Init
I2S_InitTypeDef Init
Definition: stm32f7xx_hal_i2s.h:96
I2S_InitTypeDef::DataFormat
uint32_t DataFormat
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:55
DMA_NORMAL
#define DMA_NORMAL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:281
I2S_FLAG_RXNE
#define I2S_FLAG_RXNE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:281
RCC_PLLI2SCFGR_PLLI2SR
#define RCC_PLLI2SCFGR_PLLI2SR
Definition: stm32f407xx.h:10361
SPI_I2SCFGR_PCMSYNC
#define SPI_I2SCFGR_PCMSYNC
Definition: stm32f407xx.h:11583
__DMA_HandleTypeDef::XferCpltCallback
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:151
__HAL_I2S_ENABLE_IT
#define __HAL_I2S_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the specified I2S interrupts.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:365
I2S_HandleTypeDef::RxXferCount
__IO uint16_t RxXferCount
Definition: stm32f7xx_hal_i2s.h:108
HAL_I2S_ERROR_PRESCALER
#define HAL_I2S_ERROR_PRESCALER
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:180
SET
@ SET
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:188
HAL_I2S_STATE_RESET
@ HAL_I2S_STATE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:78
FlagStatus
FlagStatus
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:185
SPI_CR2_TXDMAEN
#define SPI_CR2_TXDMAEN
Definition: stm32f407xx.h:11494
I2S_HandleTypeDef::TxXferCount
__IO uint16_t TxXferCount
Definition: stm32f7xx_hal_i2s.h:102
HAL_I2S_DMAStop
HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s)
I2S_CLOCK_PLL
#define I2S_CLOCK_PLL
Definition: stm32f7xx_hal_i2s.h:284
HSE_VALUE
#define HSE_VALUE
Adjust the value of External High Speed oscillator (HSE) used in your application....
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:69
IS_I2S_CLOCKSOURCE
#define IS_I2S_CLOCKSOURCE(CLOCK)
Definition: stm32f7xx_hal_i2s.h:540
I2S_AUDIOFREQ_DEFAULT
#define I2S_AUDIOFREQ_DEFAULT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:244
HAL_I2S_StateTypeDef
HAL_I2S_StateTypeDef
HAL State structures definition.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:76
HAL_I2S_MspInit
void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s)
I2S_InitTypeDef::ClockSource
uint32_t ClockSource
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:67
SPI_I2SCFGR_I2SCFG
#define SPI_I2SCFGR_I2SCFG
Definition: stm32f407xx.h:11587
DMA_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:70
I2S_MODE_SLAVE_RX
#define I2S_MODE_SLAVE_RX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:193
SPI_TypeDef::SR
__IO uint32_t SR
Definition: stm32f407xx.h:715
SET_BIT
#define SET_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:212
HAL_I2S_ERROR_OVR
#define HAL_I2S_ERROR_OVR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:177
__HAL_I2S_DISABLE
#define __HAL_I2S_DISABLE(__HANDLE__)
Disable the specified SPI peripheral (in I2S mode).
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:354
HAL_I2S_DeInit
HAL_StatusTypeDef HAL_I2S_DeInit(I2S_HandleTypeDef *hi2s)
I2S_HandleTypeDef::Lock
__IO HAL_LockTypeDef Lock
Definition: stm32f7xx_hal_i2s.h:118
I2S_DATAFORMAT_16B
#define I2S_DATAFORMAT_16B
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:215
I2S_STANDARD_PCM_LONG
#define I2S_STANDARD_PCM_LONG
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:207
HAL_I2S_Transmit_DMA
HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
I2S_CLOCK_EXTERNAL
#define I2S_CLOCK_EXTERNAL
Definition: stm32f7xx_hal_i2s.h:283
stm32f7xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
IS_I2S_MODE
#define IS_I2S_MODE(__MODE__)
Checks if I2S Mode parameter is in allowed range.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:550
I2S_CHECK_IT_SOURCE
#define I2S_CHECK_IT_SOURCE(__CR2__, __INTERRUPT__)
Check whether the specified SPI Interrupt is set or not.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:542
HAL_I2S_Receive_IT
HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size)
I2S_FLAG_UDR
#define I2S_FLAG_UDR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:283
__DMA_HandleTypeDef::XferErrorCallback
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h:159
I2S_InitTypeDef::AudioFreq
uint32_t AudioFreq
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:61
I2S_MODE_MASTER_RX
#define I2S_MODE_MASTER_RX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:195
SPI_I2SCFGR_I2SSTD
#define SPI_I2SCFGR_I2SSTD
Definition: stm32f407xx.h:11577


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