SPI Peripheral Library Interface for MPLAB® Harmony v2

General Configurations and Status Functions

Function NameDescription
PLIB_SPI_BaudRateClockSelectSelects the type of clock is used by the Baud Rate Generator
PLIB_SPI_BaudRateSetSets the baud rate to the desired value
PLIB_SPI_ClockPolaritySelectEnables clock polarity
PLIB_SPI_CommunicationWidthSelectSelects the data width for the Serial Peripheral Interface (SPI) communication
PLIB_SPI_DisableDisables the SPI module
PLIB_SPI_EnableEnables the SPI module
PLIB_SPI_ErrorInterruptDisableDisables SPI error interrupts
PLIB_SPI_ErrorInterruptEnableEnables SPI error interrupts
PLIB_SPI_FIFOCountGetReads the SPI Buffer Element Count bits for either receive or transmit
PLIB_SPI_FIFODisableDisables the SPI enhanced buffer
PLIB_SPI_FIFOInterruptModeSelectSelects the SPI buffer interrupt mode
PLIB_SPI_FIFOShiftRegisterIsEmptyReturns the current status of the SPI shift register
PLIB_SPI_InputSamplePhaseSelectSelects the SPI data input sample phase
PLIB_SPI_IsBusyReturns the current SPI module activity status
PLIB_SPI_MasterEnableEnables the SPI in Master mode
PLIB_SPI_OutputDataPhaseSelectSelects serial output data change
PLIB_SPI_PinDisableEnables the selected SPI pins
PLIB_SPI_PinEnableEnables the selected SPI pins
PLIB_SPI_ReadDataIsSignExtendedReturns the current status of the receive (RX) FIFO sign-extended data
PLIB_SPI_SlaveEnableEnables the SPI in Slave mode
PLIB_SPI_SlaveSelectDisableDisables Master mode slave select
PLIB_SPI_SlaveSelectEnableEnables Master mode slave select
PLIB_SPI_StopInIdleDisableContinues module operation when the device enters Idle mode
PLIB_SPI_StopInIdleEnableDiscontinues module operation when the device enters Idle mode

Data Transfer Functions

Function NameDescription
PLIB_SPI_BufferClearClears the SPI buffer
PLIB_SPI_BufferReadReturns the SPI buffer value
PLIB_SPI_BufferAddressGetReturns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB)) register
PLIB_SPI_BufferRead16bitReturns 16-bit SPI buffer value
PLIB_SPI_BufferRead32bitReturns 32-bit SPI buffer value
PLIB_SPI_BufferWriteWrite the data to the SPI buffer
PLIB_SPI_BufferWrite16bitWrites 16-bit data to the SPI buffer
PLIB_SPI_BufferWrite32bitWrite 32-bit data to the SPI buffer

Frame Mode Functions

Function NameDescription
PLIB_SPI_FramedCommunicationDisableDisables framed SPI support
PLIB_SPI_FramedCommunicationEnableEnables framed SPI support
PLIB_SPI_FrameErrorStatusGetReturns the current status of the SPI frame error
PLIB_SPI_FrameErrorStatusClearClears the SPI frame error flag
PLIB_SPI_FrameSyncPulseCounterSelectSelects at which character the SPI frame sync pulse is generated
PLIB_SPI_FrameSyncPulseDirectionSelectSelects the frame sync pulse direction
PLIB_SPI_FrameSyncPulseEdgeSelectSelects the frame sync pulse edge
PLIB_SPI_FrameSyncPulsePolaritySelectSelects the frame sync pulse polarity
PLIB_SPI_FrameSyncPulseWidthSelectSets the frame sync pulse width

Audio Mode Functions

Function NameDescription
PLIB_SPI_AudioCommunicationWidthSelectSelects the data width for the SPI audio communication
PLIB_SPI_AudioErrorDisableDisables the SPI error
PLIB_SPI_AudioErrorEnableEnables the SPI error
PLIB_SPI_AudioProtocolDisableAudio protocol is disabled
PLIB_SPI_AudioProtocolEnableAudio protocol is enabled
PLIB_SPI_AudioProtocolModeSelectSelects the Audio Protocol mode
PLIB_SPI_AudioTransmitModeSelectSelects the transmit audio data format

Transmitter Functions

Function NameDescription
PLIB_SPI_TransmitBufferIsEmptyReturns the current status of the transmit buffer
PLIB_SPI_TransmitBufferIsFullReturns the current transmit buffer status of the SPI module
PLIB_SPI_TransmitUnderRunStatusGetReturns the current status of the transmit underrun
PLIB_SPI_TransmitUnderRunStatusClearClears the SPI transmit underrun flag

Receiver Functions

Function NameDescription
PLIB_SPI_ReceiverBufferIsFullReturns the current status of the SPI receive buffer
PLIB_SPI_ReceiverFIFOIsEmptyReturns the current status of the SPI receive FIFO
PLIB_SPI_ReceiverHasOverflowedReturns the current status of the SPI receiver overflow
PLIB_SPI_ReceiverOverflowClearClears the SPI receive overflow flag

Feature Existence Functions

