TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle

SPI library for STM32Fxxx - http://stm32f4-discovery.com/2015/07/hal-library-08-spi-for-stm32fxxx/. More...

Modules

 TM_SPI_Typedefs
 Library Typedefs.
 
 TM_SPI_Macros
 Library defines.
 
 TM_SPI_Functions
 Library Functions.
 

Detailed Description

SPI library for STM32Fxxx - http://stm32f4-discovery.com/2015/07/hal-library-08-spi-for-stm32fxxx/.

It supports all 6 SPIs in master with 3 Lines Full Duplex mode

Default SPI settings

All six SPIs work the same principle by default:

Pinout
        |PINS PACK 1            |PINS PACK 2            |PINS PACK 3           |PINS PACK 4
SPIX    |MOSI   MISO    SCK     |MOSI   MISO    SCK     |MOSI   MISO    SCK    |MOSI   MISO    SCK
        |                                                                           
SPI1    |PA7    PA6     PA5     |PB5    PB4     PB3     |                      |
SPI2    |PC3    PC2     PB10    |PB15   PB14    PB13    |PI3    PI2     PI0    |PB15   PB14    PI1
SPI3    |PB5    PB4     PB3     |PC12   PC11    PC10    |                      |
SPI4    |PE6    PE5     PE2     |PE14   PE13    PE12    |                      |
SPI5    |PF9    PF8     PF7     |PF11   PH7     PH6     |                      |
SPI6    |PG14   PG12    PG13    |

In case these pins are not good for you, you can use TM_SPI_PinsPack_Custom in function and callback function will be called, where you can initialize your custom pinout for your SPI peripheral

Possible changes to each SPI. Set this defines in your defines.h file.

Change x with 1-6, to match your SPI

//Default prescaler
#define TM_SPIx_PRESCALER SPI_BAUDRATEPRESCALER_32
//Specify datasize
#define TM_SPIx_DATASIZE SPI_DATASIZE_8BIT
//Specify which bit is first
#define TM_SPIx_FIRSTBIT SPI_FIRSTBIT_MSB
//Mode, master or slave
#define TM_SPIx_MASTERSLAVE SPI_MODE_MASTER
//Specify mode of operation, clock polarity and clock phase
#define TM_SPIx_MODE TM_SPI_Mode_0
Changelog
 Version 1.0
  - First release
Dependencies
 - STM32Fxxx HAL
 - defines.h
 - attributes.h
 - TM GPIO