MG32L003 Standard Peripherals Firmware Library
Functions
SPI_Private_Functions

Functions

void SPI_DeInit (SPI_TypeDef *SPIx)
 Deinitializes the SPIx peripheral registers to their default reset values. More...
 
void SPI_Init (SPI_TypeDef *SPIx, SPI_InitTypeDef *SPI_InitStruct)
 Initializes the SPIx peripheral according to the specified parameters in the SPI_InitStruct. More...
 
void SPI_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the specified SPI peripheral. More...
 
void SPI_NSSConfig (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the specified slave select line. More...
 
uint8_t SPI_ReadData (SPI_TypeDef *SPIx)
 Read one data from DATA register. More...
 
void SPI_WriteData (SPI_TypeDef *SPIx, uint8_t Data)
 Write one data to DATA register. More...
 
FlagStatus SPI_GetFlagStatus (SPI_TypeDef *SPIx, uint8_t SPI_FLAG)
 Checks whether the specified SPIx flag is set or not. More...
 

Detailed Description

Function Documentation

◆ SPI_Cmd()

void SPI_Cmd ( SPI_TypeDef SPIx,
FunctionalState  NewState 
)

Enables or disables the specified SPI peripheral.

Parameters
SPIxPointer to selected SPI peripheral. This parameter can be one of the following values: SPI.
NewStatenew state of the SPIx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None

◆ SPI_DeInit()

void SPI_DeInit ( SPI_TypeDef SPIx)

Deinitializes the SPIx peripheral registers to their default reset values.

Parameters
SPIxPointer to selected SPI peripheral. This parameter can be one of the following values: SPI.
Return values
None

◆ SPI_GetFlagStatus()

FlagStatus SPI_GetFlagStatus ( SPI_TypeDef SPIx,
uint8_t  SPI_FLAG 
)

Checks whether the specified SPIx flag is set or not.

Parameters
SPIxPointer to selected SPI peripheral. This parameter can be one of the following values: SPI.
SPI_FLAGspecifies the SPI flag to check. This parameter can be one of the following values:
  • SPI_FLAG_SPIF: End of transmission flag.
  • SPI_FLAG_WCOL: Write conflict flag.
  • SPI_FLAG_SSERR: Slave mode SSN error flag.
  • SPI_FLAG_MDF: Host mode error flag.
Return values
Thenew state of SPI_FLAG (SET or RESET).

◆ SPI_Init()

void SPI_Init ( SPI_TypeDef SPIx,
SPI_InitTypeDef SPI_InitStruct 
)

Initializes the SPIx peripheral according to the specified parameters in the SPI_InitStruct.

Parameters
SPIxPointer to selected SPI peripheral. This parameter can be one of the following values: SPI.
SPI_InitStructpointer to a SPI_InitTypeDef structure that contains the configuration information for the specified SPI peripheral.
Return values
None

◆ SPI_NSSConfig()

void SPI_NSSConfig ( SPI_TypeDef SPIx,
FunctionalState  NewState 
)

Enables or disables the specified slave select line.

Parameters
SPIxPointer to selected SPI peripheral. This parameter can be one of the following values: SPI.
NewStatenew state of the slave select line. This parameter can be: ENABLE or DISABLE.
Return values
None

◆ SPI_ReadData()

uint8_t SPI_ReadData ( SPI_TypeDef SPIx)

Read one data from DATA register.

Parameters
SPIxPointer to selected SPI peripheral. This parameter can be one of the following values: SPI.
Return values
Theread data.

◆ SPI_WriteData()

void SPI_WriteData ( SPI_TypeDef SPIx,
uint8_t  Data 
)

Write one data to DATA register.

Parameters
SPIxPointer to selected SPI peripheral. This parameter can be one of the following values: SPI.
DataThe data to write.
Return values
None