Lines Matching refs:hi2s
216 static void I2S_Transmit_16Bit_IT(I2S_HandleTypeDef *hi2s);
217 static void I2S_Transmit_32Bit_IT(I2S_HandleTypeDef *hi2s);
218 static void I2S_Receive_16Bit_IT(I2S_HandleTypeDef *hi2s);
219 static void I2S_Receive_32Bit_IT(I2S_HandleTypeDef *hi2s);
220 static HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag, Fla…
267 HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s) in HAL_I2S_Init() argument
277 if (hi2s == NULL) in HAL_I2S_Init()
283 assert_param(IS_I2S_ALL_INSTANCE(hi2s->Instance)); in HAL_I2S_Init()
284 assert_param(IS_I2S_MODE(hi2s->Init.Mode)); in HAL_I2S_Init()
285 assert_param(IS_I2S_STANDARD(hi2s->Init.Standard)); in HAL_I2S_Init()
286 assert_param(IS_I2S_DATA_FORMAT(hi2s->Init.DataFormat)); in HAL_I2S_Init()
287 assert_param(IS_I2S_MCLK_OUTPUT(hi2s->Init.MCLKOutput)); in HAL_I2S_Init()
288 assert_param(IS_I2S_AUDIO_FREQ(hi2s->Init.AudioFreq)); in HAL_I2S_Init()
289 assert_param(IS_I2S_CPOL(hi2s->Init.CPOL)); in HAL_I2S_Init()
290 assert_param(IS_I2S_FIRST_BIT(hi2s->Init.FirstBit)); in HAL_I2S_Init()
291 assert_param(IS_I2S_WS_INVERSION(hi2s->Init.WSInversion)); in HAL_I2S_Init()
292 assert_param(IS_I2S_DATA_24BIT_ALIGNMENT(hi2s->Init.Data24BitAlignment)); in HAL_I2S_Init()
293 assert_param(IS_I2S_MASTER_KEEP_IO_STATE(hi2s->Init.MasterKeepIOState)); in HAL_I2S_Init()
295 if (hi2s->State == HAL_I2S_STATE_RESET) in HAL_I2S_Init()
298 hi2s->Lock = HAL_UNLOCKED; in HAL_I2S_Init()
302 …hi2s->TxCpltCallback = HAL_I2S_TxCpltCallback; /* Legacy weak TxCpltCallback … in HAL_I2S_Init()
303 …hi2s->RxCpltCallback = HAL_I2S_RxCpltCallback; /* Legacy weak RxCpltCallback … in HAL_I2S_Init()
304 …hi2s->TxRxCpltCallback = HAL_I2SEx_TxRxCpltCallback; /* Legacy weak TxRxCpltCallback … in HAL_I2S_Init()
305 …hi2s->TxHalfCpltCallback = HAL_I2S_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback … in HAL_I2S_Init()
306 …hi2s->RxHalfCpltCallback = HAL_I2S_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback … in HAL_I2S_Init()
307 …hi2s->TxRxHalfCpltCallback = HAL_I2SEx_TxRxHalfCpltCallback; /* Legacy weak TxRxHalfCpltCallback … in HAL_I2S_Init()
308 …hi2s->ErrorCallback = HAL_I2S_ErrorCallback; /* Legacy weak ErrorCallback … in HAL_I2S_Init()
310 if (hi2s->MspInitCallback == NULL) in HAL_I2S_Init()
312 hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit */ in HAL_I2S_Init()
316 hi2s->MspInitCallback(hi2s); in HAL_I2S_Init()
319 HAL_I2S_MspInit(hi2s); in HAL_I2S_Init()
323 hi2s->State = HAL_I2S_STATE_BUSY; in HAL_I2S_Init()
326 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) == SPI_CR1_SPE) in HAL_I2S_Init()
329 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_Init()
333 CLEAR_REG(hi2s->Instance->I2SCFGR); in HAL_I2S_Init()
335 if (IS_I2S_MASTER(hi2s->Init.Mode)) in HAL_I2S_Init()
339 if (hi2s->Init.AudioFreq != I2S_AUDIOFREQ_DEFAULT) in HAL_I2S_Init()
342 if (hi2s->Init.DataFormat != I2S_DATAFORMAT_16B) in HAL_I2S_Init()
354 if ((hi2s->Init.Standard == I2S_STANDARD_PCM_SHORT) || in HAL_I2S_Init()
355 (hi2s->Init.Standard == I2S_STANDARD_PCM_LONG)) in HAL_I2S_Init()
365 if (hi2s->Instance == SPI1) in HAL_I2S_Init()
369 else if (hi2s->Instance == SPI2) in HAL_I2S_Init()
373 else if (hi2s->Instance == SPI3) in HAL_I2S_Init()
383 if (hi2s->Init.MCLKOutput == I2S_MCLKOUTPUT_ENABLE) in HAL_I2S_Init()
386 tmp = (uint32_t)((((i2sclk / (256UL >> ispcm)) * 10UL) / hi2s->Init.AudioFreq) + 5UL); in HAL_I2S_Init()
391 …tmp = (uint32_t)((((i2sclk / ((32UL >> ispcm) * packetlength)) * 10UL) / hi2s->Init.AudioFreq) + 5… in HAL_I2S_Init()
414 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_PRESCALER); in HAL_I2S_Init()
424 MODIFY_REG(hi2s->Instance->I2SCFGR, (SPI_I2SCFGR_I2SDIV | SPI_I2SCFGR_ODD), in HAL_I2S_Init()
431 MODIFY_REG(hi2s->Instance->I2SCFGR, (SPI_I2SCFGR_I2SMOD | SPI_I2SCFGR_I2SCFG | \ in HAL_I2S_Init()
436 (SPI_I2SCFGR_I2SMOD | hi2s->Init.Mode | \ in HAL_I2S_Init()
437 hi2s->Init.Standard | hi2s->Init.DataFormat | \ in HAL_I2S_Init()
438 hi2s->Init.CPOL | hi2s->Init.WSInversion | \ in HAL_I2S_Init()
439 hi2s->Init.Data24BitAlignment | hi2s->Init.MCLKOutput)); in HAL_I2S_Init()
441 WRITE_REG(hi2s->Instance->IFCR, 0x0FF8); in HAL_I2S_Init()
446 CLEAR_BIT(hi2s->Instance->CR1, SPI_CR1_IOLOCK); in HAL_I2S_Init()
448 MODIFY_REG(hi2s->Instance->CFG2, SPI_CFG2_LSBFRST, hi2s->Init.FirstBit); in HAL_I2S_Init()
451 if (IS_I2S_MASTER(hi2s->Init.Mode)) in HAL_I2S_Init()
454 MODIFY_REG(hi2s->Instance->CFG2, SPI_CFG2_AFCNTR, (hi2s->Init.MasterKeepIOState)); in HAL_I2S_Init()
457 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Init()
458 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Init()
469 HAL_StatusTypeDef HAL_I2S_DeInit(I2S_HandleTypeDef *hi2s) in HAL_I2S_DeInit() argument
472 if (hi2s == NULL) in HAL_I2S_DeInit()
478 assert_param(IS_I2S_ALL_INSTANCE(hi2s->Instance)); in HAL_I2S_DeInit()
480 hi2s->State = HAL_I2S_STATE_BUSY; in HAL_I2S_DeInit()
483 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DeInit()
486 if (hi2s->MspDeInitCallback == NULL) in HAL_I2S_DeInit()
488 hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit */ in HAL_I2S_DeInit()
492 hi2s->MspDeInitCallback(hi2s); in HAL_I2S_DeInit()
495 HAL_I2S_MspDeInit(hi2s); in HAL_I2S_DeInit()
498 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_DeInit()
499 hi2s->State = HAL_I2S_STATE_RESET; in HAL_I2S_DeInit()
502 __HAL_UNLOCK(hi2s); in HAL_I2S_DeInit()
513 __weak void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s) in HAL_I2S_MspInit() argument
516 UNUSED(hi2s); in HAL_I2S_MspInit()
529 __weak void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s) in HAL_I2S_MspDeInit() argument
532 UNUSED(hi2s); in HAL_I2S_MspDeInit()
551 HAL_StatusTypeDef HAL_I2S_RegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef Callb… in HAL_I2S_RegisterCallback() argument
559 hi2s->ErrorCode |= HAL_I2S_ERROR_INVALID_CALLBACK; in HAL_I2S_RegisterCallback()
564 if (HAL_I2S_STATE_READY == hi2s->State) in HAL_I2S_RegisterCallback()
569 hi2s->TxCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
573 hi2s->RxCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
577 hi2s->TxRxCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
581 hi2s->TxHalfCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
585 hi2s->RxHalfCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
590 hi2s->TxRxHalfCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
594 hi2s->ErrorCallback = pCallback; in HAL_I2S_RegisterCallback()
598 hi2s->MspInitCallback = pCallback; in HAL_I2S_RegisterCallback()
602 hi2s->MspDeInitCallback = pCallback; in HAL_I2S_RegisterCallback()
607 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_RegisterCallback()
614 else if (HAL_I2S_STATE_RESET == hi2s->State) in HAL_I2S_RegisterCallback()
619 hi2s->MspInitCallback = pCallback; in HAL_I2S_RegisterCallback()
623 hi2s->MspDeInitCallback = pCallback; in HAL_I2S_RegisterCallback()
628 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_RegisterCallback()
638 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_RegisterCallback()
657 HAL_StatusTypeDef HAL_I2S_UnRegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef Cal… in HAL_I2S_UnRegisterCallback() argument
661 if (HAL_I2S_STATE_READY == hi2s->State) in HAL_I2S_UnRegisterCallback()
666 …hi2s->TxCpltCallback = HAL_I2S_TxCpltCallback; /* Legacy weak TxCpltCallback … in HAL_I2S_UnRegisterCallback()
670 …hi2s->RxCpltCallback = HAL_I2S_RxCpltCallback; /* Legacy weak RxCpltCallback … in HAL_I2S_UnRegisterCallback()
674 …hi2s->TxRxCpltCallback = HAL_I2SEx_TxRxCpltCallback; /* Legacy weak TxRxCpltCallback … in HAL_I2S_UnRegisterCallback()
678 …hi2s->TxHalfCpltCallback = HAL_I2S_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
682 …hi2s->RxHalfCpltCallback = HAL_I2S_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
686 …hi2s->TxRxHalfCpltCallback = HAL_I2SEx_TxRxHalfCpltCallback; /* Legacy weak TxRxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
690 …hi2s->ErrorCallback = HAL_I2S_ErrorCallback; /* Legacy weak ErrorCallback … in HAL_I2S_UnRegisterCallback()
694 …hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit … in HAL_I2S_UnRegisterCallback()
698 …hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit … in HAL_I2S_UnRegisterCallback()
703 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
710 else if (HAL_I2S_STATE_RESET == hi2s->State) in HAL_I2S_UnRegisterCallback()
715 …hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit … in HAL_I2S_UnRegisterCallback()
719 …hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit … in HAL_I2S_UnRegisterCallback()
724 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
734 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
808 HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Size, u… in HAL_I2S_Transmit() argument
811 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in HAL_I2S_Transmit()
820 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit()
826 __HAL_LOCK(hi2s); in HAL_I2S_Transmit()
832 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit()
833 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit()
834 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit()
835 hi2s->TxXferSize = Size; in HAL_I2S_Transmit()
836 hi2s->TxXferCount = Size; in HAL_I2S_Transmit()
839 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit()
840 hi2s->RxXferSize = (uint16_t) 0UL; in HAL_I2S_Transmit()
841 hi2s->RxXferCount = (uint16_t) 0UL; in HAL_I2S_Transmit()
844 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Transmit()
847 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit()
851 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit()
855 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Transmit()
858 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Transmit()
859 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
860 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
864 while (hi2s->TxXferCount > 0UL) in HAL_I2S_Transmit()
866 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Transmit()
869 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
870 hi2s->pTxBuffPtr += 2; in HAL_I2S_Transmit()
871 hi2s->TxXferCount--; in HAL_I2S_Transmit()
877 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
879 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
882 hi2s->pTxBuffPtr++; in HAL_I2S_Transmit()
883 hi2s->TxXferCount--; in HAL_I2S_Transmit()
887 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Transmit()
890 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Transmit()
891 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
892 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
897 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
898 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
919 HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t… in HAL_I2S_Receive() argument
922 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in HAL_I2S_Receive()
931 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive()
937 __HAL_LOCK(hi2s); in HAL_I2S_Receive()
943 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive()
944 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive()
945 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive()
946 hi2s->RxXferSize = Size; in HAL_I2S_Receive()
947 hi2s->RxXferCount = Size; in HAL_I2S_Receive()
950 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive()
951 hi2s->TxXferSize = (uint16_t) 0UL; in HAL_I2S_Receive()
952 hi2s->TxXferCount = (uint16_t) 0UL; in HAL_I2S_Receive()
955 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Receive()
958 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive()
962 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive()
965 while (hi2s->RxXferCount > 0UL) in HAL_I2S_Receive()
968 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_RXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Receive()
971 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Receive()
972 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive()
973 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive()
977 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Receive()
980 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in HAL_I2S_Receive()
981 hi2s->pRxBuffPtr += 2; in HAL_I2S_Receive()
982 hi2s->RxXferCount--; in HAL_I2S_Receive()
988 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in HAL_I2S_Receive()
990 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in HAL_I2S_Receive()
992 hi2s->pRxBuffPtr++; in HAL_I2S_Receive()
993 hi2s->RxXferCount--; in HAL_I2S_Receive()
997 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive()
998 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive()
1019 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, uint1… in HAL_I2SEx_TransmitReceive() argument
1027 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in HAL_I2SEx_TransmitReceive()
1028 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in HAL_I2SEx_TransmitReceive()
1036 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive()
1042 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1047 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive()
1048 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive()
1049 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive()
1050 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive()
1051 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive()
1052 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive()
1054 tmp_TxXferCount = hi2s->TxXferCount; in HAL_I2SEx_TransmitReceive()
1055 tmp_RxXferCount = hi2s->RxXferCount; in HAL_I2SEx_TransmitReceive()
1058 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive()
1059 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive()
1062 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2SEx_TransmitReceive()
1065 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive()
1069 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive()
1073 if ((__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_TXP) == SET) && (tmp_TxXferCount != 0UL)) in HAL_I2SEx_TransmitReceive()
1075 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive()
1078 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1079 hi2s->pTxBuffPtr += 2; in HAL_I2SEx_TransmitReceive()
1086 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1088 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1091 hi2s->pTxBuffPtr++; in HAL_I2SEx_TransmitReceive()
1096 if ((__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_RXP) == SET) && (tmp_RxXferCount != 0UL)) in HAL_I2SEx_TransmitReceive()
1098 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive()
1101 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in HAL_I2SEx_TransmitReceive()
1102 hi2s->pRxBuffPtr += 2; in HAL_I2SEx_TransmitReceive()
1109 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in HAL_I2SEx_TransmitReceive()
1111 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in HAL_I2SEx_TransmitReceive()
1113 hi2s->pRxBuffPtr++; in HAL_I2SEx_TransmitReceive()
1122 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2SEx_TransmitReceive()
1123 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive()
1124 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1129 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive()
1130 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1148 HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Size) in HAL_I2S_Transmit_IT() argument
1155 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit_IT()
1161 __HAL_LOCK(hi2s); in HAL_I2S_Transmit_IT()
1164 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit_IT()
1165 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit_IT()
1166 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit_IT()
1167 hi2s->TxXferSize = Size; in HAL_I2S_Transmit_IT()
1168 hi2s->TxXferCount = Size; in HAL_I2S_Transmit_IT()
1171 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit_IT()
1172 hi2s->RxXferSize = (uint16_t) 0UL; in HAL_I2S_Transmit_IT()
1173 hi2s->RxXferCount = (uint16_t) 0UL; in HAL_I2S_Transmit_IT()
1176 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Transmit_IT()
1178 hi2s->TxISR = I2S_Transmit_32Bit_IT; in HAL_I2S_Transmit_IT()
1182 hi2s->TxISR = I2S_Transmit_16Bit_IT; in HAL_I2S_Transmit_IT()
1186 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Transmit_IT()
1189 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit_IT()
1193 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_TXP); in HAL_I2S_Transmit_IT()
1197 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_UDR); in HAL_I2S_Transmit_IT()
1201 if (hi2s->Init.Mode == I2S_MODE_SLAVE_TX) in HAL_I2S_Transmit_IT()
1203 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2S_Transmit_IT()
1207 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit_IT()
1209 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_IT()
1229 HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size) in HAL_I2S_Receive_IT() argument
1236 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive_IT()
1242 __HAL_LOCK(hi2s); in HAL_I2S_Receive_IT()
1245 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive_IT()
1246 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive_IT()
1247 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive_IT()
1248 hi2s->RxXferSize = Size; in HAL_I2S_Receive_IT()
1249 hi2s->RxXferCount = Size; in HAL_I2S_Receive_IT()
1252 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive_IT()
1253 hi2s->TxXferSize = (uint16_t) 0UL; in HAL_I2S_Receive_IT()
1254 hi2s->TxXferCount = (uint16_t) 0UL; in HAL_I2S_Receive_IT()
1257 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Receive_IT()
1259 hi2s->RxISR = I2S_Receive_32Bit_IT; in HAL_I2S_Receive_IT()
1263 hi2s->RxISR = I2S_Receive_16Bit_IT; in HAL_I2S_Receive_IT()
1267 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Receive_IT()
1270 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive_IT()
1273 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_RXP); in HAL_I2S_Receive_IT()
1277 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_OVR); in HAL_I2S_Receive_IT()
1281 if (hi2s->Init.Mode == I2S_MODE_SLAVE_RX) in HAL_I2S_Receive_IT()
1283 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2S_Receive_IT()
1287 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive_IT()
1289 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_IT()
1308 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, ui… in HAL_I2SEx_TransmitReceive_IT() argument
1316 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive_IT()
1322 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1324 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive_IT()
1325 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive_IT()
1327 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive_IT()
1328 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive_IT()
1329 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive_IT()
1330 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive_IT()
1332 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive_IT()
1333 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive_IT()
1337 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive_IT()
1339 hi2s->TxISR = I2S_Transmit_32Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1340 hi2s->RxISR = I2S_Receive_32Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1344 hi2s->TxISR = I2S_Transmit_16Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1345 hi2s->RxISR = I2S_Receive_16Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1349 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2SEx_TransmitReceive_IT()
1352 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1356 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP)); in HAL_I2SEx_TransmitReceive_IT()
1360 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_UDR | I2S_IT_OVR)); in HAL_I2SEx_TransmitReceive_IT()
1364 if (hi2s->Init.Mode == I2S_MODE_SLAVE_FULLDUPLEX) in HAL_I2SEx_TransmitReceive_IT()
1366 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2SEx_TransmitReceive_IT()
1370 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive_IT()
1372 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1391 HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Siz… in HAL_I2S_Transmit_DMA() argument
1400 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit_DMA()
1406 __HAL_LOCK(hi2s); in HAL_I2S_Transmit_DMA()
1409 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit_DMA()
1410 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit_DMA()
1411 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit_DMA()
1412 hi2s->TxXferSize = Size; in HAL_I2S_Transmit_DMA()
1413 hi2s->TxXferCount = Size; in HAL_I2S_Transmit_DMA()
1416 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit_DMA()
1417 hi2s->RxXferSize = (uint16_t)0UL; in HAL_I2S_Transmit_DMA()
1418 hi2s->RxXferCount = (uint16_t)0UL; in HAL_I2S_Transmit_DMA()
1421 hi2s->hdmatx->XferHalfCpltCallback = I2S_DMATxHalfCplt; in HAL_I2S_Transmit_DMA()
1424 hi2s->hdmatx->XferCpltCallback = I2S_DMATxCplt; in HAL_I2S_Transmit_DMA()
1427 hi2s->hdmatx->XferErrorCallback = I2S_DMAError; in HAL_I2S_Transmit_DMA()
1429 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2S_Transmit_DMA()
1431 hi2s->TxXferCount = Size * 2U; in HAL_I2S_Transmit_DMA()
1435 hi2s->TxXferCount = Size * 4U; in HAL_I2S_Transmit_DMA()
1439 if ((hi2s->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2S_Transmit_DMA()
1441 if (hi2s->hdmatx->LinkedListQueue != NULL) in HAL_I2S_Transmit_DMA()
1444 … hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->TxXferCount; in HAL_I2S_Transmit_DMA()
1447 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pTx… in HAL_I2S_Transmit_DMA()
1450 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2S_Transmit_DMA()
1452 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmatx); in HAL_I2S_Transmit_DMA()
1457 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Transmit_DMA()
1460 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1462 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit_DMA()
1469 …errorcode = HAL_DMA_Start_IT(hi2s->hdmatx, (uint32_t)hi2s->pTxBuffPtr, (uint32_t)&hi2s->Instance->… in HAL_I2S_Transmit_DMA()
1470 hi2s->TxXferCount); in HAL_I2S_Transmit_DMA()
1477 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Transmit_DMA()
1478 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit_DMA()
1480 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1487 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_UDR); in HAL_I2S_Transmit_DMA()
1491 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN)) in HAL_I2S_Transmit_DMA()
1494 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2S_Transmit_DMA()
1498 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2S_Transmit_DMA()
1501 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit_DMA()
1505 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit_DMA()
1507 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1525 HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size) in HAL_I2S_Receive_DMA() argument
1534 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive_DMA()
1540 __HAL_LOCK(hi2s); in HAL_I2S_Receive_DMA()
1543 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive_DMA()
1544 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive_DMA()
1545 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive_DMA()
1546 hi2s->RxXferSize = Size; in HAL_I2S_Receive_DMA()
1547 hi2s->RxXferCount = Size; in HAL_I2S_Receive_DMA()
1550 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive_DMA()
1551 hi2s->TxXferSize = (uint16_t)0UL; in HAL_I2S_Receive_DMA()
1552 hi2s->TxXferCount = (uint16_t)0UL; in HAL_I2S_Receive_DMA()
1556 hi2s->hdmarx->XferHalfCpltCallback = I2S_DMARxHalfCplt; in HAL_I2S_Receive_DMA()
1559 hi2s->hdmarx->XferCpltCallback = I2S_DMARxCplt; in HAL_I2S_Receive_DMA()
1562 hi2s->hdmarx->XferErrorCallback = I2S_DMAError; in HAL_I2S_Receive_DMA()
1564 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2S_Receive_DMA()
1566 hi2s->RxXferCount = Size * 2U; in HAL_I2S_Receive_DMA()
1570 hi2s->RxXferCount = Size * 4U; in HAL_I2S_Receive_DMA()
1574 if ((hi2s->hdmarx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2S_Receive_DMA()
1576 if (hi2s->hdmarx->LinkedListQueue != NULL) in HAL_I2S_Receive_DMA()
1579 … hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->RxXferCount; in HAL_I2S_Receive_DMA()
1582 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2S_Receive_DMA()
1585 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pRx… in HAL_I2S_Receive_DMA()
1587 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmarx); in HAL_I2S_Receive_DMA()
1592 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Receive_DMA()
1595 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1597 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive_DMA()
1604 …errorcode = HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->RXDR, (uint32_t)hi2s->pRxBuf… in HAL_I2S_Receive_DMA()
1605 hi2s->RxXferCount); in HAL_I2S_Receive_DMA()
1612 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Receive_DMA()
1613 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive_DMA()
1615 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1621 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_OVR); in HAL_I2S_Receive_DMA()
1625 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN)) in HAL_I2S_Receive_DMA()
1628 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2S_Receive_DMA()
1632 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2S_Receive_DMA()
1635 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive_DMA()
1639 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive_DMA()
1641 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1660 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, u… in HAL_I2SEx_TransmitReceive_DMA() argument
1671 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive_DMA()
1677 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1679 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive_DMA()
1680 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive_DMA()
1682 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive_DMA()
1683 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive_DMA()
1684 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive_DMA()
1685 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive_DMA()
1687 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive_DMA()
1688 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive_DMA()
1691 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN | SPI_CFG1_RXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1694 hi2s->hdmarx->XferHalfCpltCallback = I2SEx_DMATxRxHalfCplt; in HAL_I2SEx_TransmitReceive_DMA()
1697 hi2s->hdmarx->XferCpltCallback = I2SEx_DMATxRxCplt; in HAL_I2SEx_TransmitReceive_DMA()
1700 hi2s->hdmarx->XferErrorCallback = I2S_DMAError; in HAL_I2SEx_TransmitReceive_DMA()
1701 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2SEx_TransmitReceive_DMA()
1703 hi2s->TxXferCount = Size * 2U; in HAL_I2SEx_TransmitReceive_DMA()
1707 hi2s->TxXferCount = Size * 4U; in HAL_I2SEx_TransmitReceive_DMA()
1711 if ((hi2s->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2SEx_TransmitReceive_DMA()
1713 if (hi2s->hdmatx->LinkedListQueue != NULL) in HAL_I2SEx_TransmitReceive_DMA()
1716 … hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->TxXferCount; in HAL_I2SEx_TransmitReceive_DMA()
1719 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pTx… in HAL_I2SEx_TransmitReceive_DMA()
1722 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2SEx_TransmitReceive_DMA()
1724 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmatx); in HAL_I2SEx_TransmitReceive_DMA()
1729 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1732 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1734 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1741 …errorcode = HAL_DMA_Start_IT(hi2s->hdmatx, (uint32_t)hi2s->pTxBuffPtr, (uint32_t)&hi2s->Instance->… in HAL_I2SEx_TransmitReceive_DMA()
1742 hi2s->TxXferCount); in HAL_I2SEx_TransmitReceive_DMA()
1749 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1750 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1752 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1758 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN)) in HAL_I2SEx_TransmitReceive_DMA()
1761 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1764 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2SEx_TransmitReceive_DMA()
1766 hi2s->RxXferCount = Size * 2U; in HAL_I2SEx_TransmitReceive_DMA()
1770 hi2s->RxXferCount = Size * 4U; in HAL_I2SEx_TransmitReceive_DMA()
1774 if ((hi2s->hdmarx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2SEx_TransmitReceive_DMA()
1776 if (hi2s->hdmarx->LinkedListQueue != NULL) in HAL_I2SEx_TransmitReceive_DMA()
1779 … hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->RxXferCount; in HAL_I2SEx_TransmitReceive_DMA()
1782 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2SEx_TransmitReceive_DMA()
1785 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pRx… in HAL_I2SEx_TransmitReceive_DMA()
1787 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmarx); in HAL_I2SEx_TransmitReceive_DMA()
1792 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1795 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1797 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1804 …errorcode = HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->RXDR, (uint32_t)hi2s->pRxBuf… in HAL_I2SEx_TransmitReceive_DMA()
1805 hi2s->RxXferCount); in HAL_I2SEx_TransmitReceive_DMA()
1812 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1813 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1815 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1821 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_UDR | I2S_IT_OVR)); in HAL_I2SEx_TransmitReceive_DMA()
1825 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN)) in HAL_I2SEx_TransmitReceive_DMA()
1828 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1832 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2SEx_TransmitReceive_DMA()
1835 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1839 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive_DMA()
1841 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1851 HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAPause() argument
1854 __HAL_LOCK(hi2s); in HAL_I2S_DMAPause()
1863 if (IS_I2S_MASTER(hi2s->Init.Mode)) in HAL_I2S_DMAPause()
1866 if (HAL_IS_BIT_SET(hi2s->Instance->CR1, SPI_CR1_CSTART) == 0UL) in HAL_I2S_DMAPause()
1869 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_NO_OGT); in HAL_I2S_DMAPause()
1870 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1872 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1876 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSUSP); in HAL_I2S_DMAPause()
1878 while (HAL_IS_BIT_SET(hi2s->Instance->CR1, SPI_CR1_CSTART) != 0UL) in HAL_I2S_DMAPause()
1883 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1886 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1888 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_DMAPause()
1889 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1895 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DMAPause()
1897 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1900 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1907 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_NOT_SUPPORTED); in HAL_I2S_DMAPause()
1908 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1911 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1923 HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAResume() argument
1926 __HAL_LOCK(hi2s); in HAL_I2S_DMAResume()
1928 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_DMAResume()
1930 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAResume()
1932 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAResume()
1937 hi2s->State = HAL_I2S_STATE_BUSY; in HAL_I2S_DMAResume()
1938 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_DMAResume()
1941 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_DMAResume()
1944 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_DMAResume()
1947 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAResume()
1958 HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAStop() argument
1968 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2S_DMAStop()
1969 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2S_DMAStop()
1972 if (hi2s->hdmatx != NULL) in HAL_I2S_DMAStop()
1975 if (HAL_OK != HAL_DMA_Abort(hi2s->hdmatx)) in HAL_I2S_DMAStop()
1977 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_DMAStop()
1983 if (hi2s->hdmarx != NULL) in HAL_I2S_DMAStop()
1986 if (HAL_OK != HAL_DMA_Abort(hi2s->hdmarx)) in HAL_I2S_DMAStop()
1988 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_DMAStop()
1994 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DMAStop()
1996 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAStop()
2007 void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) in HAL_I2S_IRQHandler() argument
2009 uint32_t i2sier = hi2s->Instance->IER; in HAL_I2S_IRQHandler()
2010 uint32_t i2ssr = hi2s->Instance->SR; in HAL_I2S_IRQHandler()
2016 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2017 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2022 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2027 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2034 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2037 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2S_IRQHandler()
2040 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2043 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2S_IRQHandler()
2046 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2048 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2056 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2059 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2S_IRQHandler()
2062 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2066 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2S_IRQHandler()
2070 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2072 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2084 __weak void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_TxHalfCpltCallback() argument
2087 UNUSED(hi2s); in HAL_I2S_TxHalfCpltCallback()
2100 __weak void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_TxCpltCallback() argument
2103 UNUSED(hi2s); in HAL_I2S_TxCpltCallback()
2116 __weak void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_RxHalfCpltCallback() argument
2119 UNUSED(hi2s); in HAL_I2S_RxHalfCpltCallback()
2132 __weak void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_RxCpltCallback() argument
2135 UNUSED(hi2s); in HAL_I2S_RxCpltCallback()
2148 __weak void HAL_I2SEx_TxRxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2SEx_TxRxHalfCpltCallback() argument
2151 UNUSED(hi2s); in HAL_I2SEx_TxRxHalfCpltCallback()
2164 __weak void HAL_I2SEx_TxRxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2SEx_TxRxCpltCallback() argument
2167 UNUSED(hi2s); in HAL_I2SEx_TxRxCpltCallback()
2180 __weak void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_ErrorCallback() argument
2183 UNUSED(hi2s); in HAL_I2S_ErrorCallback()
2215 HAL_I2S_StateTypeDef HAL_I2S_GetState(const I2S_HandleTypeDef *hi2s) in HAL_I2S_GetState() argument
2217 return hi2s->State; in HAL_I2S_GetState()
2226 uint32_t HAL_I2S_GetError(const I2S_HandleTypeDef *hi2s) in HAL_I2S_GetError() argument
2228 return hi2s->ErrorCode; in HAL_I2S_GetError()
2250 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMATxCplt() local
2256 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in I2S_DMATxCplt()
2258 hi2s->TxXferCount = (uint16_t) 0UL; in I2S_DMATxCplt()
2259 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMATxCplt()
2263 hi2s->TxCpltCallback(hi2s); in I2S_DMATxCplt()
2265 HAL_I2S_TxCpltCallback(hi2s); in I2S_DMATxCplt()
2278 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMATxHalfCplt() local
2282 hi2s->TxHalfCpltCallback(hi2s); in I2S_DMATxHalfCplt()
2284 HAL_I2S_TxHalfCpltCallback(hi2s); in I2S_DMATxHalfCplt()
2297 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMARxCplt() local
2303 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in I2S_DMARxCplt()
2304 hi2s->RxXferCount = (uint16_t)0UL; in I2S_DMARxCplt()
2305 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMARxCplt()
2309 hi2s->RxCpltCallback(hi2s); in I2S_DMARxCplt()
2311 HAL_I2S_RxCpltCallback(hi2s); in I2S_DMARxCplt()
2324 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMARxHalfCplt() local
2328 hi2s->RxHalfCpltCallback(hi2s); in I2S_DMARxHalfCplt()
2330 HAL_I2S_RxHalfCpltCallback(hi2s); in I2S_DMARxHalfCplt()
2342 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2SEx_DMATxRxCplt() local
2348 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in I2SEx_DMATxRxCplt()
2349 hi2s->TxXferCount = (uint16_t) 0UL; in I2SEx_DMATxRxCplt()
2352 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in I2SEx_DMATxRxCplt()
2353 hi2s->RxXferCount = (uint16_t)0UL; in I2SEx_DMATxRxCplt()
2356 hi2s->State = HAL_I2S_STATE_READY; in I2SEx_DMATxRxCplt()
2361 hi2s->TxRxCpltCallback(hi2s); in I2SEx_DMATxRxCplt()
2363 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2SEx_DMATxRxCplt()
2375 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2SEx_DMATxRxHalfCplt() local
2379 hi2s->TxRxHalfCpltCallback(hi2s); in I2SEx_DMATxRxHalfCplt()
2381 HAL_I2SEx_TxRxHalfCpltCallback(hi2s); in I2SEx_DMATxRxHalfCplt()
2394 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMAError() local
2397 CLEAR_BIT(hi2s->Instance->CFG1, (SPI_CFG1_RXDMAEN | SPI_CFG1_TXDMAEN)); in I2S_DMAError()
2398 hi2s->TxXferCount = (uint16_t) 0UL; in I2S_DMAError()
2399 hi2s->RxXferCount = (uint16_t) 0UL; in I2S_DMAError()
2401 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMAError()
2404 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in I2S_DMAError()
2407 hi2s->ErrorCallback(hi2s); in I2S_DMAError()
2409 HAL_I2S_ErrorCallback(hi2s); in I2S_DMAError()
2419 static void I2S_Transmit_16Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Transmit_16Bit_IT() argument
2423 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in I2S_Transmit_16Bit_IT()
2425 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in I2S_Transmit_16Bit_IT()
2427 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in I2S_Transmit_16Bit_IT()
2429 hi2s->pTxBuffPtr++; in I2S_Transmit_16Bit_IT()
2430 hi2s->TxXferCount--; in I2S_Transmit_16Bit_IT()
2432 if (hi2s->TxXferCount == 0UL) in I2S_Transmit_16Bit_IT()
2435 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in I2S_Transmit_16Bit_IT()
2437 if ((hi2s->Init.Mode == I2S_MODE_SLAVE_TX) || (hi2s->Init.Mode == I2S_MODE_MASTER_TX)) in I2S_Transmit_16Bit_IT()
2439 hi2s->State = HAL_I2S_STATE_READY; in I2S_Transmit_16Bit_IT()
2443 hi2s->TxCpltCallback(hi2s); in I2S_Transmit_16Bit_IT()
2445 HAL_I2S_TxCpltCallback(hi2s); in I2S_Transmit_16Bit_IT()
2457 static void I2S_Transmit_32Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Transmit_32Bit_IT() argument
2460 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in I2S_Transmit_32Bit_IT()
2461 hi2s->pTxBuffPtr += 2; in I2S_Transmit_32Bit_IT()
2462 hi2s->TxXferCount--; in I2S_Transmit_32Bit_IT()
2464 if (hi2s->TxXferCount == 0UL) in I2S_Transmit_32Bit_IT()
2467 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in I2S_Transmit_32Bit_IT()
2469 if ((hi2s->Init.Mode == I2S_MODE_SLAVE_TX) || (hi2s->Init.Mode == I2S_MODE_MASTER_TX)) in I2S_Transmit_32Bit_IT()
2471 hi2s->State = HAL_I2S_STATE_READY; in I2S_Transmit_32Bit_IT()
2475 hi2s->TxCpltCallback(hi2s); in I2S_Transmit_32Bit_IT()
2477 HAL_I2S_TxCpltCallback(hi2s); in I2S_Transmit_32Bit_IT()
2489 static void I2S_Receive_16Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Receive_16Bit_IT() argument
2493 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in I2S_Receive_16Bit_IT()
2495 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in I2S_Receive_16Bit_IT()
2497 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in I2S_Receive_16Bit_IT()
2499 hi2s->pRxBuffPtr++; in I2S_Receive_16Bit_IT()
2500 hi2s->RxXferCount--; in I2S_Receive_16Bit_IT()
2502 if (hi2s->RxXferCount == 0UL) in I2S_Receive_16Bit_IT()
2504 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2507 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP | I2S_IT_ERR)); in I2S_Receive_16Bit_IT()
2512 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in I2S_Receive_16Bit_IT()
2515 hi2s->State = HAL_I2S_STATE_READY; in I2S_Receive_16Bit_IT()
2518 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2520 hi2s->TxRxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2524 hi2s->RxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2527 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2529 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2533 HAL_I2S_RxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2545 static void I2S_Receive_32Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Receive_32Bit_IT() argument
2548 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in I2S_Receive_32Bit_IT()
2549 hi2s->pRxBuffPtr += 2; in I2S_Receive_32Bit_IT()
2550 hi2s->RxXferCount--; in I2S_Receive_32Bit_IT()
2552 if (hi2s->RxXferCount == 0UL) in I2S_Receive_32Bit_IT()
2554 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2557 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP | I2S_IT_ERR)); in I2S_Receive_32Bit_IT()
2562 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in I2S_Receive_32Bit_IT()
2565 hi2s->State = HAL_I2S_STATE_READY; in I2S_Receive_32Bit_IT()
2568 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2570 hi2s->TxRxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2574 hi2s->RxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2577 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2579 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2583 HAL_I2S_RxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2599 static HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag, Flag… in I2S_WaitFlagStateUntilTimeout() argument
2603 while (((__HAL_I2S_GET_FLAG(hi2s, Flag)) ? SET : RESET) != State) in I2S_WaitFlagStateUntilTimeout()
2610 hi2s->State = HAL_I2S_STATE_READY; in I2S_WaitFlagStateUntilTimeout()
2613 __HAL_UNLOCK(hi2s); in I2S_WaitFlagStateUntilTimeout()