Kopīgot, izmantojot


Applibs spi.h

Header: #include <applibs/spi.h>

The Applibs SPI header contains functions and types that access a Serial Peripheral Interface (SPI) on a device.

Note

Define SPI_STRUCTS_VERSION to the appropriate version when using this header.

Application manifest requirements

To access individual SPI interfaces, your application must identify them in the SpiMaster field of the application manifest.

Hardware dependent IDs

SPI functions reference some identifiers that are hardware dependent. Hardware dependent IDs are constants that are defined in the hardware definition files for a device. For more information, see Manage target hardware dependencies.

Concepts and samples

Functions

Function Description
SPIMaster_InitConfig Initializes a SPIMaster_Config struct with the default SPI master interface settings.
SPIMaster_InitTransfers Initializes an array of SPIMaster_Transfer structs with the default SPI master transfer settings.
SPIMaster_Open Opens and configures an SPI master interface for exclusive use, and returns a file descriptor to use for subsequent calls.
SPIMaster_SetBitOrder Configures the order for transferring data bits on an SPI master interface.
SPIMaster_SetBusSpeed Sets the SPI bus speed for operations on an SPI master interface.
SPIMaster_SetMode Sets the communication mode for an SPI master interface.
SPIMaster_TransferSequential Performs a sequence of half-duplex read or write transfers using the SPI master interface.
SPIMaster_WriteThenRead Performs a sequence of a half-duplex writes immediately followed by a half-duplex read using the SPI master interface.

Structs

Struct Description
SPIMaster_Config The configuration options for opening an SPI master interface.
SPIMaster_Transfer The description of an SPI master transfer operation.

Enums

Enum Description
SPI_BitOrder The possible SPI bit order values.
SPI_ChipSelectPolarity The possible chip select polarity values for an SPI interface.
SPI_Mode The possible communication mode values for an SPI interface.
SPI_TransferFlags The possible flags values for a SPIMaster_Transfer struct.

Typdefs

Typedef Description
SPI_ChipSelectId An SPI chip select ID.
SPI_InterfaceId The ID for an SPI interface instance.