stm32f469/stm32f469i-disco/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c
Go to the documentation of this file.
1 
90 /* Includes ------------------------------------------------------------------*/
91 #include "stm32f4xx_hal.h"
92 
97 #ifdef HAL_I2S_MODULE_ENABLED
98 
104 #if defined (SPI_I2S_FULLDUPLEX_SUPPORT)
105 
106 /* Private typedef -----------------------------------------------------------*/
110 typedef enum
111 {
112  I2S_USE_I2S = 0x00U,
113  I2S_USE_I2SEXT = 0x01U,
114 } I2S_UseTypeDef;
118 /* Private define ------------------------------------------------------------*/
119 /* Private macro -------------------------------------------------------------*/
120 /* Private variables ---------------------------------------------------------*/
121 /* Private function prototypes -----------------------------------------------*/
125 static void I2SEx_TxRxDMAHalfCplt(DMA_HandleTypeDef *hdma);
126 static void I2SEx_TxRxDMACplt(DMA_HandleTypeDef *hdma);
127 static void I2SEx_TxRxDMAError(DMA_HandleTypeDef *hdma);
128 static void I2SEx_RxISR_I2S(I2S_HandleTypeDef *hi2s);
129 static void I2SEx_RxISR_I2SExt(I2S_HandleTypeDef *hi2s);
130 static void I2SEx_TxISR_I2S(I2S_HandleTypeDef *hi2s);
131 static void I2SEx_TxISR_I2SExt(I2S_HandleTypeDef *hi2s);
132 static HAL_StatusTypeDef I2SEx_FullDuplexWaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag,
133  uint32_t State, uint32_t Timeout, I2S_UseTypeDef i2sUsed);
142 /* Private functions ---------------------------------------------------------*/
143 /* Exported functions --------------------------------------------------------*/
144 
205 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData,
206  uint16_t Size, uint32_t Timeout)
207 {
208  uint32_t tmp1 = 0U;
209  HAL_StatusTypeDef errorcode = HAL_OK;
210 
211  if (hi2s->State != HAL_I2S_STATE_READY)
212  {
213  errorcode = HAL_BUSY;
214  goto error;
215  }
216 
217  if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
218  {
219  return HAL_ERROR;
220  }
221 
222  /* Process Locked */
223  __HAL_LOCK(hi2s);
224 
226  /* Check the Data format: When a 16-bit data frame or a 16-bit data frame extended
227  is selected during the I2S configuration phase, the Size parameter means the number
228  of 16-bit data length in the transaction and when a 24-bit data frame or a 32-bit data
229  frame is selected the Size parameter means the number of 16-bit data length. */
230  if ((tmp1 == I2S_DATAFORMAT_24B) || (tmp1 == I2S_DATAFORMAT_32B))
231  {
232  hi2s->TxXferSize = (Size << 1U);
233  hi2s->TxXferCount = (Size << 1U);
234  hi2s->RxXferSize = (Size << 1U);
235  hi2s->RxXferCount = (Size << 1U);
236  }
237  else
238  {
239  hi2s->TxXferSize = Size;
240  hi2s->TxXferCount = Size;
241  hi2s->RxXferSize = Size;
242  hi2s->RxXferCount = Size;
243  }
244 
245  /* Set state and reset error code */
248 
249  tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG;
250  /* Check if the I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX Mode is selected */
251  if ((tmp1 == I2S_MODE_MASTER_TX) || (tmp1 == I2S_MODE_SLAVE_TX))
252  {
253  /* Prepare the First Data before enabling the I2S */
254  hi2s->Instance->DR = (*pTxData++);
255  hi2s->TxXferCount--;
256 
257  /* Enable I2Sext(receiver) before enabling I2Sx peripheral */
258  __HAL_I2SEXT_ENABLE(hi2s);
259 
260  /* Enable I2Sx peripheral */
261  __HAL_I2S_ENABLE(hi2s);
262 
263  /* Check if Master Receiver mode is selected */
265  {
266  /* Clear the Overrun Flag by a read operation on the SPI_DR register followed by a read
267  access to the SPI_SR register. */
268  __HAL_I2SEXT_CLEAR_OVRFLAG(hi2s);
269  }
270 
271  while ((hi2s->RxXferCount > 0U) || (hi2s->TxXferCount > 0U))
272  {
273  if (hi2s->TxXferCount > 0U)
274  {
275  /* Wait until TXE flag is set */
276  if (I2SEx_FullDuplexWaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXE, SET, Timeout, I2S_USE_I2S) != HAL_OK)
277  {
278  /* Set the error code */
280  errorcode = HAL_ERROR;
281  goto error;
282  }
283  /* Write Data on DR register */
284  hi2s->Instance->DR = (*pTxData++);
285  hi2s->TxXferCount--;
286 
287  /* Check if an underrun occurs */
288  if ((__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR) == SET) && (tmp1 == I2S_MODE_SLAVE_TX))
289  {
290  /* Clear Underrun flag */
292 
293  /* Set the error code */
295  }
296  }
297  if (hi2s->RxXferCount > 0U)
298  {
299  /* Wait until RXNE flag is set */
300  if (I2SEx_FullDuplexWaitFlagStateUntilTimeout(hi2s, I2S_FLAG_RXNE, SET, Timeout, I2S_USE_I2SEXT) != HAL_OK)
301  {
302  /* Set the error code */
304  errorcode = HAL_ERROR;
305  goto error;
306  }
307  /* Read Data from DR register */
308  (*pRxData++) = I2SxEXT(hi2s->Instance)->DR;
309  hi2s->RxXferCount--;
310 
311  /* Check if an overrun occurs */
312  if (__HAL_I2SEXT_GET_FLAG(hi2s, I2S_FLAG_OVR) == SET)
313  {
314  /* Clear Overrun flag */
316 
317  /* Set the error code */
319  }
320  }
321  }
322  }
323  /* The I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX Mode is selected */
324  else
325  {
326  /* Prepare the First Data before enabling the I2S */
327  I2SxEXT(hi2s->Instance)->DR = (*pTxData++);
328  hi2s->TxXferCount--;
329 
330  /* Enable I2Sext(transmitter) after enabling I2Sx peripheral */
331  __HAL_I2SEXT_ENABLE(hi2s);
332 
333  /* Enable I2S peripheral before the I2Sext*/
334  __HAL_I2S_ENABLE(hi2s);
335 
336  /* Check if Master Receiver mode is selected */
338  {
339  /* Clear the Overrun Flag by a read operation on the SPI_DR register followed by a read
340  access to the SPI_SR register. */
342  }
343 
344  while ((hi2s->RxXferCount > 0U) || (hi2s->TxXferCount > 0U))
345  {
346  if (hi2s->TxXferCount > 0U)
347  {
348  /* Wait until TXE flag is set */
349  if (I2SEx_FullDuplexWaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXE, SET, Timeout, I2S_USE_I2SEXT) != HAL_OK)
350  {
351  /* Set the error code */
353  errorcode = HAL_ERROR;
354  goto error;
355  }
356  /* Write Data on DR register */
357  I2SxEXT(hi2s->Instance)->DR = (*pTxData++);
358  hi2s->TxXferCount--;
359 
360  /* Check if an underrun occurs */
361  if ((__HAL_I2SEXT_GET_FLAG(hi2s, I2S_FLAG_UDR) == SET) && (tmp1 == I2S_MODE_SLAVE_RX))
362  {
363  /* Clear Underrun flag */
365 
366  /* Set the error code */
368  }
369  }
370  if (hi2s->RxXferCount > 0U)
371  {
372  /* Wait until RXNE flag is set */
373  if (I2SEx_FullDuplexWaitFlagStateUntilTimeout(hi2s, I2S_FLAG_RXNE, SET, Timeout, I2S_USE_I2S) != HAL_OK)
374  {
375  /* Set the error code */
377  errorcode = HAL_ERROR;
378  goto error;
379  }
380  /* Read Data from DR register */
381  (*pRxData++) = hi2s->Instance->DR;
382  hi2s->RxXferCount--;
383 
384  /* Check if an overrun occurs */
385  if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR) == SET)
386  {
387  /* Clear Overrun flag */
389 
390  /* Set the error code */
392  }
393  }
394  }
395  }
396 
397  if (hi2s->ErrorCode != HAL_I2S_ERROR_NONE)
398  {
399  errorcode = HAL_ERROR;
400  }
401 
402 error :
403  hi2s->State = HAL_I2S_STATE_READY;
404  __HAL_UNLOCK(hi2s);
405  return errorcode;
406 }
407 
423 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData,
424  uint16_t Size)
425 {
426  uint32_t tmp1 = 0U;
427  HAL_StatusTypeDef errorcode = HAL_OK;
428 
429  if (hi2s->State != HAL_I2S_STATE_READY)
430  {
431  errorcode = HAL_BUSY;
432  goto error;
433  }
434 
435  if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
436  {
437  return HAL_ERROR;
438  }
439 
440  /* Process Locked */
441  __HAL_LOCK(hi2s);
442 
443  hi2s->pTxBuffPtr = pTxData;
444  hi2s->pRxBuffPtr = pRxData;
445 
447  /* Check the Data format: When a 16-bit data frame or a 16-bit data frame extended
448  is selected during the I2S configuration phase, the Size parameter means the number
449  of 16-bit data length in the transaction and when a 24-bit data frame or a 32-bit data
450  frame is selected the Size parameter means the number of 16-bit data length. */
451  if ((tmp1 == I2S_DATAFORMAT_24B) || (tmp1 == I2S_DATAFORMAT_32B))
452  {
453  hi2s->TxXferSize = (Size << 1U);
454  hi2s->TxXferCount = (Size << 1U);
455  hi2s->RxXferSize = (Size << 1U);
456  hi2s->RxXferCount = (Size << 1U);
457  }
458  else
459  {
460  hi2s->TxXferSize = Size;
461  hi2s->TxXferCount = Size;
462  hi2s->RxXferSize = Size;
463  hi2s->RxXferCount = Size;
464  }
465 
468 
469  /* Set the function for IT treatment */
470  if ((hi2s->Init.Mode == I2S_MODE_MASTER_TX) || (hi2s->Init.Mode == I2S_MODE_SLAVE_TX))
471  {
472  /* Enable I2Sext RXNE and ERR interrupts */
473  __HAL_I2SEXT_ENABLE_IT(hi2s, (I2S_IT_RXNE | I2S_IT_ERR));
474 
475  /* Enable I2Sx TXE and ERR interrupts */
477 
478  /* Transmit First data */
479  hi2s->Instance->DR = (*hi2s->pTxBuffPtr++);
480  hi2s->TxXferCount--;
481 
482  if (hi2s->TxXferCount == 0U)
483  {
484  /* Disable TXE and ERR interrupt */
486  }
487  }
488  else /* The I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX Mode is selected */
489  {
490  /* Enable I2Sext TXE and ERR interrupts */
491  __HAL_I2SEXT_ENABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
492 
493  /* Enable I2Sext RXNE and ERR interrupts */
495 
496  /* Transmit First data */
497  I2SxEXT(hi2s->Instance)->DR = (*hi2s->pTxBuffPtr++);
498  hi2s->TxXferCount--;
499 
500  if (hi2s->TxXferCount == 0U)
501  {
502  /* Disable I2Sext TXE and ERR interrupt */
503  __HAL_I2SEXT_DISABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
504  }
505  }
506 
507  /* Enable I2Sext peripheral */
508  __HAL_I2SEXT_ENABLE(hi2s);
509 
510  /* Enable I2S peripheral */
511  __HAL_I2S_ENABLE(hi2s);
512 
513 error :
514  __HAL_UNLOCK(hi2s);
515  return errorcode;
516 }
517 
533 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData,
534  uint16_t Size)
535 {
536  uint32_t *tmp = NULL;
537  uint32_t tmp1 = 0U;
538  HAL_StatusTypeDef errorcode = HAL_OK;
539 
540  if (hi2s->State != HAL_I2S_STATE_READY)
541  {
542  errorcode = HAL_BUSY;
543  goto error;
544  }
545 
546  if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U))
547  {
548  return HAL_ERROR;
549  }
550 
551  /* Process Locked */
552  __HAL_LOCK(hi2s);
553 
554  hi2s->pTxBuffPtr = pTxData;
555  hi2s->pRxBuffPtr = pRxData;
556 
558  /* Check the Data format: When a 16-bit data frame or a 16-bit data frame extended
559  is selected during the I2S configuration phase, the Size parameter means the number
560  of 16-bit data length in the transaction and when a 24-bit data frame or a 32-bit data
561  frame is selected the Size parameter means the number of 16-bit data length. */
562  if ((tmp1 == I2S_DATAFORMAT_24B) || (tmp1 == I2S_DATAFORMAT_32B))
563  {
564  hi2s->TxXferSize = (Size << 1U);
565  hi2s->TxXferCount = (Size << 1U);
566  hi2s->RxXferSize = (Size << 1U);
567  hi2s->RxXferCount = (Size << 1U);
568  }
569  else
570  {
571  hi2s->TxXferSize = Size;
572  hi2s->TxXferCount = Size;
573  hi2s->RxXferSize = Size;
574  hi2s->RxXferCount = Size;
575  }
576 
579 
580  /* Set the I2S Rx DMA Half transfer complete callback */
581  hi2s->hdmarx->XferHalfCpltCallback = I2SEx_TxRxDMAHalfCplt;
582 
583  /* Set the I2S Rx DMA transfer complete callback */
584  hi2s->hdmarx->XferCpltCallback = I2SEx_TxRxDMACplt;
585 
586  /* Set the I2S Rx DMA error callback */
587  hi2s->hdmarx->XferErrorCallback = I2SEx_TxRxDMAError;
588 
589  /* Set the I2S Tx DMA Half transfer complete callback */
590  hi2s->hdmatx->XferHalfCpltCallback = I2SEx_TxRxDMAHalfCplt;
591 
592  /* Set the I2S Tx DMA transfer complete callback */
593  hi2s->hdmatx->XferCpltCallback = I2SEx_TxRxDMACplt;
594 
595  /* Set the I2S Tx DMA error callback */
596  hi2s->hdmatx->XferErrorCallback = I2SEx_TxRxDMAError;
597 
598  tmp1 = hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG;
599  /* Check if the I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX Mode is selected */
600  if ((tmp1 == I2S_MODE_MASTER_TX) || (tmp1 == I2S_MODE_SLAVE_TX))
601  {
602  /* Enable the Rx DMA Stream */
603  tmp = (uint32_t *)&pRxData;
604  HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&I2SxEXT(hi2s->Instance)->DR, *(uint32_t *)tmp, hi2s->RxXferSize);
605 
606  /* Enable Rx DMA Request */
607  SET_BIT(I2SxEXT(hi2s->Instance)->CR2, SPI_CR2_RXDMAEN);
608 
609  /* Enable the Tx DMA Stream */
610  tmp = (uint32_t *)&pTxData;
611  HAL_DMA_Start_IT(hi2s->hdmatx, *(uint32_t *)tmp, (uint32_t)&hi2s->Instance->DR, hi2s->TxXferSize);
612 
613  /* Enable Tx DMA Request */
615 
616  /* Check if the I2S is already enabled */
618  {
619  /* Enable I2Sext(receiver) before enabling I2Sx peripheral */
620  __HAL_I2SEXT_ENABLE(hi2s);
621 
622  /* Enable I2S peripheral after the I2Sext */
623  __HAL_I2S_ENABLE(hi2s);
624  }
625  }
626  else
627  {
628  /* Check if Master Receiver mode is selected */
630  {
631  /* Clear the Overrun Flag by a read operation on the SPI_DR register followed by a read
632  access to the SPI_SR register. */
634  }
635  /* Enable the Tx DMA Stream */
636  tmp = (uint32_t *)&pTxData;
637  HAL_DMA_Start_IT(hi2s->hdmatx, *(uint32_t *)tmp, (uint32_t)&I2SxEXT(hi2s->Instance)->DR, hi2s->TxXferSize);
638 
639  /* Enable Tx DMA Request */
640  SET_BIT(I2SxEXT(hi2s->Instance)->CR2, SPI_CR2_TXDMAEN);
641 
642  /* Enable the Rx DMA Stream */
643  tmp = (uint32_t *)&pRxData;
644  HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->DR, *(uint32_t *)tmp, hi2s->RxXferSize);
645 
646  /* Enable Rx DMA Request */
648 
649  /* Check if the I2S is already enabled */
651  {
652  /* Enable I2Sext(transmitter) before enabling I2Sx peripheral */
653  __HAL_I2SEXT_ENABLE(hi2s);
654  /* Enable I2S peripheral before the I2Sext */
655  __HAL_I2S_ENABLE(hi2s);
656  }
657  }
658 
659 error :
660  __HAL_UNLOCK(hi2s);
661  return errorcode;
662 }
663 
669 void HAL_I2SEx_FullDuplex_IRQHandler(I2S_HandleTypeDef *hi2s)
670 {
671  __IO uint32_t i2ssr = hi2s->Instance->SR;
672  __IO uint32_t i2sextsr = I2SxEXT(hi2s->Instance)->SR;
673  __IO uint32_t i2scr2 = hi2s->Instance->CR2;
674  __IO uint32_t i2sextcr2 = I2SxEXT(hi2s->Instance)->CR2;
675 
676  /* Check if the I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX Mode is selected */
677  if ((hi2s->Init.Mode == I2S_MODE_MASTER_TX) || (hi2s->Init.Mode == I2S_MODE_SLAVE_TX))
678  {
679  /* I2S in mode Transmitter -------------------------------------------------*/
680  if (((i2ssr & I2S_FLAG_TXE) == I2S_FLAG_TXE) && ((i2scr2 & I2S_IT_TXE) != RESET))
681  {
682  /* When the I2S mode is configured as I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX,
683  the I2S TXE interrupt will be generated to manage the full-duplex transmit phase. */
684  I2SEx_TxISR_I2S(hi2s);
685  }
686 
687  /* I2Sext in mode Receiver -----------------------------------------------*/
688  if (((i2sextsr & I2S_FLAG_RXNE) == I2S_FLAG_RXNE) && ((i2sextcr2 & I2S_IT_RXNE) != RESET))
689  {
690  /* When the I2S mode is configured as I2S_MODE_MASTER_TX or I2S_MODE_SLAVE_TX,
691  the I2Sext RXNE interrupt will be generated to manage the full-duplex receive phase. */
692  I2SEx_RxISR_I2SExt(hi2s);
693  }
694 
695  /* I2Sext Overrun error interrupt occurred --------------------------------*/
696  if (((i2sextsr & I2S_FLAG_OVR) == I2S_FLAG_OVR) && ((i2sextcr2 & I2S_IT_ERR) != RESET))
697  {
698  /* Disable RXNE and ERR interrupt */
699  __HAL_I2SEXT_DISABLE_IT(hi2s, (I2S_IT_RXNE | I2S_IT_ERR));
700 
701  /* Disable TXE and ERR interrupt */
703 
704  /* Clear Overrun flag */
706 
707  /* Set the I2S State ready */
708  hi2s->State = HAL_I2S_STATE_READY;
709 
710  /* Set the error code and execute error callback*/
712  /* Call user error callback */
713 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
714  hi2s->ErrorCallback(hi2s);
715 #else
716  HAL_I2S_ErrorCallback(hi2s);
717 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
718  }
719 
720  /* I2S Underrun error interrupt occurred ----------------------------------*/
721  if (((i2ssr & I2S_FLAG_UDR) == I2S_FLAG_UDR) && ((i2scr2 & I2S_IT_ERR) != RESET))
722  {
723  /* Disable TXE and ERR interrupt */
725 
726  /* Disable RXNE and ERR interrupt */
727  __HAL_I2SEXT_DISABLE_IT(hi2s, (I2S_IT_RXNE | I2S_IT_ERR));
728 
729  /* Clear underrun flag */
731 
732  /* Set the I2S State ready */
733  hi2s->State = HAL_I2S_STATE_READY;
734 
735  /* Set the error code and execute error callback*/
737  /* Call user error callback */
738 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
739  hi2s->ErrorCallback(hi2s);
740 #else
741  HAL_I2S_ErrorCallback(hi2s);
742 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
743  }
744  }
745  /* The I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX Mode is selected */
746  else
747  {
748  /* I2Sext in mode Transmitter ----------------------------------------------*/
749  if (((i2sextsr & I2S_FLAG_TXE) == I2S_FLAG_TXE) && ((i2sextcr2 & I2S_IT_TXE) != RESET))
750  {
751  /* When the I2S mode is configured as I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX,
752  the I2Sext TXE interrupt will be generated to manage the full-duplex transmit phase. */
753  I2SEx_TxISR_I2SExt(hi2s);
754  }
755 
756  /* I2S in mode Receiver --------------------------------------------------*/
757  if (((i2ssr & I2S_FLAG_RXNE) == I2S_FLAG_RXNE) && ((i2scr2 & I2S_IT_RXNE) != RESET))
758  {
759  /* When the I2S mode is configured as I2S_MODE_MASTER_RX or I2S_MODE_SLAVE_RX,
760  the I2S RXNE interrupt will be generated to manage the full-duplex receive phase. */
761  I2SEx_RxISR_I2S(hi2s);
762  }
763 
764  /* I2S Overrun error interrupt occurred -------------------------------------*/
765  if (((i2ssr & I2S_FLAG_OVR) == I2S_FLAG_OVR) && ((i2scr2 & I2S_IT_ERR) != RESET))
766  {
767  /* Disable RXNE and ERR interrupt */
769 
770  /* Disable TXE and ERR interrupt */
771  __HAL_I2SEXT_DISABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
772 
773  /* Set the I2S State ready */
774  hi2s->State = HAL_I2S_STATE_READY;
775 
776  /* Set the error code and execute error callback*/
778  /* Call user error callback */
779 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
780  hi2s->ErrorCallback(hi2s);
781 #else
782  HAL_I2S_ErrorCallback(hi2s);
783 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
784  }
785 
786  /* I2Sext Underrun error interrupt occurred -------------------------------*/
787  if (((i2sextsr & I2S_FLAG_UDR) == I2S_FLAG_UDR) && ((i2sextcr2 & I2S_IT_ERR) != RESET))
788  {
789  /* Disable TXE and ERR interrupt */
790  __HAL_I2SEXT_DISABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
791 
792  /* Disable RXNE and ERR interrupt */
794 
795  /* Set the I2S State ready */
796  hi2s->State = HAL_I2S_STATE_READY;
797 
798  /* Set the error code and execute error callback*/
800  /* Call user error callback */
801 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
802  hi2s->ErrorCallback(hi2s);
803 #else
804  HAL_I2S_ErrorCallback(hi2s);
805 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
806  }
807  }
808 }
809 
816 {
817  /* Prevent unused argument(s) compilation warning */
818  UNUSED(hi2s);
819 
820  /* NOTE : This function Should not be modified, when the callback is needed,
821  the HAL_I2SEx_TxRxHalfCpltCallback could be implemented in the user file
822  */
823 }
824 
831 {
832  /* Prevent unused argument(s) compilation warning */
833  UNUSED(hi2s);
834 
835  /* NOTE : This function should not be modified, when the callback is needed,
836  the HAL_I2SEx_TxRxCpltCallback could be implemented in the user file
837  */
838 }
839 
858 static void I2SEx_TxRxDMAHalfCplt(DMA_HandleTypeDef *hdma)
859 {
860  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent;
861 
862  /* Call user TxRx Half complete callback */
863 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
864  hi2s->TxRxHalfCpltCallback(hi2s);
865 #else
867 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
868 }
869 
876 static void I2SEx_TxRxDMACplt(DMA_HandleTypeDef *hdma)
877 {
878  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent;
879 
880  /* if DMA is configured in DMA_NORMAL mode */
881  if (hdma->Init.Mode == DMA_NORMAL)
882  {
883  if (hi2s->hdmarx == hdma)
884  {
885  /* Disable Rx DMA Request */
886  if (((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG) == I2S_MODE_MASTER_TX) || \
888  {
889  CLEAR_BIT(I2SxEXT(hi2s->Instance)->CR2, SPI_CR2_RXDMAEN);
890  }
891  else
892  {
894  }
895 
896  hi2s->RxXferCount = 0U;
897 
898  if (hi2s->TxXferCount == 0U)
899  {
900  hi2s->State = HAL_I2S_STATE_READY;
901 
902  /* Call user TxRx complete callback */
903 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
904  hi2s->TxRxCpltCallback(hi2s);
905 #else
907 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
908  }
909  }
910 
911  if (hi2s->hdmatx == hdma)
912  {
913  /* Disable Tx DMA Request */
914  if (((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG) == I2S_MODE_MASTER_TX) || \
916  {
918  }
919  else
920  {
921  CLEAR_BIT(I2SxEXT(hi2s->Instance)->CR2, SPI_CR2_TXDMAEN);
922  }
923 
924  hi2s->TxXferCount = 0U;
925 
926  if (hi2s->RxXferCount == 0U)
927  {
928  hi2s->State = HAL_I2S_STATE_READY;
929 
930  /* Call user TxRx complete callback */
931 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
932  hi2s->TxRxCpltCallback(hi2s);
933 #else
935 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
936  }
937  }
938  }
939 }
940 
946 static void I2SEx_TxRxDMAError(DMA_HandleTypeDef *hdma)
947 {
948  I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent;
949 
950  /* Disable Rx and Tx DMA Request */
952  CLEAR_BIT(I2SxEXT(hi2s->Instance)->CR2, (SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN));
953 
954  hi2s->TxXferCount = 0U;
955  hi2s->RxXferCount = 0U;
956 
957  hi2s->State = HAL_I2S_STATE_READY;
958 
959  /* Set the error code and execute error callback*/
961  /* Call user error callback */
962 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
963  hi2s->ErrorCallback(hi2s);
964 #else
965  HAL_I2S_ErrorCallback(hi2s);
966 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
967 }
968 
974 static void I2SEx_TxISR_I2S(I2S_HandleTypeDef *hi2s)
975 {
976  /* Write Data on DR register */
977  hi2s->Instance->DR = (*hi2s->pTxBuffPtr++);
978  hi2s->TxXferCount--;
979 
980  if (hi2s->TxXferCount == 0U)
981  {
982  /* Disable TXE and ERR interrupt */
984 
985  if (hi2s->RxXferCount == 0U)
986  {
987  hi2s->State = HAL_I2S_STATE_READY;
988  /* Call user TxRx complete callback */
989 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
990  hi2s->TxRxCpltCallback(hi2s);
991 #else
993 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
994  }
995  }
996 }
997 
1003 static void I2SEx_TxISR_I2SExt(I2S_HandleTypeDef *hi2s)
1004 {
1005  /* Write Data on DR register */
1006  I2SxEXT(hi2s->Instance)->DR = (*hi2s->pTxBuffPtr++);
1007  hi2s->TxXferCount--;
1008 
1009  if (hi2s->TxXferCount == 0U)
1010  {
1011  /* Disable I2Sext TXE and ERR interrupt */
1012  __HAL_I2SEXT_DISABLE_IT(hi2s, (I2S_IT_TXE | I2S_IT_ERR));
1013 
1014  if (hi2s->RxXferCount == 0U)
1015  {
1016  hi2s->State = HAL_I2S_STATE_READY;
1017  /* Call user TxRx complete callback */
1018 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1019  hi2s->TxRxCpltCallback(hi2s);
1020 #else
1022 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1023  }
1024  }
1025 }
1026 
1032 static void I2SEx_RxISR_I2S(I2S_HandleTypeDef *hi2s)
1033 {
1034  /* Read Data from DR register */
1035  (*hi2s->pRxBuffPtr++) = hi2s->Instance->DR;
1036  hi2s->RxXferCount--;
1037 
1038  if (hi2s->RxXferCount == 0U)
1039  {
1040  /* Disable RXNE and ERR interrupt */
1042 
1043  if (hi2s->TxXferCount == 0U)
1044  {
1045  hi2s->State = HAL_I2S_STATE_READY;
1046  /* Call user TxRx complete callback */
1047 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1048  hi2s->TxRxCpltCallback(hi2s);
1049 #else
1051 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1052  }
1053  }
1054 }
1055 
1061 static void I2SEx_RxISR_I2SExt(I2S_HandleTypeDef *hi2s)
1062 {
1063  /* Read Data from DR register */
1064  (*hi2s->pRxBuffPtr++) = I2SxEXT(hi2s->Instance)->DR;
1065  hi2s->RxXferCount--;
1066 
1067  if (hi2s->RxXferCount == 0U)
1068  {
1069  /* Disable I2Sext RXNE and ERR interrupt */
1070  __HAL_I2SEXT_DISABLE_IT(hi2s, (I2S_IT_RXNE | I2S_IT_ERR));
1071 
1072  if (hi2s->TxXferCount == 0U)
1073  {
1074  hi2s->State = HAL_I2S_STATE_READY;
1075  /* Call user TxRx complete callback */
1076 #if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U)
1077  hi2s->TxRxCpltCallback(hi2s);
1078 #else
1080 #endif /* USE_HAL_I2S_REGISTER_CALLBACKS */
1081  }
1082  }
1083 }
1084 
1094 static HAL_StatusTypeDef I2SEx_FullDuplexWaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag,
1095  uint32_t State, uint32_t Timeout, I2S_UseTypeDef i2sUsed)
1096 {
1097  uint32_t tickstart = HAL_GetTick();
1098 
1099  if (i2sUsed == I2S_USE_I2S)
1100  {
1101  /* Wait until flag is reset */
1102  while (((__HAL_I2S_GET_FLAG(hi2s, Flag)) ? SET : RESET) != State)
1103  {
1104  if (Timeout != HAL_MAX_DELAY)
1105  {
1106  if ((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout))
1107  {
1108  /* Set the I2S State ready */
1109  hi2s->State = HAL_I2S_STATE_READY;
1110 
1111  /* Process Unlocked */
1112  __HAL_UNLOCK(hi2s);
1113 
1114  return HAL_TIMEOUT;
1115  }
1116  }
1117  }
1118  }
1119  else /* i2sUsed == I2S_USE_I2SEXT */
1120  {
1121  /* Wait until flag is reset */
1122  while (((__HAL_I2SEXT_GET_FLAG(hi2s, Flag)) ? SET : RESET) != State)
1123  {
1124  if (Timeout != HAL_MAX_DELAY)
1125  {
1126  if ((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout))
1127  {
1128  /* Set the I2S State ready */
1129  hi2s->State = HAL_I2S_STATE_READY;
1130 
1131  /* Process Unlocked */
1132  __HAL_UNLOCK(hi2s);
1133 
1134  return HAL_TIMEOUT;
1135  }
1136  }
1137  }
1138  }
1139  return HAL_OK;
1140 }
1141 
1145 #endif /* SPI_I2S_FULLDUPLEX_SUPPORT */
1146 
1150 #endif /* HAL_I2S_MODULE_ENABLED */
1151 
1156 /************************ (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
I2S_MODE_MASTER_TX
#define I2S_MODE_MASTER_TX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:194
SPI_I2SCFGR_CHLEN
#define SPI_I2SCFGR_CHLEN
Definition: stm32f407xx.h:11563
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
__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
SPI_I2SCFGR_I2SE
#define SPI_I2SCFGR_I2SE
Definition: stm32f407xx.h:11593
__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
__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
__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
HAL_I2S_STATE_BUSY_TX_RX
@ HAL_I2S_STATE_BUSY_TX_RX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:83
I2S_HandleTypeDef::pRxBuffPtr
uint16_t * pRxBuffPtr
Definition: stm32f7xx_hal_i2s.h:104
I2S_MODE_SLAVE_TX
#define I2S_MODE_SLAVE_TX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:192
I2S_HandleTypeDef
I2S handle Structure definition.
Definition: stm32f7xx_hal_i2s.h:91
I2S_HandleTypeDef::hdmatx
DMA_HandleTypeDef * hdmatx
Definition: stm32f7xx_hal_i2s.h:114
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_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
HAL_I2SEx_TxRxHalfCpltCallback
void HAL_I2SEx_TxRxHalfCpltCallback(I2S_HandleTypeDef *hi2s)
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
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
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
I2S_HandleTypeDef::Instance
SPI_TypeDef * Instance
Definition: stm32f7xx_hal_i2s.h:94
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
HAL_I2S_ERROR_DMA
#define HAL_I2S_ERROR_DMA
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:179
UNUSED
#define UNUSED(x)
Definition: porcupine/demo/c/dr_libs/old/dr.h:92
HAL_I2S_STATE_READY
@ HAL_I2S_STATE_READY
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:79
I2S_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:49
__HAL_LOCK
#define __HAL_LOCK(__HANDLE__)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:93
I2S_IT_TXE
#define I2S_IT_TXE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:270
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
HAL_I2S_ErrorCallback
void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s)
I2S error callbacks.
Definition: stm32f4_discovery_audio.c:1110
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
HAL_I2SEx_TxRxCpltCallback
void HAL_I2SEx_TxRxCpltCallback(I2S_HandleTypeDef *hi2s)
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
I2S_FLAG_OVR
#define I2S_FLAG_OVR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:284
HAL_I2SEx_TransmitReceive
HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size, uint32_t Timeout)
I2S_FLAG_TXE
#define I2S_FLAG_TXE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:280
HAL_I2SEx_TransmitReceive_IT
HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size)
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
I2S_HandleTypeDef::Init
I2S_InitTypeDef Init
Definition: stm32f7xx_hal_i2s.h:96
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
__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
SET
@ SET
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:188
__I2S_HandleTypeDef::State
__IO HAL_I2S_StateTypeDef State
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:121
SPI_CR2_TXDMAEN
#define SPI_CR2_TXDMAEN
Definition: stm32f407xx.h:11494
I2S_HandleTypeDef::TxXferCount
__IO uint16_t TxXferCount
Definition: stm32f7xx_hal_i2s.h:102
error
static int error(vorb *f, enum STBVorbisError e)
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/stb_vorbis.c:896
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
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_MODE_MASTER_RX
#define I2S_MODE_MASTER_RX
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2s.h:195
HAL_I2SEx_TransmitReceive_DMA
HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size)


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