Src/custom_bus.c
int32_t BSP_SPI2_RegisterMspCallbacks (BSP_SPI_Cb_t *Callbacks)
{
  /* Prevent unused argument(s) compilation warning */
  __HAL_SPI_RESET_HANDLE_STATE(&hspi2);  
 
   /* Register MspInit Callback */
  if (HAL_SPI_RegisterCallback(&hspi2, HAL_SPI_MSPINIT_CB_ID, Callbacks->pMspInitCb)  != HAL_OK)
  {
    return BSP_ERROR_PERIPH_FAILURE;
  }
  
  /* Register MspDeInit Callback */
  if (HAL_SPI_RegisterCallback(&hspi2, HAL_SPI_MSPDEINIT_CB_ID, Callbacks->pMspDeInitCb) != HAL_OK)
  {
    return BSP_ERROR_PERIPH_FAILURE;
  }
  
  IsSPI2MspCbValid = 1;
  
  return BSP_ERROR_NONE;  
}
/**
  * @brief BSP SPI2 Bus Msp Callback registering
  * @param Callbacks     pointer to SPI2 MspInit/MspDeInit callback functions
  * @retval BSP status
  */
@brief BSP SPI2 Bus Msp Callback registering
@param Callbacks     pointer to SPI2 MspInit/MspDeInit callback functions
@retval BSP status
@brief BSP SPI2 Bus Msp Callback registering @param Callbacks pointer to SPI2 MspInit / MspDeInit callback functions @retval BSP status
int32_t BSP_SPI2_RegisterMspCallbacks (BSP_SPI_Cb_t *Callbacks)
{
  __HAL_SPI_RESET_HANDLE_STATE(&hspi2);  
  if (HAL_SPI_RegisterCallback(&hspi2, HAL_SPI_MSPINIT_CB_ID, Callbacks->pMspInitCb)  != HAL_OK)
  {
    return BSP_ERROR_PERIPH_FAILURE;
  }
  if (HAL_SPI_RegisterCallback(&hspi2, HAL_SPI_MSPDEINIT_CB_ID, Callbacks->pMspDeInitCb) != HAL_OK)
  {
    return BSP_ERROR_PERIPH_FAILURE;
  }
  IsSPI2MspCbValid = 1;
  return BSP_ERROR_NONE;  
}
int32_t BSP_SPI2_RegisterMspCallbacks ( BSP_SPI_Cb_t * Callbacks ) { __HAL_SPI_RESET_HANDLE_STATE ( & hspi2 ) ; if ( HAL_SPI_RegisterCallback ( & hspi2 , HAL_SPI_MSPINIT_CB_ID , Callbacks -> pMspInitCb ) != HAL_OK ) { return BSP_ERROR_PERIPH_FAILURE ; } if ( HAL_SPI_RegisterCallback ( & hspi2 , HAL_SPI_MSPDEINIT_CB_ID , Callbacks -> pMspDeInitCb ) != HAL_OK ) { return BSP_ERROR_PERIPH_FAILURE ; } IsSPI2MspCbValid = 1 ; return BSP_ERROR_NONE ; }
@brief BSP SPI2 Bus Msp Callback registering
 @param Callbacks     pointer to SPI2 MspInit/MspDeInit callback functions
 @retval BSP status
@brief BSP SPI2 Bus Msp Callback registering @param Callbacks pointer to SPI2 MspInit / MspDeInit callback functions @retval BSP status
/* Prevent unused argument(s) compilation warning */ /* Register MspInit Callback */ /* Register MspDeInit Callback */