39#ifndef STM32F401RE_SPI_DRIVER_H__
40#define STM32F401RE_SPI_DRIVER_H__
Common utility module public API.
EN_STATUS_te
Represents an enabled or disabled state.
void spi_send(SPI_REGDEF_ts *spi_instance, uint8_t *tx_buffer, uint32_t len)
Blocking SPI transmit. Sends len bytes from tx_buffer.
void spi_deinit(SPI_REGDEF_ts const *spi_instance)
Deinitializes the SPI peripheral and disables its clock.
void spi_init(SPI_CFG_ts *spi_cfg)
Initializes the SPI peripheral with the given configuration.
void spi_receive(SPI_REGDEF_ts *spi_instance, uint8_t *rx_buffer, uint32_t len)
Blocking SPI receive. Reads len bytes into rx_buffer.
void spi_set_comm(SPI_REGDEF_ts *spi_instance, EN_STATUS_te en_status)
Enables or disables the SPI peripheral (SPE bit).
void spi_set_pclk_div(SPI_REGDEF_ts *spi_instance, SPI_MASTER_SCLK_SPEED_te pclk_div)
Changes the SPI master clock speed divisor at runtime.
SPI_BIT_FIRST_te
SPI frame bit order.
SPI_CLOCK_PHASE_te
SPI clock phase (CPHA).
SPI_DATA_FRAME_FORMAT_te
SPI data frame size.
SPI_MODE_te
SPI operating mode.
SPI_SLAVE_SELECT_MODE_te
SPI slave select (NSS) management mode.
SPI_MASTER_SCLK_SPEED_te
SPI master clock speed as a division of the peripheral clock (PCLK).
SPI_CLOCK_POLARITY_te
SPI clock polarity (CPOL).
@ SPI_CLOCK_PHASE_SECOND_TRANSITION
@ SPI_CLOCK_PHASE_FIRST_TRANSITION
@ SPI_DATA_FRAME_FORMAT_16_BIT
@ SPI_DATA_FRAME_FORMATE_8_BIT
@ SPI_SLAVE_SELECT_MODE_SW
@ SPI_SLAVE_SELECT_MODE_HW
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_8
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_2
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_16
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_4
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_256
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_32
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_128
@ SPI_MASTER_SCLK_SPEED_PCLK_DIV_64
@ SPI_CLOCK_POLARITY_0_IDLE
@ SPI_CLOCK_POLARITY_1_IDLE
STM32F401RE MCU-specific peripheral register definitions and bit position enumerations.
Configuration structure for initializing an SPI peripheral.
SPI_CLOCK_POLARITY_te clock_polarity
SPI_SLAVE_SELECT_MODE_te slave_select_mode
SPI_MASTER_SCLK_SPEED_te master_sclk_speed
SPI_DATA_FRAME_FORMAT_te data_frame_format
SPI_CLOCK_PHASE_te clock_phase
SPI_BIT_FIRST_te bit_first
SPI peripheral register map.