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) || (hi2s->Instance == SPI3)) in HAL_I2S_Init()
379 if (hi2s->Init.MCLKOutput == I2S_MCLKOUTPUT_ENABLE) in HAL_I2S_Init()
382 tmp = (uint32_t)((((i2sclk / (256UL >> ispcm)) * 10UL) / hi2s->Init.AudioFreq) + 5UL); in HAL_I2S_Init()
387 …tmp = (uint32_t)((((i2sclk / ((32UL >> ispcm) * packetlength)) * 10UL) / hi2s->Init.AudioFreq) + 5… in HAL_I2S_Init()
410 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_PRESCALER); in HAL_I2S_Init()
420 MODIFY_REG(hi2s->Instance->I2SCFGR, (SPI_I2SCFGR_I2SDIV | SPI_I2SCFGR_ODD), in HAL_I2S_Init()
427 MODIFY_REG(hi2s->Instance->I2SCFGR, (SPI_I2SCFGR_I2SMOD | SPI_I2SCFGR_I2SCFG | \ in HAL_I2S_Init()
432 (SPI_I2SCFGR_I2SMOD | hi2s->Init.Mode | \ in HAL_I2S_Init()
433 hi2s->Init.Standard | hi2s->Init.DataFormat | \ in HAL_I2S_Init()
434 hi2s->Init.CPOL | hi2s->Init.WSInversion | \ in HAL_I2S_Init()
435 hi2s->Init.Data24BitAlignment | hi2s->Init.MCLKOutput)); in HAL_I2S_Init()
437 WRITE_REG(hi2s->Instance->IFCR, 0x0FF8); in HAL_I2S_Init()
442 CLEAR_BIT(hi2s->Instance->CR1, SPI_CR1_IOLOCK); in HAL_I2S_Init()
444 MODIFY_REG(hi2s->Instance->CFG2, SPI_CFG2_LSBFRST, hi2s->Init.FirstBit); in HAL_I2S_Init()
447 if (IS_I2S_MASTER(hi2s->Init.Mode)) in HAL_I2S_Init()
450 MODIFY_REG(hi2s->Instance->CFG2, SPI_CFG2_AFCNTR, (hi2s->Init.MasterKeepIOState)); in HAL_I2S_Init()
453 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Init()
454 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Init()
465 HAL_StatusTypeDef HAL_I2S_DeInit(I2S_HandleTypeDef *hi2s) in HAL_I2S_DeInit() argument
468 if (hi2s == NULL) in HAL_I2S_DeInit()
474 assert_param(IS_I2S_ALL_INSTANCE(hi2s->Instance)); in HAL_I2S_DeInit()
476 hi2s->State = HAL_I2S_STATE_BUSY; in HAL_I2S_DeInit()
479 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DeInit()
482 if (hi2s->MspDeInitCallback == NULL) in HAL_I2S_DeInit()
484 hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit */ in HAL_I2S_DeInit()
488 hi2s->MspDeInitCallback(hi2s); in HAL_I2S_DeInit()
491 HAL_I2S_MspDeInit(hi2s); in HAL_I2S_DeInit()
494 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_DeInit()
495 hi2s->State = HAL_I2S_STATE_RESET; in HAL_I2S_DeInit()
498 __HAL_UNLOCK(hi2s); in HAL_I2S_DeInit()
509 __weak void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s) in HAL_I2S_MspInit() argument
512 UNUSED(hi2s); in HAL_I2S_MspInit()
525 __weak void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s) in HAL_I2S_MspDeInit() argument
528 UNUSED(hi2s); in HAL_I2S_MspDeInit()
545 HAL_StatusTypeDef HAL_I2S_RegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef Callb… in HAL_I2S_RegisterCallback() argument
553 hi2s->ErrorCode |= HAL_I2S_ERROR_INVALID_CALLBACK; in HAL_I2S_RegisterCallback()
558 __HAL_LOCK(hi2s); in HAL_I2S_RegisterCallback()
560 if (HAL_I2S_STATE_READY == hi2s->State) in HAL_I2S_RegisterCallback()
565 hi2s->TxCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
569 hi2s->RxCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
573 hi2s->TxRxCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
577 hi2s->TxHalfCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
581 hi2s->RxHalfCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
586 hi2s->TxRxHalfCpltCallback = pCallback; in HAL_I2S_RegisterCallback()
590 hi2s->ErrorCallback = pCallback; in HAL_I2S_RegisterCallback()
594 hi2s->MspInitCallback = pCallback; in HAL_I2S_RegisterCallback()
598 hi2s->MspDeInitCallback = pCallback; in HAL_I2S_RegisterCallback()
603 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_RegisterCallback()
610 else if (HAL_I2S_STATE_RESET == hi2s->State) in HAL_I2S_RegisterCallback()
615 hi2s->MspInitCallback = pCallback; in HAL_I2S_RegisterCallback()
619 hi2s->MspDeInitCallback = pCallback; in HAL_I2S_RegisterCallback()
624 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_RegisterCallback()
634 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_RegisterCallback()
641 __HAL_UNLOCK(hi2s); in HAL_I2S_RegisterCallback()
653 HAL_StatusTypeDef HAL_I2S_UnRegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef Cal… in HAL_I2S_UnRegisterCallback() argument
658 __HAL_LOCK(hi2s); in HAL_I2S_UnRegisterCallback()
660 if (HAL_I2S_STATE_READY == hi2s->State) in HAL_I2S_UnRegisterCallback()
665 …hi2s->TxCpltCallback = HAL_I2S_TxCpltCallback; /* Legacy weak TxCpltCallback … in HAL_I2S_UnRegisterCallback()
669 …hi2s->RxCpltCallback = HAL_I2S_RxCpltCallback; /* Legacy weak RxCpltCallback … in HAL_I2S_UnRegisterCallback()
673 …hi2s->TxRxCpltCallback = HAL_I2SEx_TxRxCpltCallback; /* Legacy weak TxRxCpltCallback … in HAL_I2S_UnRegisterCallback()
677 …hi2s->TxHalfCpltCallback = HAL_I2S_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
681 …hi2s->RxHalfCpltCallback = HAL_I2S_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
685 …hi2s->TxRxHalfCpltCallback = HAL_I2SEx_TxRxHalfCpltCallback; /* Legacy weak TxRxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
689 …hi2s->ErrorCallback = HAL_I2S_ErrorCallback; /* Legacy weak ErrorCallback … in HAL_I2S_UnRegisterCallback()
693 …hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit … in HAL_I2S_UnRegisterCallback()
697 …hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit … in HAL_I2S_UnRegisterCallback()
702 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
709 else if (HAL_I2S_STATE_RESET == hi2s->State) in HAL_I2S_UnRegisterCallback()
714 …hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit … in HAL_I2S_UnRegisterCallback()
718 …hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit … in HAL_I2S_UnRegisterCallback()
723 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
733 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
740 __HAL_UNLOCK(hi2s); in HAL_I2S_UnRegisterCallback()
809 HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Size, u… in HAL_I2S_Transmit() argument
812 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in HAL_I2S_Transmit()
821 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit()
827 __HAL_LOCK(hi2s); in HAL_I2S_Transmit()
833 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit()
834 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit()
835 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit()
836 hi2s->TxXferSize = Size; in HAL_I2S_Transmit()
837 hi2s->TxXferCount = Size; in HAL_I2S_Transmit()
840 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit()
841 hi2s->RxXferSize = (uint16_t) 0UL; in HAL_I2S_Transmit()
842 hi2s->RxXferCount = (uint16_t) 0UL; in HAL_I2S_Transmit()
845 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Transmit()
848 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit()
852 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit()
856 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Transmit()
859 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Transmit()
860 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
861 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
865 while (hi2s->TxXferCount > 0UL) in HAL_I2S_Transmit()
867 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Transmit()
870 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
871 hi2s->pTxBuffPtr += 2; in HAL_I2S_Transmit()
872 hi2s->TxXferCount--; in HAL_I2S_Transmit()
878 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
880 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
883 hi2s->pTxBuffPtr++; in HAL_I2S_Transmit()
884 hi2s->TxXferCount--; in HAL_I2S_Transmit()
888 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Transmit()
891 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Transmit()
892 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
893 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
898 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR) == SET) in HAL_I2S_Transmit()
901 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2S_Transmit()
904 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2S_Transmit()
908 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
909 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
930 HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t… in HAL_I2S_Receive() argument
933 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in HAL_I2S_Receive()
942 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive()
948 __HAL_LOCK(hi2s); in HAL_I2S_Receive()
954 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive()
955 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive()
956 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive()
957 hi2s->RxXferSize = Size; in HAL_I2S_Receive()
958 hi2s->RxXferCount = Size; in HAL_I2S_Receive()
961 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive()
962 hi2s->TxXferSize = (uint16_t) 0UL; in HAL_I2S_Receive()
963 hi2s->TxXferCount = (uint16_t) 0UL; in HAL_I2S_Receive()
966 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Receive()
969 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive()
973 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive()
976 while (hi2s->RxXferCount > 0UL) in HAL_I2S_Receive()
979 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_RXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Receive()
982 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Receive()
983 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive()
984 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive()
988 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Receive()
991 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in HAL_I2S_Receive()
992 hi2s->pRxBuffPtr += 2; in HAL_I2S_Receive()
993 hi2s->RxXferCount--; in HAL_I2S_Receive()
999 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in HAL_I2S_Receive()
1001 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in HAL_I2S_Receive()
1003 hi2s->pRxBuffPtr++; in HAL_I2S_Receive()
1004 hi2s->RxXferCount--; in HAL_I2S_Receive()
1008 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR) == SET) in HAL_I2S_Receive()
1011 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2S_Receive()
1014 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2S_Receive()
1018 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive()
1019 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive()
1040 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, uint1… in HAL_I2SEx_TransmitReceive() argument
1048 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in HAL_I2SEx_TransmitReceive()
1049 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in HAL_I2SEx_TransmitReceive()
1057 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive()
1063 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1068 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive()
1069 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive()
1070 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive()
1071 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive()
1072 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive()
1073 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive()
1075 tmp_TxXferCount = hi2s->TxXferCount; in HAL_I2SEx_TransmitReceive()
1076 tmp_RxXferCount = hi2s->RxXferCount; in HAL_I2SEx_TransmitReceive()
1079 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive()
1080 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive()
1083 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2SEx_TransmitReceive()
1086 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive()
1090 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive()
1094 if ((__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_TXP) == SET) && (tmp_TxXferCount != 0UL)) in HAL_I2SEx_TransmitReceive()
1096 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive()
1099 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1100 hi2s->pTxBuffPtr += 2; in HAL_I2SEx_TransmitReceive()
1107 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1109 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1112 hi2s->pTxBuffPtr++; in HAL_I2SEx_TransmitReceive()
1117 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR) == SET) in HAL_I2SEx_TransmitReceive()
1120 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2SEx_TransmitReceive()
1123 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2SEx_TransmitReceive()
1127 if ((__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_RXP) == SET) && (tmp_RxXferCount != 0UL)) in HAL_I2SEx_TransmitReceive()
1129 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive()
1132 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in HAL_I2SEx_TransmitReceive()
1133 hi2s->pRxBuffPtr += 2; in HAL_I2SEx_TransmitReceive()
1140 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in HAL_I2SEx_TransmitReceive()
1142 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in HAL_I2SEx_TransmitReceive()
1144 hi2s->pRxBuffPtr++; in HAL_I2SEx_TransmitReceive()
1149 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR) == SET) in HAL_I2SEx_TransmitReceive()
1152 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2SEx_TransmitReceive()
1155 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2SEx_TransmitReceive()
1163 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2SEx_TransmitReceive()
1164 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive()
1165 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1170 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive()
1171 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1189 HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Size) in HAL_I2S_Transmit_IT() argument
1196 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit_IT()
1202 __HAL_LOCK(hi2s); in HAL_I2S_Transmit_IT()
1205 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit_IT()
1206 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit_IT()
1207 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit_IT()
1208 hi2s->TxXferSize = Size; in HAL_I2S_Transmit_IT()
1209 hi2s->TxXferCount = Size; in HAL_I2S_Transmit_IT()
1212 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit_IT()
1213 hi2s->RxXferSize = (uint16_t) 0UL; in HAL_I2S_Transmit_IT()
1214 hi2s->RxXferCount = (uint16_t) 0UL; in HAL_I2S_Transmit_IT()
1217 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Transmit_IT()
1219 hi2s->TxISR = I2S_Transmit_32Bit_IT; in HAL_I2S_Transmit_IT()
1223 hi2s->TxISR = I2S_Transmit_16Bit_IT; in HAL_I2S_Transmit_IT()
1227 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Transmit_IT()
1230 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit_IT()
1234 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_UDR)); in HAL_I2S_Transmit_IT()
1237 if (hi2s->Init.Mode == I2S_MODE_SLAVE_TX) in HAL_I2S_Transmit_IT()
1239 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2S_Transmit_IT()
1243 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit_IT()
1245 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_IT()
1265 HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size) in HAL_I2S_Receive_IT() argument
1272 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive_IT()
1278 __HAL_LOCK(hi2s); in HAL_I2S_Receive_IT()
1281 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive_IT()
1282 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive_IT()
1283 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive_IT()
1284 hi2s->RxXferSize = Size; in HAL_I2S_Receive_IT()
1285 hi2s->RxXferCount = Size; in HAL_I2S_Receive_IT()
1288 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive_IT()
1289 hi2s->TxXferSize = (uint16_t) 0UL; in HAL_I2S_Receive_IT()
1290 hi2s->TxXferCount = (uint16_t) 0UL; in HAL_I2S_Receive_IT()
1293 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Receive_IT()
1295 hi2s->RxISR = I2S_Receive_32Bit_IT; in HAL_I2S_Receive_IT()
1299 hi2s->RxISR = I2S_Receive_16Bit_IT; in HAL_I2S_Receive_IT()
1303 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Receive_IT()
1306 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive_IT()
1309 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_OVR)); in HAL_I2S_Receive_IT()
1312 if (hi2s->Init.Mode == I2S_MODE_SLAVE_RX) in HAL_I2S_Receive_IT()
1314 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2S_Receive_IT()
1318 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive_IT()
1320 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_IT()
1339 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, ui… in HAL_I2SEx_TransmitReceive_IT() argument
1347 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive_IT()
1353 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1355 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive_IT()
1356 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive_IT()
1358 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive_IT()
1359 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive_IT()
1360 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive_IT()
1361 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive_IT()
1363 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive_IT()
1364 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive_IT()
1368 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive_IT()
1370 hi2s->TxISR = I2S_Transmit_32Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1371 hi2s->RxISR = I2S_Receive_32Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1375 hi2s->TxISR = I2S_Transmit_16Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1376 hi2s->RxISR = I2S_Receive_16Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1380 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2SEx_TransmitReceive_IT()
1383 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1387 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP | I2S_IT_UDR | I2S_IT_OVR)); in HAL_I2SEx_TransmitReceive_IT()
1390 if (hi2s->Init.Mode == I2S_MODE_SLAVE_FULLDUPLEX) in HAL_I2SEx_TransmitReceive_IT()
1392 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2SEx_TransmitReceive_IT()
1396 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive_IT()
1398 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1417 HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Siz… in HAL_I2S_Transmit_DMA() argument
1426 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit_DMA()
1432 __HAL_LOCK(hi2s); in HAL_I2S_Transmit_DMA()
1435 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit_DMA()
1436 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit_DMA()
1437 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit_DMA()
1438 hi2s->TxXferSize = Size; in HAL_I2S_Transmit_DMA()
1439 hi2s->TxXferCount = Size; in HAL_I2S_Transmit_DMA()
1442 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit_DMA()
1443 hi2s->RxXferSize = (uint16_t)0UL; in HAL_I2S_Transmit_DMA()
1444 hi2s->RxXferCount = (uint16_t)0UL; in HAL_I2S_Transmit_DMA()
1447 hi2s->hdmatx->XferHalfCpltCallback = I2S_DMATxHalfCplt; in HAL_I2S_Transmit_DMA()
1450 hi2s->hdmatx->XferCpltCallback = I2S_DMATxCplt; in HAL_I2S_Transmit_DMA()
1453 hi2s->hdmatx->XferErrorCallback = I2S_DMAError; in HAL_I2S_Transmit_DMA()
1455 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2S_Transmit_DMA()
1457 hi2s->TxXferCount = Size * 2U; in HAL_I2S_Transmit_DMA()
1461 hi2s->TxXferCount = Size * 4U; in HAL_I2S_Transmit_DMA()
1465 if ((hi2s->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2S_Transmit_DMA()
1467 if (hi2s->hdmatx->LinkedListQueue != NULL) in HAL_I2S_Transmit_DMA()
1470 … hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->TxXferCount; in HAL_I2S_Transmit_DMA()
1473 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pTx… in HAL_I2S_Transmit_DMA()
1476 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2S_Transmit_DMA()
1478 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmatx); in HAL_I2S_Transmit_DMA()
1483 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Transmit_DMA()
1486 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1488 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit_DMA()
1495 …errorcode = HAL_DMA_Start_IT(hi2s->hdmatx, (uint32_t)hi2s->pTxBuffPtr, (uint32_t)&hi2s->Instance->… in HAL_I2S_Transmit_DMA()
1496 hi2s->TxXferCount); in HAL_I2S_Transmit_DMA()
1503 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Transmit_DMA()
1504 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit_DMA()
1506 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1512 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN)) in HAL_I2S_Transmit_DMA()
1515 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2S_Transmit_DMA()
1519 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2S_Transmit_DMA()
1522 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit_DMA()
1526 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit_DMA()
1528 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1546 HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size) in HAL_I2S_Receive_DMA() argument
1555 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive_DMA()
1561 __HAL_LOCK(hi2s); in HAL_I2S_Receive_DMA()
1564 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive_DMA()
1565 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive_DMA()
1566 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive_DMA()
1567 hi2s->RxXferSize = Size; in HAL_I2S_Receive_DMA()
1568 hi2s->RxXferCount = Size; in HAL_I2S_Receive_DMA()
1571 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive_DMA()
1572 hi2s->TxXferSize = (uint16_t)0UL; in HAL_I2S_Receive_DMA()
1573 hi2s->TxXferCount = (uint16_t)0UL; in HAL_I2S_Receive_DMA()
1577 hi2s->hdmarx->XferHalfCpltCallback = I2S_DMARxHalfCplt; in HAL_I2S_Receive_DMA()
1580 hi2s->hdmarx->XferCpltCallback = I2S_DMARxCplt; in HAL_I2S_Receive_DMA()
1583 hi2s->hdmarx->XferErrorCallback = I2S_DMAError; in HAL_I2S_Receive_DMA()
1585 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2S_Receive_DMA()
1587 hi2s->RxXferCount = Size * 2U; in HAL_I2S_Receive_DMA()
1591 hi2s->RxXferCount = Size * 4U; in HAL_I2S_Receive_DMA()
1595 if ((hi2s->hdmarx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2S_Receive_DMA()
1597 if (hi2s->hdmarx->LinkedListQueue != NULL) in HAL_I2S_Receive_DMA()
1600 … hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->RxXferCount; in HAL_I2S_Receive_DMA()
1603 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2S_Receive_DMA()
1606 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pRx… in HAL_I2S_Receive_DMA()
1608 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmarx); in HAL_I2S_Receive_DMA()
1613 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Receive_DMA()
1616 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1618 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive_DMA()
1625 …errorcode = HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->RXDR, (uint32_t)hi2s->pRxBuf… in HAL_I2S_Receive_DMA()
1626 hi2s->RxXferCount); in HAL_I2S_Receive_DMA()
1633 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Receive_DMA()
1634 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive_DMA()
1636 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1641 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN)) in HAL_I2S_Receive_DMA()
1644 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2S_Receive_DMA()
1648 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2S_Receive_DMA()
1651 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive_DMA()
1655 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive_DMA()
1657 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1676 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, u… in HAL_I2SEx_TransmitReceive_DMA() argument
1687 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive_DMA()
1693 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1695 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive_DMA()
1696 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive_DMA()
1698 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive_DMA()
1699 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive_DMA()
1700 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive_DMA()
1701 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive_DMA()
1703 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive_DMA()
1704 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive_DMA()
1707 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN | SPI_CFG1_RXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1710 hi2s->hdmarx->XferHalfCpltCallback = I2SEx_DMATxRxHalfCplt; in HAL_I2SEx_TransmitReceive_DMA()
1713 hi2s->hdmarx->XferCpltCallback = I2SEx_DMATxRxCplt; in HAL_I2SEx_TransmitReceive_DMA()
1716 hi2s->hdmarx->XferErrorCallback = I2S_DMAError; in HAL_I2SEx_TransmitReceive_DMA()
1717 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2SEx_TransmitReceive_DMA()
1719 hi2s->TxXferCount = Size * 2U; in HAL_I2SEx_TransmitReceive_DMA()
1723 hi2s->TxXferCount = Size * 4U; in HAL_I2SEx_TransmitReceive_DMA()
1727 if ((hi2s->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2SEx_TransmitReceive_DMA()
1729 if (hi2s->hdmatx->LinkedListQueue != NULL) in HAL_I2SEx_TransmitReceive_DMA()
1732 … hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->TxXferCount; in HAL_I2SEx_TransmitReceive_DMA()
1735 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pTx… in HAL_I2SEx_TransmitReceive_DMA()
1738 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2SEx_TransmitReceive_DMA()
1740 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmatx); in HAL_I2SEx_TransmitReceive_DMA()
1745 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1748 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1750 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1757 …errorcode = HAL_DMA_Start_IT(hi2s->hdmatx, (uint32_t)hi2s->pTxBuffPtr, (uint32_t)&hi2s->Instance->… in HAL_I2SEx_TransmitReceive_DMA()
1758 hi2s->TxXferCount); in HAL_I2SEx_TransmitReceive_DMA()
1765 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1766 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1768 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1774 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN)) in HAL_I2SEx_TransmitReceive_DMA()
1777 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1780 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2SEx_TransmitReceive_DMA()
1782 hi2s->RxXferCount = Size * 2U; in HAL_I2SEx_TransmitReceive_DMA()
1786 hi2s->RxXferCount = Size * 4U; in HAL_I2SEx_TransmitReceive_DMA()
1790 if ((hi2s->hdmarx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2SEx_TransmitReceive_DMA()
1792 if (hi2s->hdmarx->LinkedListQueue != NULL) in HAL_I2SEx_TransmitReceive_DMA()
1795 … hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->RxXferCount; in HAL_I2SEx_TransmitReceive_DMA()
1798 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2SEx_TransmitReceive_DMA()
1801 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pRx… in HAL_I2SEx_TransmitReceive_DMA()
1803 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmarx); in HAL_I2SEx_TransmitReceive_DMA()
1808 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1811 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1813 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1820 …errorcode = HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->RXDR, (uint32_t)hi2s->pRxBuf… in HAL_I2SEx_TransmitReceive_DMA()
1821 hi2s->RxXferCount); in HAL_I2SEx_TransmitReceive_DMA()
1828 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1829 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1831 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1836 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN)) in HAL_I2SEx_TransmitReceive_DMA()
1839 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1843 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2SEx_TransmitReceive_DMA()
1846 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1850 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive_DMA()
1852 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1862 HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAPause() argument
1865 __HAL_LOCK(hi2s); in HAL_I2S_DMAPause()
1874 if (IS_I2S_MASTER(hi2s->Init.Mode)) in HAL_I2S_DMAPause()
1877 if (HAL_IS_BIT_SET(hi2s->Instance->CR1, SPI_CR1_CSTART) == 0UL) in HAL_I2S_DMAPause()
1880 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_NO_OGT); in HAL_I2S_DMAPause()
1881 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1883 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1887 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSUSP); in HAL_I2S_DMAPause()
1889 while (HAL_IS_BIT_SET(hi2s->Instance->CR1, SPI_CR1_CSTART) != 0UL) in HAL_I2S_DMAPause()
1894 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1897 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1899 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_DMAPause()
1900 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1906 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DMAPause()
1908 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1911 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1918 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_NOT_SUPPORTED); in HAL_I2S_DMAPause()
1919 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1922 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1934 HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAResume() argument
1937 __HAL_LOCK(hi2s); in HAL_I2S_DMAResume()
1939 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_DMAResume()
1941 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAResume()
1943 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAResume()
1948 hi2s->State = HAL_I2S_STATE_BUSY; in HAL_I2S_DMAResume()
1949 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_DMAResume()
1952 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_DMAResume()
1955 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_DMAResume()
1958 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAResume()
1969 HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAStop() argument
1979 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2S_DMAStop()
1980 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2S_DMAStop()
1983 if (hi2s->hdmatx != NULL) in HAL_I2S_DMAStop()
1986 if (HAL_OK != HAL_DMA_Abort(hi2s->hdmatx)) in HAL_I2S_DMAStop()
1988 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_DMAStop()
1994 if (hi2s->hdmarx != NULL) in HAL_I2S_DMAStop()
1997 if (HAL_OK != HAL_DMA_Abort(hi2s->hdmarx)) in HAL_I2S_DMAStop()
1999 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_DMAStop()
2005 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DMAStop()
2007 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAStop()
2018 void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) in HAL_I2S_IRQHandler() argument
2020 uint32_t i2sier = hi2s->Instance->IER; in HAL_I2S_IRQHandler()
2021 uint32_t i2ssr = hi2s->Instance->SR; in HAL_I2S_IRQHandler()
2024 if (hi2s->State == HAL_I2S_STATE_BUSY_RX) in HAL_I2S_IRQHandler()
2029 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2036 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2039 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2S_IRQHandler()
2042 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2046 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2S_IRQHandler()
2049 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2051 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2056 if (hi2s->State == HAL_I2S_STATE_BUSY_TX) in HAL_I2S_IRQHandler()
2061 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2068 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2071 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2S_IRQHandler()
2074 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2077 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2S_IRQHandler()
2080 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2082 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2086 if (hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) in HAL_I2S_IRQHandler()
2091 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2092 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2097 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2102 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2109 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2112 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2S_IRQHandler()
2115 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2118 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2S_IRQHandler()
2121 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2123 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2131 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2134 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2S_IRQHandler()
2137 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2141 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2S_IRQHandler()
2145 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2147 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2159 __weak void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_TxHalfCpltCallback() argument
2162 UNUSED(hi2s); in HAL_I2S_TxHalfCpltCallback()
2175 __weak void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_TxCpltCallback() argument
2178 UNUSED(hi2s); in HAL_I2S_TxCpltCallback()
2191 __weak void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_RxHalfCpltCallback() argument
2194 UNUSED(hi2s); in HAL_I2S_RxHalfCpltCallback()
2207 __weak void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_RxCpltCallback() argument
2210 UNUSED(hi2s); in HAL_I2S_RxCpltCallback()
2223 __weak void HAL_I2SEx_TxRxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2SEx_TxRxHalfCpltCallback() argument
2226 UNUSED(hi2s); in HAL_I2SEx_TxRxHalfCpltCallback()
2239 __weak void HAL_I2SEx_TxRxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2SEx_TxRxCpltCallback() argument
2242 UNUSED(hi2s); in HAL_I2SEx_TxRxCpltCallback()
2255 __weak void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_ErrorCallback() argument
2258 UNUSED(hi2s); in HAL_I2S_ErrorCallback()
2290 HAL_I2S_StateTypeDef HAL_I2S_GetState(const I2S_HandleTypeDef *hi2s) in HAL_I2S_GetState() argument
2292 return hi2s->State; in HAL_I2S_GetState()
2301 uint32_t HAL_I2S_GetError(const I2S_HandleTypeDef *hi2s) in HAL_I2S_GetError() argument
2303 return hi2s->ErrorCode; in HAL_I2S_GetError()
2325 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMATxCplt() local
2331 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in I2S_DMATxCplt()
2333 hi2s->TxXferCount = (uint16_t) 0UL; in I2S_DMATxCplt()
2334 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMATxCplt()
2338 hi2s->TxCpltCallback(hi2s); in I2S_DMATxCplt()
2340 HAL_I2S_TxCpltCallback(hi2s); in I2S_DMATxCplt()
2353 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMATxHalfCplt() local
2357 hi2s->TxHalfCpltCallback(hi2s); in I2S_DMATxHalfCplt()
2359 HAL_I2S_TxHalfCpltCallback(hi2s); in I2S_DMATxHalfCplt()
2372 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMARxCplt() local
2378 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in I2S_DMARxCplt()
2379 hi2s->RxXferCount = (uint16_t)0UL; in I2S_DMARxCplt()
2380 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMARxCplt()
2384 hi2s->RxCpltCallback(hi2s); in I2S_DMARxCplt()
2386 HAL_I2S_RxCpltCallback(hi2s); in I2S_DMARxCplt()
2399 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMARxHalfCplt() local
2403 hi2s->RxHalfCpltCallback(hi2s); in I2S_DMARxHalfCplt()
2405 HAL_I2S_RxHalfCpltCallback(hi2s); in I2S_DMARxHalfCplt()
2417 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2SEx_DMATxRxCplt() local
2423 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in I2SEx_DMATxRxCplt()
2424 hi2s->TxXferCount = (uint16_t) 0UL; in I2SEx_DMATxRxCplt()
2427 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in I2SEx_DMATxRxCplt()
2428 hi2s->RxXferCount = (uint16_t)0UL; in I2SEx_DMATxRxCplt()
2431 hi2s->State = HAL_I2S_STATE_READY; in I2SEx_DMATxRxCplt()
2436 hi2s->TxRxCpltCallback(hi2s); in I2SEx_DMATxRxCplt()
2438 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2SEx_DMATxRxCplt()
2450 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2SEx_DMATxRxHalfCplt() local
2454 hi2s->TxRxHalfCpltCallback(hi2s); in I2SEx_DMATxRxHalfCplt()
2456 HAL_I2SEx_TxRxHalfCpltCallback(hi2s); in I2SEx_DMATxRxHalfCplt()
2469 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMAError() local
2472 CLEAR_BIT(hi2s->Instance->CFG1, (SPI_CFG1_RXDMAEN | SPI_CFG1_TXDMAEN)); in I2S_DMAError()
2473 hi2s->TxXferCount = (uint16_t) 0UL; in I2S_DMAError()
2474 hi2s->RxXferCount = (uint16_t) 0UL; in I2S_DMAError()
2476 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMAError()
2479 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in I2S_DMAError()
2482 hi2s->ErrorCallback(hi2s); in I2S_DMAError()
2484 HAL_I2S_ErrorCallback(hi2s); in I2S_DMAError()
2494 static void I2S_Transmit_16Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Transmit_16Bit_IT() argument
2498 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in I2S_Transmit_16Bit_IT()
2500 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in I2S_Transmit_16Bit_IT()
2502 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in I2S_Transmit_16Bit_IT()
2504 hi2s->pTxBuffPtr++; in I2S_Transmit_16Bit_IT()
2505 hi2s->TxXferCount--; in I2S_Transmit_16Bit_IT()
2507 if (hi2s->TxXferCount == 0UL) in I2S_Transmit_16Bit_IT()
2510 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in I2S_Transmit_16Bit_IT()
2512 if ((hi2s->Init.Mode == I2S_MODE_SLAVE_TX) || (hi2s->Init.Mode == I2S_MODE_MASTER_TX)) in I2S_Transmit_16Bit_IT()
2514 hi2s->State = HAL_I2S_STATE_READY; in I2S_Transmit_16Bit_IT()
2518 hi2s->TxCpltCallback(hi2s); in I2S_Transmit_16Bit_IT()
2520 HAL_I2S_TxCpltCallback(hi2s); in I2S_Transmit_16Bit_IT()
2532 static void I2S_Transmit_32Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Transmit_32Bit_IT() argument
2535 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in I2S_Transmit_32Bit_IT()
2536 hi2s->pTxBuffPtr += 2; in I2S_Transmit_32Bit_IT()
2537 hi2s->TxXferCount--; in I2S_Transmit_32Bit_IT()
2539 if (hi2s->TxXferCount == 0UL) in I2S_Transmit_32Bit_IT()
2542 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in I2S_Transmit_32Bit_IT()
2544 if ((hi2s->Init.Mode == I2S_MODE_SLAVE_TX) || (hi2s->Init.Mode == I2S_MODE_MASTER_TX)) in I2S_Transmit_32Bit_IT()
2546 hi2s->State = HAL_I2S_STATE_READY; in I2S_Transmit_32Bit_IT()
2550 hi2s->TxCpltCallback(hi2s); in I2S_Transmit_32Bit_IT()
2552 HAL_I2S_TxCpltCallback(hi2s); in I2S_Transmit_32Bit_IT()
2564 static void I2S_Receive_16Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Receive_16Bit_IT() argument
2568 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in I2S_Receive_16Bit_IT()
2570 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in I2S_Receive_16Bit_IT()
2572 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in I2S_Receive_16Bit_IT()
2574 hi2s->pRxBuffPtr++; in I2S_Receive_16Bit_IT()
2575 hi2s->RxXferCount--; in I2S_Receive_16Bit_IT()
2577 if (hi2s->RxXferCount == 0UL) in I2S_Receive_16Bit_IT()
2579 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2582 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP | I2S_IT_ERR)); in I2S_Receive_16Bit_IT()
2587 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in I2S_Receive_16Bit_IT()
2590 hi2s->State = HAL_I2S_STATE_READY; in I2S_Receive_16Bit_IT()
2593 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2595 hi2s->TxRxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2599 hi2s->RxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2602 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2604 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2608 HAL_I2S_RxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2620 static void I2S_Receive_32Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Receive_32Bit_IT() argument
2623 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in I2S_Receive_32Bit_IT()
2624 hi2s->pRxBuffPtr += 2; in I2S_Receive_32Bit_IT()
2625 hi2s->RxXferCount--; in I2S_Receive_32Bit_IT()
2627 if (hi2s->RxXferCount == 0UL) in I2S_Receive_32Bit_IT()
2629 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2632 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP | I2S_IT_ERR)); in I2S_Receive_32Bit_IT()
2637 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in I2S_Receive_32Bit_IT()
2640 hi2s->State = HAL_I2S_STATE_READY; in I2S_Receive_32Bit_IT()
2643 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2645 hi2s->TxRxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2649 hi2s->RxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2652 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2654 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2658 HAL_I2S_RxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2674 static HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag, Flag… in I2S_WaitFlagStateUntilTimeout() argument
2678 while (((__HAL_I2S_GET_FLAG(hi2s, Flag)) ? SET : RESET) != State) in I2S_WaitFlagStateUntilTimeout()
2685 hi2s->State = HAL_I2S_STATE_READY; in I2S_WaitFlagStateUntilTimeout()
2688 __HAL_UNLOCK(hi2s); in I2S_WaitFlagStateUntilTimeout()