Function NameDescription
PLIB_SPI_ExistsAudioCommunicationWidthIdentifies whether the AudioCommunicationWidth feature exists on the SPI module
PLIB_SPI_ExistsAudioErrorControlIdentifies whether the AudioErrorControl feature exists on the SPI module
PLIB_SPI_ExistsAudioProtocolControlIdentifies whether the AudioProtocolControl feature exists on the SPI module
PLIB_SPI_ExistsAudioProtocolModeIdentifies whether the AudioProtocolMode feature exists on the SPI module
PLIB_SPI_ExistsAudioTransmitModeIdentifies whether the AudioTransmitMode feature exists on the SPI module
PLIB_SPI_ExistsBaudRateIdentifies whether the BaudRate feature exists on the SPI module
PLIB_SPI_ExistsBaudRateClockIdentifies whether the BaudRateClock feature exists on the SPI module
PLIB_SPI_ExistsBufferIdentifies whether the Buffer feature exists on the SPI module
PLIB_SPI_ExistsBusStatusIdentifies whether the BusStatus feature exists on the SPI module
PLIB_SPI_ExistsClockPolarityIdentifies whether the ClockPolarity feature exists on the SPI module
PLIB_SPI_ExistsCommunicationWidthIdentifies whether the CommunicationWidth feature exists on the SPI module
PLIB_SPI_ExistsEnableControlIdentifies whether the EnableControl feature exists on the SPI module
PLIB_SPI_ExistsErrorInterruptControlIdentifies whether the ErrorInterruptControl feature exists on the SPI module
PLIB_SPI_ExistsFIFOControlIdentifies whether the FIFOControl feature exists on the SPI module
PLIB_SPI_ExistsFIFOCountIdentifies whether the FIFOCount feature exists on the SPI module
PLIB_SPI_ExistsFIFOInterruptModeIdentifies whether the FIFOInterruptMode feature exists on the SPI module
PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatusIdentifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module
PLIB_SPI_ExistsFramedCommunicationIdentifies whether the FramedCommunication feature exists on the SPI module
PLIB_SPI_ExistsFrameErrorStatusIdentifies whether the FrameErrorStatus feature exists on the SPI module
PLIB_SPI_ExistsFrameSyncPulseCounterIdentifies whether the FrameSyncPulseCounter feature exists on the SPI module
PLIB_SPI_ExistsFrameSyncPulseDirectionIdentifies whether the FrameSyncPulseDirection feature exists on the SPI module
PLIB_SPI_ExistsFrameSyncPulseEdgeIdentifies whether the FrameSyncPulseEdge feature exists on the SPI module
PLIB_SPI_ExistsFrameSyncPulsePolarityIdentifies whether the FrameSyncPulsePolarity feature exists on the SPI module
PLIB_SPI_ExistsFrameSyncPulseWidthIdentifies whether the FrameSyncPulseWidth feature exists on the SPI module
PLIB_SPI_ExistsInputSamplePhaseIdentifies whether the InputSamplePhase feature exists on the SPI module
PLIB_SPI_ExistsMasterControlIdentifies whether the MasterControl feature exists on the SPI module
PLIB_SPI_ExistsOutputDataPhaseIdentifies whether the OutputDataPhase feature exists on the SPI module
PLIB_SPI_ExistsPinControlIdentifies whether the PinControl feature exists on the SPI module
PLIB_SPI_ExistsReadDataSignStatusIdentifies whether the ReadDataSignStatus feature exists on the SPI module
PLIB_SPI_ExistsReceiveBufferStatusIdentifies whether the ReceiveBufferStatus feature exists on the SPI module
PLIB_SPI_ExistsReceiveFIFOStatusIdentifies whether the ReceiveFIFOStatus feature exists on the SPI module
PLIB_SPI_ExistsReceiverOverflowIdentifies whether the ReceiverOverflow feature exists on the SPI module
PLIB_SPI_ExistsSlaveSelectControlIdentifies whether the SlaveSelectControl feature exists on the SPI module
PLIB_SPI_ExistsStopInIdleControlIdentifies whether the StopInIdle feature exists on the SPI module
PLIB_SPI_ExistsTransmitBufferEmptyStatusIdentifies whether the TransmitBufferEmptyStatus feature exists |on the SPI module
PLIB_SPI_ExistsTransmitBufferFullStatusIdentifies whether the TransmitBufferFullStatus feature exists on the SPI module
PLIB_SPI_ExistsTransmitUnderRunStatusIdentifies whether the TransmitUnderRunStatus feature exists on the SPI module
PLIB_SPI_Exists16bitBufferIdentifies whether the Buffer16bit feature exists on the SPI module
PLIB_SPI_Exists32bitBufferIdentifies whether the Buffer32bit feature exists on the SPI module

Data Types and Constants

NameDescription
SPI_AUDIO_COMMUNICATION_WIDTHDefines the list of SPI audio communication width
SPI_AUDIO_ERRORDefines the list of SPI audio error
SPI_AUDIO_PROTOCOLData type defining the audio protocol mode
SPI_AUDIO_TRANSMIT_MODEDefines the list of SPI transmit audio mode format
SPI_BAUD_RATE_CLOCKDefines the list of SPI Baud Rate Generator (BRG)
SPI_CLOCK_POLARITYDefines the list of SPI clock polarity
SPI_COMMUNICATION_WIDTHDefines the list of SPI communication width
SPI_DATA_TYPEData type defining the SPI data size
SPI_ERROR_INTERRUPTDefines the list of SPI error interrupts
SPI_FIFO_INTERRUPTDefines the list of SPI Buffer Interrupt mode
SPI_FIFO_TYPEDefines the list of SPI buffer mode
SPI_FRAME_PULSE_DIRECTIONDefines the list of SPI frame sync pulse direction
SPI_FRAME_PULSE_EDGEDefines the list of SPI frame sync pulse edge
SPI_FRAME_PULSE_POLARITYDefines the list of SPI frame sync pulse polarity
SPI_FRAME_PULSE_WIDTHDefines the list of SPI frame sync pulse width
SPI_FRAME_SYNC_PULSEData type defining the frame sync pulse counter values
SPI_INPUT_SAMPLING_PHASEDefines the list of SPI data input sample phase
SPI_MODULE_IDIdentifies the supported SPI modules
SPI_OUTPUT_DATA_PHASEDefines the list of SPI serial output data changes
SPI_PINData type defining the SPI pin