13#include "stm32f439xx.h"
60void SPI_send(
SPI *, uint16_t);
61void SPI_receive(
SPI *,
volatile uint16_t *);
uint16_t SPI_transmit(SPI *, uint16_t)
Instance method to communicate a SPI transaction with slave device.
void SPI_init(SPI *, DeviceType, SPI_TypeDef *, DataFormat, GPIO_TypeDef *, unsigned long)
Initialiser for an SPI device interface.
DataFormat
Data format enum Describes the format of dataframes sent on the SPI data bus.
DeviceType
Device type enum Describes the type of peripheral implementing an SPI interface.
@ MEMORY_FLASH
Flash memory.
@ SENSOR_ACCEL
Accelerometer.
Struct definition for SPI interface. Provides the interface for API consumers to interact with the SP...
void(* send)(struct SPI *, uint16_t)
SPI send method.
DeviceType device
Enum specifier for device type.
uint16_t(* transmit)(struct SPI *, uint16_t)
SPI transmit method.
GPIO_TypeDef * port
Pointer to GPIO port struct.
unsigned long cs
Device chip select address.
void(* receive)(struct SPI *, volatile uint16_t *)
SPI receive method.
SPI_TypeDef * interface
Pointer to SPI interface struct.