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()
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()
547 HAL_StatusTypeDef HAL_I2S_RegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef Callb… in HAL_I2S_RegisterCallback() argument
555 hi2s->ErrorCode |= HAL_I2S_ERROR_INVALID_CALLBACK; 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()
653 HAL_StatusTypeDef HAL_I2S_UnRegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef Cal… in HAL_I2S_UnRegisterCallback() argument
657 if (HAL_I2S_STATE_READY == hi2s->State) in HAL_I2S_UnRegisterCallback()
662 …hi2s->TxCpltCallback = HAL_I2S_TxCpltCallback; /* Legacy weak TxCpltCallback … in HAL_I2S_UnRegisterCallback()
666 …hi2s->RxCpltCallback = HAL_I2S_RxCpltCallback; /* Legacy weak RxCpltCallback … in HAL_I2S_UnRegisterCallback()
670 …hi2s->TxRxCpltCallback = HAL_I2SEx_TxRxCpltCallback; /* Legacy weak TxRxCpltCallback … in HAL_I2S_UnRegisterCallback()
674 …hi2s->TxHalfCpltCallback = HAL_I2S_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
678 …hi2s->RxHalfCpltCallback = HAL_I2S_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
682 …hi2s->TxRxHalfCpltCallback = HAL_I2SEx_TxRxHalfCpltCallback; /* Legacy weak TxRxHalfCpltCallback … in HAL_I2S_UnRegisterCallback()
686 …hi2s->ErrorCallback = HAL_I2S_ErrorCallback; /* Legacy weak ErrorCallback … in HAL_I2S_UnRegisterCallback()
690 …hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit … in HAL_I2S_UnRegisterCallback()
694 …hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit … in HAL_I2S_UnRegisterCallback()
699 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
706 else if (HAL_I2S_STATE_RESET == hi2s->State) in HAL_I2S_UnRegisterCallback()
711 …hi2s->MspInitCallback = HAL_I2S_MspInit; /* Legacy weak MspInit … in HAL_I2S_UnRegisterCallback()
715 …hi2s->MspDeInitCallback = HAL_I2S_MspDeInit; /* Legacy weak MspDeInit … in HAL_I2S_UnRegisterCallback()
720 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
730 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_INVALID_CALLBACK); in HAL_I2S_UnRegisterCallback()
804 HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Size, u… in HAL_I2S_Transmit() argument
807 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in HAL_I2S_Transmit()
816 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit()
822 __HAL_LOCK(hi2s); in HAL_I2S_Transmit()
828 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit()
829 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit()
830 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit()
831 hi2s->TxXferSize = Size; in HAL_I2S_Transmit()
832 hi2s->TxXferCount = Size; in HAL_I2S_Transmit()
835 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit()
836 hi2s->RxXferSize = (uint16_t) 0UL; in HAL_I2S_Transmit()
837 hi2s->RxXferCount = (uint16_t) 0UL; in HAL_I2S_Transmit()
840 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Transmit()
843 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit()
847 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit()
851 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Transmit()
854 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Transmit()
855 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
856 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
860 while (hi2s->TxXferCount > 0UL) in HAL_I2S_Transmit()
862 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Transmit()
865 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
866 hi2s->pTxBuffPtr += 2; in HAL_I2S_Transmit()
867 hi2s->TxXferCount--; in HAL_I2S_Transmit()
873 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
875 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2S_Transmit()
878 hi2s->pTxBuffPtr++; in HAL_I2S_Transmit()
879 hi2s->TxXferCount--; in HAL_I2S_Transmit()
883 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_TXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Transmit()
886 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Transmit()
887 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
888 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
893 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR) == SET) in HAL_I2S_Transmit()
896 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2S_Transmit()
899 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2S_Transmit()
903 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit()
904 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit()
925 HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t… in HAL_I2S_Receive() argument
928 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in HAL_I2S_Receive()
937 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive()
943 __HAL_LOCK(hi2s); in HAL_I2S_Receive()
949 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive()
950 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive()
951 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive()
952 hi2s->RxXferSize = Size; in HAL_I2S_Receive()
953 hi2s->RxXferCount = Size; in HAL_I2S_Receive()
956 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive()
957 hi2s->TxXferSize = (uint16_t) 0UL; in HAL_I2S_Receive()
958 hi2s->TxXferCount = (uint16_t) 0UL; in HAL_I2S_Receive()
961 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Receive()
964 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive()
968 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive()
971 while (hi2s->RxXferCount > 0UL) in HAL_I2S_Receive()
974 if (I2S_WaitFlagStateUntilTimeout(hi2s, I2S_FLAG_RXP, SET, tickstart, Timeout) != HAL_OK) in HAL_I2S_Receive()
977 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_Receive()
978 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive()
979 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive()
983 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Receive()
986 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in HAL_I2S_Receive()
987 hi2s->pRxBuffPtr += 2; in HAL_I2S_Receive()
988 hi2s->RxXferCount--; in HAL_I2S_Receive()
994 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in HAL_I2S_Receive()
996 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in HAL_I2S_Receive()
998 hi2s->pRxBuffPtr++; in HAL_I2S_Receive()
999 hi2s->RxXferCount--; in HAL_I2S_Receive()
1003 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR) == SET) in HAL_I2S_Receive()
1006 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2S_Receive()
1009 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2S_Receive()
1013 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive()
1014 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive()
1035 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, uint1… in HAL_I2SEx_TransmitReceive() argument
1043 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in HAL_I2SEx_TransmitReceive()
1044 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in HAL_I2SEx_TransmitReceive()
1052 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive()
1058 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1063 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive()
1064 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive()
1065 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive()
1066 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive()
1067 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive()
1068 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive()
1070 tmp_TxXferCount = hi2s->TxXferCount; in HAL_I2SEx_TransmitReceive()
1071 tmp_RxXferCount = hi2s->RxXferCount; in HAL_I2SEx_TransmitReceive()
1074 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive()
1075 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive()
1078 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2SEx_TransmitReceive()
1081 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive()
1085 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive()
1089 if ((__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_TXP) == SET) && (tmp_TxXferCount != 0UL)) in HAL_I2SEx_TransmitReceive()
1091 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive()
1094 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1095 hi2s->pTxBuffPtr += 2; in HAL_I2SEx_TransmitReceive()
1102 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1104 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in HAL_I2SEx_TransmitReceive()
1107 hi2s->pTxBuffPtr++; in HAL_I2SEx_TransmitReceive()
1112 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_UDR) == SET) in HAL_I2SEx_TransmitReceive()
1115 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2SEx_TransmitReceive()
1118 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2SEx_TransmitReceive()
1122 if ((__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_RXP) == SET) && (tmp_RxXferCount != 0UL)) in HAL_I2SEx_TransmitReceive()
1124 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive()
1127 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in HAL_I2SEx_TransmitReceive()
1128 hi2s->pRxBuffPtr += 2; in HAL_I2SEx_TransmitReceive()
1135 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in HAL_I2SEx_TransmitReceive()
1137 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in HAL_I2SEx_TransmitReceive()
1139 hi2s->pRxBuffPtr++; in HAL_I2SEx_TransmitReceive()
1144 if (__HAL_I2S_GET_FLAG(hi2s, I2S_FLAG_OVR) == SET) in HAL_I2SEx_TransmitReceive()
1147 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2SEx_TransmitReceive()
1150 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2SEx_TransmitReceive()
1158 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2SEx_TransmitReceive()
1159 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive()
1160 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1165 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive()
1166 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive()
1184 HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Size) in HAL_I2S_Transmit_IT() argument
1191 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit_IT()
1197 __HAL_LOCK(hi2s); in HAL_I2S_Transmit_IT()
1200 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit_IT()
1201 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit_IT()
1202 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit_IT()
1203 hi2s->TxXferSize = Size; in HAL_I2S_Transmit_IT()
1204 hi2s->TxXferCount = Size; in HAL_I2S_Transmit_IT()
1207 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit_IT()
1208 hi2s->RxXferSize = (uint16_t) 0UL; in HAL_I2S_Transmit_IT()
1209 hi2s->RxXferCount = (uint16_t) 0UL; in HAL_I2S_Transmit_IT()
1212 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Transmit_IT()
1214 hi2s->TxISR = I2S_Transmit_32Bit_IT; in HAL_I2S_Transmit_IT()
1218 hi2s->TxISR = I2S_Transmit_16Bit_IT; in HAL_I2S_Transmit_IT()
1222 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Transmit_IT()
1225 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit_IT()
1229 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_UDR)); in HAL_I2S_Transmit_IT()
1232 if (hi2s->Init.Mode == I2S_MODE_SLAVE_TX) in HAL_I2S_Transmit_IT()
1234 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2S_Transmit_IT()
1238 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit_IT()
1240 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_IT()
1260 HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size) in HAL_I2S_Receive_IT() argument
1267 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive_IT()
1273 __HAL_LOCK(hi2s); in HAL_I2S_Receive_IT()
1276 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive_IT()
1277 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive_IT()
1278 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive_IT()
1279 hi2s->RxXferSize = Size; in HAL_I2S_Receive_IT()
1280 hi2s->RxXferCount = Size; in HAL_I2S_Receive_IT()
1283 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive_IT()
1284 hi2s->TxXferSize = (uint16_t) 0UL; in HAL_I2S_Receive_IT()
1285 hi2s->TxXferCount = (uint16_t) 0UL; in HAL_I2S_Receive_IT()
1288 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2S_Receive_IT()
1290 hi2s->RxISR = I2S_Receive_32Bit_IT; in HAL_I2S_Receive_IT()
1294 hi2s->RxISR = I2S_Receive_16Bit_IT; in HAL_I2S_Receive_IT()
1298 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2S_Receive_IT()
1301 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive_IT()
1304 __HAL_I2S_ENABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_OVR)); in HAL_I2S_Receive_IT()
1307 if (hi2s->Init.Mode == I2S_MODE_SLAVE_RX) in HAL_I2S_Receive_IT()
1309 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2S_Receive_IT()
1313 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive_IT()
1315 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_IT()
1334 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, ui… in HAL_I2SEx_TransmitReceive_IT() argument
1342 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive_IT()
1348 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1350 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive_IT()
1351 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive_IT()
1353 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive_IT()
1354 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive_IT()
1355 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive_IT()
1356 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive_IT()
1358 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive_IT()
1359 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive_IT()
1363 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_24B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_32B)) in HAL_I2SEx_TransmitReceive_IT()
1365 hi2s->TxISR = I2S_Transmit_32Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1366 hi2s->RxISR = I2S_Receive_32Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1370 hi2s->TxISR = I2S_Transmit_16Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1371 hi2s->RxISR = I2S_Receive_16Bit_IT; in HAL_I2SEx_TransmitReceive_IT()
1375 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) in HAL_I2SEx_TransmitReceive_IT()
1378 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1382 __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()
1385 if (hi2s->Init.Mode == I2S_MODE_SLAVE_FULLDUPLEX) in HAL_I2SEx_TransmitReceive_IT()
1387 __HAL_I2S_ENABLE_IT(hi2s, I2S_IT_FRE); in HAL_I2SEx_TransmitReceive_IT()
1391 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive_IT()
1393 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_IT()
1412 HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, const uint16_t *pData, uint16_t Siz… in HAL_I2S_Transmit_DMA() argument
1421 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Transmit_DMA()
1427 __HAL_LOCK(hi2s); in HAL_I2S_Transmit_DMA()
1430 hi2s->State = HAL_I2S_STATE_BUSY_TX; in HAL_I2S_Transmit_DMA()
1431 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Transmit_DMA()
1432 hi2s->pTxBuffPtr = (const uint16_t *)pData; in HAL_I2S_Transmit_DMA()
1433 hi2s->TxXferSize = Size; in HAL_I2S_Transmit_DMA()
1434 hi2s->TxXferCount = Size; in HAL_I2S_Transmit_DMA()
1437 hi2s->pRxBuffPtr = NULL; in HAL_I2S_Transmit_DMA()
1438 hi2s->RxXferSize = (uint16_t)0UL; in HAL_I2S_Transmit_DMA()
1439 hi2s->RxXferCount = (uint16_t)0UL; in HAL_I2S_Transmit_DMA()
1442 hi2s->hdmatx->XferHalfCpltCallback = I2S_DMATxHalfCplt; in HAL_I2S_Transmit_DMA()
1445 hi2s->hdmatx->XferCpltCallback = I2S_DMATxCplt; in HAL_I2S_Transmit_DMA()
1448 hi2s->hdmatx->XferErrorCallback = I2S_DMAError; in HAL_I2S_Transmit_DMA()
1450 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2S_Transmit_DMA()
1452 hi2s->TxXferCount = Size * 2U; in HAL_I2S_Transmit_DMA()
1456 hi2s->TxXferCount = Size * 4U; in HAL_I2S_Transmit_DMA()
1460 if ((hi2s->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2S_Transmit_DMA()
1462 if (hi2s->hdmatx->LinkedListQueue != NULL) in HAL_I2S_Transmit_DMA()
1465 … hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->TxXferCount; in HAL_I2S_Transmit_DMA()
1468 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pTx… in HAL_I2S_Transmit_DMA()
1471 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2S_Transmit_DMA()
1473 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmatx); in HAL_I2S_Transmit_DMA()
1478 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Transmit_DMA()
1481 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1483 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit_DMA()
1490 …errorcode = HAL_DMA_Start_IT(hi2s->hdmatx, (uint32_t)hi2s->pTxBuffPtr, (uint32_t)&hi2s->Instance->… in HAL_I2S_Transmit_DMA()
1491 hi2s->TxXferCount); in HAL_I2S_Transmit_DMA()
1498 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Transmit_DMA()
1499 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Transmit_DMA()
1501 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1507 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN)) in HAL_I2S_Transmit_DMA()
1510 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2S_Transmit_DMA()
1514 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2S_Transmit_DMA()
1517 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Transmit_DMA()
1521 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Transmit_DMA()
1523 __HAL_UNLOCK(hi2s); in HAL_I2S_Transmit_DMA()
1541 HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size) in HAL_I2S_Receive_DMA() argument
1550 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_Receive_DMA()
1556 __HAL_LOCK(hi2s); in HAL_I2S_Receive_DMA()
1559 hi2s->State = HAL_I2S_STATE_BUSY_RX; in HAL_I2S_Receive_DMA()
1560 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_Receive_DMA()
1561 hi2s->pRxBuffPtr = pData; in HAL_I2S_Receive_DMA()
1562 hi2s->RxXferSize = Size; in HAL_I2S_Receive_DMA()
1563 hi2s->RxXferCount = Size; in HAL_I2S_Receive_DMA()
1566 hi2s->pTxBuffPtr = NULL; in HAL_I2S_Receive_DMA()
1567 hi2s->TxXferSize = (uint16_t)0UL; in HAL_I2S_Receive_DMA()
1568 hi2s->TxXferCount = (uint16_t)0UL; in HAL_I2S_Receive_DMA()
1572 hi2s->hdmarx->XferHalfCpltCallback = I2S_DMARxHalfCplt; in HAL_I2S_Receive_DMA()
1575 hi2s->hdmarx->XferCpltCallback = I2S_DMARxCplt; in HAL_I2S_Receive_DMA()
1578 hi2s->hdmarx->XferErrorCallback = I2S_DMAError; in HAL_I2S_Receive_DMA()
1580 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2S_Receive_DMA()
1582 hi2s->RxXferCount = Size * 2U; in HAL_I2S_Receive_DMA()
1586 hi2s->RxXferCount = Size * 4U; in HAL_I2S_Receive_DMA()
1590 if ((hi2s->hdmarx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2S_Receive_DMA()
1592 if (hi2s->hdmarx->LinkedListQueue != NULL) in HAL_I2S_Receive_DMA()
1595 … hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->RxXferCount; in HAL_I2S_Receive_DMA()
1598 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2S_Receive_DMA()
1601 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pRx… in HAL_I2S_Receive_DMA()
1603 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmarx); in HAL_I2S_Receive_DMA()
1608 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Receive_DMA()
1611 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1613 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive_DMA()
1620 …errorcode = HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->RXDR, (uint32_t)hi2s->pRxBuf… in HAL_I2S_Receive_DMA()
1621 hi2s->RxXferCount); in HAL_I2S_Receive_DMA()
1628 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_Receive_DMA()
1629 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_Receive_DMA()
1631 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1636 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN)) in HAL_I2S_Receive_DMA()
1639 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2S_Receive_DMA()
1643 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2S_Receive_DMA()
1646 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_Receive_DMA()
1650 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_Receive_DMA()
1652 __HAL_UNLOCK(hi2s); in HAL_I2S_Receive_DMA()
1671 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, const uint16_t *pTxData, u… in HAL_I2SEx_TransmitReceive_DMA() argument
1682 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2SEx_TransmitReceive_DMA()
1688 __HAL_LOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1690 hi2s->pTxBuffPtr = (const uint16_t *)pTxData; in HAL_I2SEx_TransmitReceive_DMA()
1691 hi2s->pRxBuffPtr = pRxData; in HAL_I2SEx_TransmitReceive_DMA()
1693 hi2s->TxXferSize = Size; in HAL_I2SEx_TransmitReceive_DMA()
1694 hi2s->TxXferCount = Size; in HAL_I2SEx_TransmitReceive_DMA()
1695 hi2s->RxXferSize = Size; in HAL_I2SEx_TransmitReceive_DMA()
1696 hi2s->RxXferCount = Size; in HAL_I2SEx_TransmitReceive_DMA()
1698 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2SEx_TransmitReceive_DMA()
1699 hi2s->State = HAL_I2S_STATE_BUSY_TX_RX; in HAL_I2SEx_TransmitReceive_DMA()
1702 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN | SPI_CFG1_RXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1705 hi2s->hdmarx->XferHalfCpltCallback = I2SEx_DMATxRxHalfCplt; in HAL_I2SEx_TransmitReceive_DMA()
1708 hi2s->hdmarx->XferCpltCallback = I2SEx_DMATxRxCplt; in HAL_I2SEx_TransmitReceive_DMA()
1711 hi2s->hdmarx->XferErrorCallback = I2S_DMAError; in HAL_I2SEx_TransmitReceive_DMA()
1712 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2SEx_TransmitReceive_DMA()
1714 hi2s->TxXferCount = Size * 2U; in HAL_I2SEx_TransmitReceive_DMA()
1718 hi2s->TxXferCount = Size * 4U; in HAL_I2SEx_TransmitReceive_DMA()
1722 if ((hi2s->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2SEx_TransmitReceive_DMA()
1724 if (hi2s->hdmatx->LinkedListQueue != NULL) in HAL_I2SEx_TransmitReceive_DMA()
1727 … hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->TxXferCount; in HAL_I2SEx_TransmitReceive_DMA()
1730 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pTx… in HAL_I2SEx_TransmitReceive_DMA()
1733 …hi2s->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2SEx_TransmitReceive_DMA()
1735 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmatx); in HAL_I2SEx_TransmitReceive_DMA()
1740 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1743 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1745 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1752 …errorcode = HAL_DMA_Start_IT(hi2s->hdmatx, (uint32_t)hi2s->pTxBuffPtr, (uint32_t)&hi2s->Instance->… in HAL_I2SEx_TransmitReceive_DMA()
1753 hi2s->TxXferCount); in HAL_I2SEx_TransmitReceive_DMA()
1760 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1761 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1763 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1769 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN)) in HAL_I2SEx_TransmitReceive_DMA()
1772 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1775 …if ((hi2s->Init.DataFormat == I2S_DATAFORMAT_16B) || (hi2s->Init.DataFormat == I2S_DATAFORMAT_16B_… in HAL_I2SEx_TransmitReceive_DMA()
1777 hi2s->RxXferCount = Size * 2U; in HAL_I2SEx_TransmitReceive_DMA()
1781 hi2s->RxXferCount = Size * 4U; in HAL_I2SEx_TransmitReceive_DMA()
1785 if ((hi2s->hdmarx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST) in HAL_I2SEx_TransmitReceive_DMA()
1787 if (hi2s->hdmarx->LinkedListQueue != NULL) in HAL_I2SEx_TransmitReceive_DMA()
1790 … hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hi2s->RxXferCount; in HAL_I2SEx_TransmitReceive_DMA()
1793 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)&hi2s->In… in HAL_I2SEx_TransmitReceive_DMA()
1796 …hi2s->hdmarx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)hi2s->pRx… in HAL_I2SEx_TransmitReceive_DMA()
1798 errorcode = HAL_DMAEx_List_Start_IT(hi2s->hdmarx); in HAL_I2SEx_TransmitReceive_DMA()
1803 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1806 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1808 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1815 …errorcode = HAL_DMA_Start_IT(hi2s->hdmarx, (uint32_t)&hi2s->Instance->RXDR, (uint32_t)hi2s->pRxBuf… in HAL_I2SEx_TransmitReceive_DMA()
1816 hi2s->RxXferCount); in HAL_I2SEx_TransmitReceive_DMA()
1823 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2SEx_TransmitReceive_DMA()
1824 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2SEx_TransmitReceive_DMA()
1826 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1831 if (HAL_IS_BIT_CLR(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN)) in HAL_I2SEx_TransmitReceive_DMA()
1834 SET_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2SEx_TransmitReceive_DMA()
1838 if (HAL_IS_BIT_CLR(hi2s->Instance->CR1, SPI_CR1_SPE)) in HAL_I2SEx_TransmitReceive_DMA()
1841 __HAL_I2S_ENABLE(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1845 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2SEx_TransmitReceive_DMA()
1847 __HAL_UNLOCK(hi2s); in HAL_I2SEx_TransmitReceive_DMA()
1857 HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAPause() argument
1860 __HAL_LOCK(hi2s); in HAL_I2S_DMAPause()
1869 if (IS_I2S_MASTER(hi2s->Init.Mode)) in HAL_I2S_DMAPause()
1872 if (HAL_IS_BIT_SET(hi2s->Instance->CR1, SPI_CR1_CSTART) == 0UL) in HAL_I2S_DMAPause()
1875 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_NO_OGT); in HAL_I2S_DMAPause()
1876 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1878 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1882 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSUSP); in HAL_I2S_DMAPause()
1884 while (HAL_IS_BIT_SET(hi2s->Instance->CR1, SPI_CR1_CSTART) != 0UL) in HAL_I2S_DMAPause()
1889 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1892 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1894 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_TIMEOUT); in HAL_I2S_DMAPause()
1895 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1901 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DMAPause()
1903 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1906 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1913 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_NOT_SUPPORTED); in HAL_I2S_DMAPause()
1914 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAPause()
1917 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAPause()
1929 HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAResume() argument
1932 __HAL_LOCK(hi2s); in HAL_I2S_DMAResume()
1934 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_DMAResume()
1936 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAResume()
1938 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAResume()
1943 hi2s->State = HAL_I2S_STATE_BUSY; in HAL_I2S_DMAResume()
1944 hi2s->ErrorCode = HAL_I2S_ERROR_NONE; in HAL_I2S_DMAResume()
1947 __HAL_I2S_ENABLE(hi2s); in HAL_I2S_DMAResume()
1950 SET_BIT(hi2s->Instance->CR1, SPI_CR1_CSTART); in HAL_I2S_DMAResume()
1953 __HAL_UNLOCK(hi2s); in HAL_I2S_DMAResume()
1964 HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s) in HAL_I2S_DMAStop() argument
1974 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in HAL_I2S_DMAStop()
1975 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in HAL_I2S_DMAStop()
1978 if (hi2s->hdmatx != NULL) in HAL_I2S_DMAStop()
1981 if (HAL_OK != HAL_DMA_Abort(hi2s->hdmatx)) in HAL_I2S_DMAStop()
1983 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_DMAStop()
1989 if (hi2s->hdmarx != NULL) in HAL_I2S_DMAStop()
1992 if (HAL_OK != HAL_DMA_Abort(hi2s->hdmarx)) in HAL_I2S_DMAStop()
1994 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in HAL_I2S_DMAStop()
2000 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DMAStop()
2002 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_DMAStop()
2016 HAL_StatusTypeDef HAL_I2S_EnableIOSwap(I2S_HandleTypeDef *hi2s) in HAL_I2S_EnableIOSwap() argument
2019 if (hi2s == NULL) in HAL_I2S_EnableIOSwap()
2025 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_EnableIOSwap()
2031 if (READ_BIT(hi2s->Instance->CR1, SPI_CR1_IOLOCK) == (SPI_CR1_IOLOCK)) in HAL_I2S_EnableIOSwap()
2037 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) == SPI_CR1_SPE) in HAL_I2S_EnableIOSwap()
2040 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_EnableIOSwap()
2044 SET_BIT(hi2s->Instance->CFG2, SPI_CFG2_IOSWP); in HAL_I2S_EnableIOSwap()
2058 HAL_StatusTypeDef HAL_I2S_DisableIOSwap(I2S_HandleTypeDef *hi2s) in HAL_I2S_DisableIOSwap() argument
2061 if (hi2s == NULL) in HAL_I2S_DisableIOSwap()
2067 if (hi2s->State != HAL_I2S_STATE_READY) in HAL_I2S_DisableIOSwap()
2073 if (READ_BIT(hi2s->Instance->CR1, SPI_CR1_IOLOCK) == (SPI_CR1_IOLOCK)) in HAL_I2S_DisableIOSwap()
2079 if ((hi2s->Instance->CR1 & SPI_CR1_SPE) == SPI_CR1_SPE) in HAL_I2S_DisableIOSwap()
2082 __HAL_I2S_DISABLE(hi2s); in HAL_I2S_DisableIOSwap()
2086 CLEAR_BIT(hi2s->Instance->CFG2, SPI_CFG2_IOSWP); in HAL_I2S_DisableIOSwap()
2097 uint32_t HAL_I2S_IsEnabledIOSwap(const I2S_HandleTypeDef *hi2s) in HAL_I2S_IsEnabledIOSwap() argument
2100 if (hi2s == NULL) in HAL_I2S_IsEnabledIOSwap()
2105 return ((READ_BIT(hi2s->Instance->CFG2, SPI_CFG2_IOSWP) == (SPI_CFG2_IOSWP)) ? 1UL : 0UL); in HAL_I2S_IsEnabledIOSwap()
2114 void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s) in HAL_I2S_IRQHandler() argument
2116 uint32_t i2sier = hi2s->Instance->IER; in HAL_I2S_IRQHandler()
2117 uint32_t i2ssr = hi2s->Instance->SR; in HAL_I2S_IRQHandler()
2120 if (hi2s->State == HAL_I2S_STATE_BUSY_RX) in HAL_I2S_IRQHandler()
2125 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2132 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2135 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2S_IRQHandler()
2138 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2142 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()
2152 if (hi2s->State == HAL_I2S_STATE_BUSY_TX) in HAL_I2S_IRQHandler()
2157 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2164 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2167 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2S_IRQHandler()
2170 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2173 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2S_IRQHandler()
2176 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2178 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2182 if (hi2s->State == HAL_I2S_STATE_BUSY_TX_RX) in HAL_I2S_IRQHandler()
2187 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2188 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2193 hi2s->RxISR(hi2s); in HAL_I2S_IRQHandler()
2198 hi2s->TxISR(hi2s); in HAL_I2S_IRQHandler()
2205 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2208 __HAL_I2S_CLEAR_UDRFLAG(hi2s); in HAL_I2S_IRQHandler()
2211 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2214 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_UDR); in HAL_I2S_IRQHandler()
2217 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2219 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2227 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_ERR)); in HAL_I2S_IRQHandler()
2230 __HAL_I2S_CLEAR_OVRFLAG(hi2s); in HAL_I2S_IRQHandler()
2233 hi2s->State = HAL_I2S_STATE_READY; in HAL_I2S_IRQHandler()
2237 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_OVR); in HAL_I2S_IRQHandler()
2241 hi2s->ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2243 HAL_I2S_ErrorCallback(hi2s); in HAL_I2S_IRQHandler()
2255 __weak void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_TxHalfCpltCallback() argument
2258 UNUSED(hi2s); in HAL_I2S_TxHalfCpltCallback()
2271 __weak void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_TxCpltCallback() argument
2274 UNUSED(hi2s); in HAL_I2S_TxCpltCallback()
2287 __weak void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_RxHalfCpltCallback() argument
2290 UNUSED(hi2s); in HAL_I2S_RxHalfCpltCallback()
2303 __weak void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_RxCpltCallback() argument
2306 UNUSED(hi2s); in HAL_I2S_RxCpltCallback()
2319 __weak void HAL_I2SEx_TxRxHalfCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2SEx_TxRxHalfCpltCallback() argument
2322 UNUSED(hi2s); in HAL_I2SEx_TxRxHalfCpltCallback()
2335 __weak void HAL_I2SEx_TxRxCpltCallback(I2S_HandleTypeDef *hi2s) in HAL_I2SEx_TxRxCpltCallback() argument
2338 UNUSED(hi2s); in HAL_I2SEx_TxRxCpltCallback()
2351 __weak void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s) in HAL_I2S_ErrorCallback() argument
2354 UNUSED(hi2s); in HAL_I2S_ErrorCallback()
2386 HAL_I2S_StateTypeDef HAL_I2S_GetState(const I2S_HandleTypeDef *hi2s) in HAL_I2S_GetState() argument
2388 return hi2s->State; in HAL_I2S_GetState()
2397 uint32_t HAL_I2S_GetError(const I2S_HandleTypeDef *hi2s) in HAL_I2S_GetError() argument
2399 return hi2s->ErrorCode; in HAL_I2S_GetError()
2421 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMATxCplt() local
2427 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in I2S_DMATxCplt()
2429 hi2s->TxXferCount = (uint16_t) 0UL; in I2S_DMATxCplt()
2430 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMATxCplt()
2434 hi2s->TxCpltCallback(hi2s); in I2S_DMATxCplt()
2436 HAL_I2S_TxCpltCallback(hi2s); in I2S_DMATxCplt()
2449 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMATxHalfCplt() local
2453 hi2s->TxHalfCpltCallback(hi2s); in I2S_DMATxHalfCplt()
2455 HAL_I2S_TxHalfCpltCallback(hi2s); in I2S_DMATxHalfCplt()
2468 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMARxCplt() local
2474 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in I2S_DMARxCplt()
2475 hi2s->RxXferCount = (uint16_t)0UL; in I2S_DMARxCplt()
2476 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMARxCplt()
2480 hi2s->RxCpltCallback(hi2s); in I2S_DMARxCplt()
2482 HAL_I2S_RxCpltCallback(hi2s); in I2S_DMARxCplt()
2495 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMARxHalfCplt() local
2499 hi2s->RxHalfCpltCallback(hi2s); in I2S_DMARxHalfCplt()
2501 HAL_I2S_RxHalfCpltCallback(hi2s); in I2S_DMARxHalfCplt()
2513 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2SEx_DMATxRxCplt() local
2519 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_TXDMAEN); in I2SEx_DMATxRxCplt()
2520 hi2s->TxXferCount = (uint16_t) 0UL; in I2SEx_DMATxRxCplt()
2523 CLEAR_BIT(hi2s->Instance->CFG1, SPI_CFG1_RXDMAEN); in I2SEx_DMATxRxCplt()
2524 hi2s->RxXferCount = (uint16_t)0UL; in I2SEx_DMATxRxCplt()
2527 hi2s->State = HAL_I2S_STATE_READY; in I2SEx_DMATxRxCplt()
2532 hi2s->TxRxCpltCallback(hi2s); in I2SEx_DMATxRxCplt()
2534 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2SEx_DMATxRxCplt()
2546 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2SEx_DMATxRxHalfCplt() local
2550 hi2s->TxRxHalfCpltCallback(hi2s); in I2SEx_DMATxRxHalfCplt()
2552 HAL_I2SEx_TxRxHalfCpltCallback(hi2s); in I2SEx_DMATxRxHalfCplt()
2565 I2S_HandleTypeDef *hi2s = (I2S_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; in I2S_DMAError() local
2568 CLEAR_BIT(hi2s->Instance->CFG1, (SPI_CFG1_RXDMAEN | SPI_CFG1_TXDMAEN)); in I2S_DMAError()
2569 hi2s->TxXferCount = (uint16_t) 0UL; in I2S_DMAError()
2570 hi2s->RxXferCount = (uint16_t) 0UL; in I2S_DMAError()
2572 hi2s->State = HAL_I2S_STATE_READY; in I2S_DMAError()
2575 SET_BIT(hi2s->ErrorCode, HAL_I2S_ERROR_DMA); in I2S_DMAError()
2578 hi2s->ErrorCallback(hi2s); in I2S_DMAError()
2580 HAL_I2S_ErrorCallback(hi2s); in I2S_DMAError()
2590 static void I2S_Transmit_16Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Transmit_16Bit_IT() argument
2594 __IO uint16_t *ptxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->TXDR)); in I2S_Transmit_16Bit_IT()
2596 *ptxdr_16bits = *((const uint16_t *)hi2s->pTxBuffPtr); in I2S_Transmit_16Bit_IT()
2598 *((__IO uint16_t *)&hi2s->Instance->TXDR) = *((const uint16_t *)hi2s->pTxBuffPtr); in I2S_Transmit_16Bit_IT()
2600 hi2s->pTxBuffPtr++; in I2S_Transmit_16Bit_IT()
2601 hi2s->TxXferCount--; in I2S_Transmit_16Bit_IT()
2603 if (hi2s->TxXferCount == 0UL) in I2S_Transmit_16Bit_IT()
2606 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in I2S_Transmit_16Bit_IT()
2608 if ((hi2s->Init.Mode == I2S_MODE_SLAVE_TX) || (hi2s->Init.Mode == I2S_MODE_MASTER_TX)) in I2S_Transmit_16Bit_IT()
2610 hi2s->State = HAL_I2S_STATE_READY; in I2S_Transmit_16Bit_IT()
2614 hi2s->TxCpltCallback(hi2s); in I2S_Transmit_16Bit_IT()
2616 HAL_I2S_TxCpltCallback(hi2s); in I2S_Transmit_16Bit_IT()
2628 static void I2S_Transmit_32Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Transmit_32Bit_IT() argument
2631 hi2s->Instance->TXDR = *((const uint32_t *)hi2s->pTxBuffPtr); in I2S_Transmit_32Bit_IT()
2632 hi2s->pTxBuffPtr += 2; in I2S_Transmit_32Bit_IT()
2633 hi2s->TxXferCount--; in I2S_Transmit_32Bit_IT()
2635 if (hi2s->TxXferCount == 0UL) in I2S_Transmit_32Bit_IT()
2638 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_ERR)); in I2S_Transmit_32Bit_IT()
2640 if ((hi2s->Init.Mode == I2S_MODE_SLAVE_TX) || (hi2s->Init.Mode == I2S_MODE_MASTER_TX)) in I2S_Transmit_32Bit_IT()
2642 hi2s->State = HAL_I2S_STATE_READY; in I2S_Transmit_32Bit_IT()
2646 hi2s->TxCpltCallback(hi2s); in I2S_Transmit_32Bit_IT()
2648 HAL_I2S_TxCpltCallback(hi2s); in I2S_Transmit_32Bit_IT()
2660 static void I2S_Receive_16Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Receive_16Bit_IT() argument
2664 __IO uint16_t *prxdr_16bits = (__IO uint16_t *)(&(hi2s->Instance->RXDR)); in I2S_Receive_16Bit_IT()
2666 *((uint16_t *)hi2s->pRxBuffPtr) = *prxdr_16bits; in I2S_Receive_16Bit_IT()
2668 *((uint16_t *)hi2s->pRxBuffPtr) = *((__IO uint16_t *)&hi2s->Instance->RXDR); in I2S_Receive_16Bit_IT()
2670 hi2s->pRxBuffPtr++; in I2S_Receive_16Bit_IT()
2671 hi2s->RxXferCount--; in I2S_Receive_16Bit_IT()
2673 if (hi2s->RxXferCount == 0UL) in I2S_Receive_16Bit_IT()
2675 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2678 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP | I2S_IT_ERR)); in I2S_Receive_16Bit_IT()
2683 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in I2S_Receive_16Bit_IT()
2686 hi2s->State = HAL_I2S_STATE_READY; in I2S_Receive_16Bit_IT()
2689 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2691 hi2s->TxRxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2695 hi2s->RxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2698 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_16Bit_IT()
2700 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2704 HAL_I2S_RxCpltCallback(hi2s); in I2S_Receive_16Bit_IT()
2716 static void I2S_Receive_32Bit_IT(I2S_HandleTypeDef *hi2s) in I2S_Receive_32Bit_IT() argument
2719 *((uint32_t *)hi2s->pRxBuffPtr) = hi2s->Instance->RXDR; in I2S_Receive_32Bit_IT()
2720 hi2s->pRxBuffPtr += 2; in I2S_Receive_32Bit_IT()
2721 hi2s->RxXferCount--; in I2S_Receive_32Bit_IT()
2723 if (hi2s->RxXferCount == 0UL) in I2S_Receive_32Bit_IT()
2725 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2728 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_TXP | I2S_IT_RXP | I2S_IT_DXP | I2S_IT_ERR)); in I2S_Receive_32Bit_IT()
2733 __HAL_I2S_DISABLE_IT(hi2s, (I2S_IT_RXP | I2S_IT_ERR)); in I2S_Receive_32Bit_IT()
2736 hi2s->State = HAL_I2S_STATE_READY; in I2S_Receive_32Bit_IT()
2739 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2741 hi2s->TxRxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2745 hi2s->RxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2748 if (IS_I2S_FULLDUPLEX(hi2s->Init.Mode)) in I2S_Receive_32Bit_IT()
2750 HAL_I2SEx_TxRxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2754 HAL_I2S_RxCpltCallback(hi2s); in I2S_Receive_32Bit_IT()
2770 static HAL_StatusTypeDef I2S_WaitFlagStateUntilTimeout(I2S_HandleTypeDef *hi2s, uint32_t Flag, Flag… in I2S_WaitFlagStateUntilTimeout() argument
2774 while (((__HAL_I2S_GET_FLAG(hi2s, Flag)) ? SET : RESET) != State) in I2S_WaitFlagStateUntilTimeout()
2781 hi2s->State = HAL_I2S_STATE_READY; in I2S_WaitFlagStateUntilTimeout()
2784 __HAL_UNLOCK(hi2s); in I2S_WaitFlagStateUntilTimeout()