

#include "stm32f4xx_hal.h"

#define __HAL_SPI_CLEAR_TXE(__HANDLE__) ((__HANDLE__)->Instance->SR = (SPI_FLAG_TXE)) // vymazani TXE

//SPI1 definition pin port GPIOA
#define SPI1_MOSI GPIO_PIN_7 // PA_7
#define SPI1_SCK GPIO_PIN_5 // PA_5
#define SPI1_PORT GPIOA

//SPI2 definition pin port GPIOC
#define SPI2_MISO GPIO_PIN_2 // PC_2
#define SPI2_PORT_C GPIOC

//SPI2 definition pin port GPIOB
#define SPI2_SCK GPIO_PIN_10 // PB_10
#define SPI2_PORT_B GPIOB

//SPI3 definition pin port GPIOC
#define SPI3_MOSI GPIO_PIN_12 // PC_12
#define SPI3_PORT_C GPIOC

//SPI3 definition pin port GPIOB
#define SPI3_SCK GPIO_PIN_12 // PB_12
#define SPI3_PORT_B GPIOB


void HAL_SPI_peripehrals_Init(SPI_HandleTypeDef *SPI, uint16_t SPI_NUM);
uint16_t spi_send_data(SPI_HandleTypeDef *SPI, uint16_t data);
