HAL library 08- SPI for STM32Fxxx

Next library in ported libs is SPI for HAL based drivers for STM32F4xx and STM32F7xx based devices.

Library

Read more about new HAL libraries

Features

  • Operate with up to 6 SPI peripherals
  • Send single or multiple bytes at time
  • Automatic SPI prescaler selection based on maximum clock selected for your external device
  • Software based Chip Select pin
  • Support for custom GPIO pins combination for SPI

Dependencies

  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h
    • GPIO

Pinouts

Table with SPI pins for different pinspack. Pinspack is selected on library initialization.

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

Functions and enumerations

Example

Project is available on Github, download all libraries below.

tilz0R

Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...