Modules | Classes | Macros | Functions

SPI driver modules. More...

Collaboration diagram for SPI:

Modules

 SPI_Exported_Constants
 
 SPI_Private_Functions
 
 SPI_Exported_Types
 
 SPI_Exported_Macros
 
 SPI_Exported_Functions
 
 SPI_Private_TypesDefinitions
 
 SPI_Private_Defines
 
 SPI_Private_Macros
 
 SPI_Private_Variables
 
 SPI_Private_FunctionPrototypes
 

Classes

struct  I2S_InitTypeDef
 I2S Init structure definition. More...
 
struct  SPI_InitTypeDef
 SPI Init structure definition. More...
 

Macros

#define CR1_CLEAR_MASK   ((uint16_t)0x3040)
 
#define CR1_CLEAR_MASK   ((uint16_t)0x3040)
 
#define CR2_LDMA_MASK   ((uint16_t)0x9FFF)
 
#define I2SCFGR_CLEAR_MASK   ((uint16_t)0xF040)
 
#define I2SCFGR_CLEAR_MASK   ((uint16_t)0xF040)
 
#define PLLCFGR_PPLN_MASK   ((uint32_t)0x00007FC0)
 
#define PLLCFGR_PPLR_MASK   ((uint32_t)0x70000000)
 
#define SPI_CR2_FRF   ((uint16_t)0x0010)
 
#define SPI_SR_TIFRFE   ((uint16_t)0x0100)
 

Functions

void SPI_CRCLengthConfig (SPI_TypeDef *SPIx, uint16_t SPI_CRCLength)
 Configures the CRC calculation length for the selected SPI. More...
 
uint16_t SPI_GetReceptionFIFOStatus (SPI_TypeDef *SPIx)
 Returns the current SPIx Reception FIFO filled level. More...
 
uint16_t SPI_GetTransmissionFIFOStatus (SPI_TypeDef *SPIx)
 Returns the current SPIx Transmission FIFO filled level. More...
 
void SPI_I2S_ClearITPendingBit (SPI_TypeDef *SPIx, uint8_t SPI_I2S_IT)
 Clears the SPIx CRC Error (CRCERR) interrupt pending bit. More...
 
uint16_t SPI_I2S_ReceiveData (SPI_TypeDef *SPIx)
 Returns the most recent received data by the SPIx/I2Sx peripheral. More...
 
uint16_t SPI_I2S_ReceiveData16 (SPI_TypeDef *SPIx)
 Returns the most recent received data by the SPIx peripheral. More...
 
void SPI_I2S_SendData (SPI_TypeDef *SPIx, uint16_t Data)
 Transmits a Data through the SPIx/I2Sx peripheral. More...
 
void SPI_I2S_SendData16 (SPI_TypeDef *SPIx, uint16_t Data)
 Transmits a Data through the SPIx/I2Sx peripheral. More...
 
void SPI_LastDMATransferCmd (SPI_TypeDef *SPIx, uint16_t SPI_LastDMATransfer)
 Configures the number of data to transfer type(Even/Odd) for the DMA last transfers and for the selected SPI. More...
 
