Src/custom_bus.c
int32_t BSP_SPI2_SendRecv(uint8_t *pTxData, uint8_t *pRxData, uint16_t Length)
{
  int32_t ret = BSP_ERROR_UNKNOWN_FAILURE;
  
  if(HAL_SPI_TransmitReceive(&hspi2, pTxData, pRxData, Length, BUS_SPI1_POLL_TIMEOUT) == HAL_OK)
  {
      ret = BSP_ERROR_NONE;
  }
  return ret;
}
/**
  * @brief  Send and Receive data to/from SPI BUS (Full duplex)
  * @param  pData: Pointer to data buffer to send/receive
  * @param  Length: Length of data in byte
  * @retval BSP status
  */
@brief  Send and Receive data to/from SPI BUS (Full duplex)
@param  pData: Pointer to data buffer to send/receive
@param  Length: Length of data in byte
@retval BSP status
@brief Send and Receive data to / from SPI BUS ( Full duplex ) @param pData : Pointer to data buffer to send / receive @param Length : Length of data in byte @retval BSP status
int32_t BSP_SPI2_SendRecv(uint8_t *pTxData, uint8_t *pRxData, uint16_t Length)
{
  int32_t ret = BSP_ERROR_UNKNOWN_FAILURE;
  if(HAL_SPI_TransmitReceive(&hspi2, pTxData, pRxData, Length, BUS_SPI1_POLL_TIMEOUT) == HAL_OK)
  {
      ret = BSP_ERROR_NONE;
  }
  return ret;
}
int32_t BSP_SPI2_SendRecv ( uint8_t * pTxData , uint8_t * pRxData , uint16_t Length ) { int32_t ret = BSP_ERROR_UNKNOWN_FAILURE ; if ( HAL_SPI_TransmitReceive ( & hspi2 , pTxData , pRxData , Length , BUS_SPI1_POLL_TIMEOUT ) == HAL_OK ) { ret = BSP_ERROR_NONE ; } return ret ; }
@brief  Send and Receive data to/from SPI BUS (Full duplex)
 @param  pData: Pointer to data buffer to send/receive
 @param  Length: Length of data in byte
 @retval BSP status
@brief Send and Receive data to / from SPI BUS ( Full duplex ) @param pData : Pointer to data buffer to send / receive @param Length : Length of data in byte @retval BSP status