uC/Matrix_Simulation_Dev/Core/Src/main.c
static void MX_SPI2_Init(void)
{

  /* USER CODE BEGIN SPI2_Init 0 */

  /* USER CODE END SPI2_Init 0 */

  /* USER CODE BEGIN SPI2_Init 1 */

  /* USER CODE END SPI2_Init 1 */
  /* SPI2 parameter configuration*/
  hspi2.Instance = SPI2;
  hspi2.Init.Mode = SPI_MODE_SLAVE;
  hspi2.Init.Direction = SPI_DIRECTION_2LINES;
  hspi2.Init.DataSize = SPI_DATASIZE_8BIT;
  hspi2.Init.CLKPolarity = SPI_POLARITY_LOW;
  hspi2.Init.CLKPhase = SPI_PHASE_1EDGE;
  hspi2.Init.NSS = SPI_NSS_HARD_INPUT;
  hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
  hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;
  hspi2.Init.TIMode = SPI_TIMODE_DISABLE;
  hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
  hspi2.Init.CRCPolynomial = 10;
  if (HAL_SPI_Init(&hspi2) != HAL_OK)
  {
    Error_Handler();
  }
  /* USER CODE BEGIN SPI2_Init 2 */

  /* USER CODE END SPI2_Init 2 */

}
/**
  * @brief SPI2 Initialization Function
  * @param None
  * @retval None
  */
@brief SPI2 Initialization Function
@param None
@retval None
@brief SPI2 Initialization Function @param None @retval None
static void MX_SPI2_Init(void)
{
  hspi2.Instance = SPI2;
  hspi2.Init.Mode = SPI_MODE_SLAVE;
  hspi2.Init.Direction = SPI_DIRECTION_2LINES;
  hspi2.Init.DataSize = SPI_DATASIZE_8BIT;
  hspi2.Init.CLKPolarity = SPI_POLARITY_LOW;
  hspi2.Init.CLKPhase = SPI_PHASE_1EDGE;
  hspi2.Init.NSS = SPI_NSS_HARD_INPUT;
  hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
  hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;
  hspi2.Init.TIMode = SPI_TIMODE_DISABLE;
  hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
  hspi2.Init.CRCPolynomial = 10;
  if (HAL_SPI_Init(&hspi2) != HAL_OK)
  {
    Error_Handler();
  }
}
static void MX_SPI2_Init ( void ) { hspi2 . Instance = SPI2 ; hspi2 . Init . Mode = SPI_MODE_SLAVE ; hspi2 . Init . Direction = SPI_DIRECTION_2LINES ; hspi2 . Init . DataSize = SPI_DATASIZE_8BIT ; hspi2 . Init . CLKPolarity = SPI_POLARITY_LOW ; hspi2 . Init . CLKPhase = SPI_PHASE_1EDGE ; hspi2 . Init . NSS = SPI_NSS_HARD_INPUT ; hspi2 . Init . BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256 ; hspi2 . Init . FirstBit = SPI_FIRSTBIT_MSB ; hspi2 . Init . TIMode = SPI_TIMODE_DISABLE ; hspi2 . Init . CRCCalculation = SPI_CRCCALCULATION_DISABLE ; hspi2 . Init . CRCPolynomial = 10 ; if ( HAL_SPI_Init ( & hspi2 ) != HAL_OK ) { Error_Handler ( ) ; } }
@brief SPI2 Initialization Function
 @param None
 @retval None
@brief SPI2 Initialization Function @param None @retval None
/* USER CODE BEGIN SPI2_Init 0 */ /* USER CODE END SPI2_Init 0 */ /* USER CODE BEGIN SPI2_Init 1 */ /* USER CODE END SPI2_Init 1 */ /* SPI2 parameter configuration*/ /* USER CODE BEGIN SPI2_Init 2 */ /* USER CODE END SPI2_Init 2 */