void SPI_NSSPulseModeCmd (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the NSS pulse management mode. More...
 
uint8_t SPI_ReceiveData8 (SPI_TypeDef *SPIx)
 Returns the most recent received data by the SPIx peripheral. More...
 
void SPI_RxFIFOThresholdConfig (SPI_TypeDef *SPIx, uint16_t SPI_RxFIFOThreshold)
 Configures the FIFO reception threshold for the selected SPI. More...
 
void SPI_SendData8 (SPI_TypeDef *SPIx, uint8_t Data)
 Transmits a Data through the SPIx peripheral. More...
 

Detailed Description

SPI driver modules.

Macro Definition Documentation

#define CR1_CLEAR_MASK   ((uint16_t)0x3040)

Definition at line 138 of file stm32f30x_spi.c.

#define CR1_CLEAR_MASK   ((uint16_t)0x3040)

Definition at line 175 of file stm32f4xx_spi.c.

#define CR2_LDMA_MASK   ((uint16_t)0x9FFF)

Definition at line 139 of file stm32f30x_spi.c.

#define I2SCFGR_CLEAR_MASK   ((uint16_t)0xF040)

Definition at line 141 of file stm32f30x_spi.c.

#define I2SCFGR_CLEAR_MASK   ((uint16_t)0xF040)

Definition at line 176 of file stm32f4xx_spi.c.

#define PLLCFGR_PPLN_MASK   ((uint32_t)0x00007FC0)

Definition at line 180 of file stm32f4xx_spi.c.

#define PLLCFGR_PPLR_MASK   ((uint32_t)0x70000000)

Definition at line 179 of file stm32f4xx_spi.c.

#define SPI_CR2_FRF   ((uint16_t)0x0010)

Definition at line 182 of file stm32f4xx_spi.c.

#define SPI_SR_TIFRFE   ((uint16_t)0x0100)

Definition at line 183 of file stm32f4xx_spi.c.

Function Documentation

void SPI_CRCLengthConfig ( SPI_TypeDef SPIx,
uint16_t  SPI_CRCLength 
)

Configures the CRC calculation length for the selected SPI.

Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
SPI_CRCLengthspecifies the SPI CRC calculation length. This parameter can be one of the following values:
  • SPI_CRCLength_8b: Set CRC Calculation to 8 bits
  • SPI_CRCLength_16b: Set CRC Calculation to 16 bits
Return values
None

Definition at line 964 of file stm32f30x_spi.c.

uint16_t SPI_GetReceptionFIFOStatus ( SPI_TypeDef SPIx)

Returns the current SPIx Reception FIFO filled level.

Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
Return values
TheReception FIFO filling state.
  • SPI_ReceptionFIFOStatus_Empty: when FIFO is empty
  • SPI_ReceptionFIFOStatus_1QuarterFull: if more than 1 quarter-full.
  • SPI_ReceptionFIFOStatus_HalfFull: if more than 1 half-full.
  • SPI_ReceptionFIFOStatus_Full: when FIFO is full.

Definition at line 1275 of file stm32f30x_spi.c.

uint16_t SPI_GetTransmissionFIFOStatus ( SPI_TypeDef SPIx)

Returns the current SPIx Transmission FIFO filled level.

Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
Return values
TheTransmission FIFO filling state.
  • SPI_TransmissionFIFOStatus_Empty: when FIFO is empty
  • SPI_TransmissionFIFOStatus_1QuarterFull: if more than 1 quarter-full.
  • SPI_TransmissionFIFOStatus_HalfFull: if more than 1 half-full.
  • SPI_TransmissionFIFOStatus_Full: when FIFO is full.

Definition at line 1260 of file stm32f30x_spi.c.

void SPI_I2S_ClearITPendingBit ( SPI_TypeDef SPIx,
uint8_t  SPI_I2S_IT 
)

Clears the SPIx CRC Error (CRCERR) interrupt pending bit.

Parameters
SPIxTo select the SPIx/I2Sx peripheral, where x can be: 1, 2, 3, 4, 5 or 6 in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode.
SPI_I2S_ITspecifies the SPI interrupt pending bit to clear. This function clears only CRCERR interrupt pending bit.
  • SPI_IT_CRCERR: CRC Error interrupt.
Note
OVR (OverRun Error) interrupt pending bit is cleared by software sequence: a read operation to SPI_DR register (SPI_I2S_ReceiveData()) followed by a read operation to SPI_SR register (SPI_I2S_GetITStatus()).
UDR (UnderRun Error) interrupt pending bit is cleared by a read operation to SPI_SR register (SPI_I2S_GetITStatus()).
MODF (Mode Fault) interrupt pending bit is cleared by software sequence: a read/write operation to SPI_SR register (SPI_I2S_GetITStatus()) followed by a write operation to SPI_CR1 register (SPI_Cmd() to enable the SPI).
Return values
None
Parameters
SPIxwhere x can be
  • 1, 2 or 3 in SPI mode
SPI_I2S_ITspecifies the SPI interrupt pending bit to clear. This function clears only CRCERR interrupt pending bit.
Note
  • OVR (OverRun Error) interrupt pending bit is cleared by software sequence: a read operation to SPI_DR register (SPI_I2S_ReceiveData()) followed by a read operation to SPI_SR register (SPI_I2S_GetITStatus()).
  • UDR (UnderRun Error) interrupt pending bit is cleared by a read operation to SPI_SR register (SPI_I2S_GetITStatus()).
  • MODF (Mode Fault) interrupt pending bit is cleared by software sequence: a read/write operation to SPI_SR register (SPI_I2S_GetITStatus()) followed by a write operation to SPI_CR1 register (SPI_Cmd() to enable the SPI).
Return values
None

Definition at line 1282 of file stm32f4xx_spi.c.

uint16_t SPI_I2S_ReceiveData ( SPI_TypeDef SPIx)

Returns the most recent received data by the SPIx/I2Sx peripheral.

Parameters
SPIxTo select the SPIx/I2Sx peripheral, where x can be: 1, 2, 3, 4, 5 or 6 in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode.
Return values
Thevalue of the received data.
Parameters
SPIxwhere x can be
  • 1, 2 or 3 in SPI mode
  • 2 or 3 in I2S mode
Return values
Thevalue of the received data.

Definition at line 801 of file stm32f4xx_spi.c.

uint16_t SPI_I2S_ReceiveData16 ( SPI_TypeDef SPIx)

Returns the most recent received data by the SPIx peripheral.

Parameters
SPIxTo select the SPIx/I2Sx peripheral, where x can be: 1, 2 or 3 in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode.
Return values
Thevalue of the received data.

Definition at line 882 of file stm32f30x_spi.c.

void SPI_I2S_SendData ( SPI_TypeDef SPIx,
uint16_t  Data 
)

Transmits a Data through the SPIx/I2Sx peripheral.

Parameters
SPIxTo select the SPIx/I2Sx peripheral, where x can be: 1, 2, 3, 4, 5 or 6 in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode.
DataData to be transmitted.
Return values
None
Parameters
SPIxwhere x can be
  • 1, 2 or 3 in SPI mode
  • 2 or 3 in I2S mode
Data: Data to be transmitted.
Return values
None

Definition at line 817 of file stm32f4xx_spi.c.

void SPI_I2S_SendData16 ( SPI_TypeDef SPIx,
uint16_t  Data 
)

Transmits a Data through the SPIx/I2Sx peripheral.

Parameters
SPIxTo select the SPIx/I2Sx peripheral, where x can be: 1, 2 or 3 in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode.
DataData to be transmitted.
Return values
None

Definition at line 850 of file stm32f30x_spi.c.

void SPI_LastDMATransferCmd ( SPI_TypeDef SPIx,
uint16_t  SPI_LastDMATransfer 
)

Configures the number of data to transfer type(Even/Odd) for the DMA last transfers and for the selected SPI.

Note
This function have a meaning only if DMA mode is selected and if the packing mode is used (data length <= 8 and DMA transfer size halfword)
Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
SPI_LastDMATransferspecifies the SPI last DMA transfers state. This parameter can be one of the following values:
  • SPI_LastDMATransfer_TxEvenRxEven: Number of data for transmission Even and number of data for reception Even.
  • SPI_LastDMATransfer_TxOddRxEven: Number of data for transmission Odd and number of data for reception Even.
  • SPI_LastDMATransfer_TxEvenRxOdd: Number of data for transmission Even and number of data for reception Odd.
  • SPI_LastDMATransfer_TxOddRxOdd: RNumber of data for transmission Odd and number of data for reception Odd.
Return values
None

Definition at line 1125 of file stm32f30x_spi.c.

void SPI_NSSPulseModeCmd ( SPI_TypeDef SPIx,
FunctionalState  NewState 
)

Enables or disables the NSS pulse management mode.

Note
This function can be called only after the SPI_Init() function has been called.
When TI mode is selected, the control bits NSSP is not taken into consideration and are configured by hardware respectively to the TI mode requirements.
Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
NewStatenew state of the NSS pulse management mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 781 of file stm32f30x_spi.c.

uint8_t SPI_ReceiveData8 ( SPI_TypeDef SPIx)

Returns the most recent received data by the SPIx peripheral.

Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
Return values
Thevalue of the received data.

Definition at line 863 of file stm32f30x_spi.c.

void SPI_RxFIFOThresholdConfig ( SPI_TypeDef SPIx,
uint16_t  SPI_RxFIFOThreshold 
)

Configures the FIFO reception threshold for the selected SPI.

Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
SPI_RxFIFOThresholdspecifies the FIFO reception threshold. This parameter can be one of the following values:
  • SPI_RxFIFOThreshold_HF: RXNE event is generated if the FIFO level is greater or equal to 1/2.
  • SPI_RxFIFOThreshold_QF: RXNE event is generated if the FIFO level is greater or equal to 1/4.
Return values
None

Definition at line 614 of file stm32f30x_spi.c.

void SPI_SendData8 ( SPI_TypeDef SPIx,
uint8_t  Data 
)

Transmits a Data through the SPIx peripheral.

Parameters
SPIxwhere x can be 1, 2 or 3 to select the SPI peripheral.
DataData to be transmitted.
Return values
None

Definition at line 830 of file stm32f30x_spi.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:55