STM32F37 Standard Peripheral bibliotheek
1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
|
SPI driver modules. More...
Modules | |
SPI_Exported_Constants | |
SPI_Private_Functions | |
Data Structures | |
struct | SPI_InitTypeDef |
SPI Init structure definition. More... | |
struct | I2S_InitTypeDef |
I2S Init structure definition. More... | |
Macros | |
#define | CR1_CLEAR_MASK ((uint16_t)0x3040) |
#define | CR1_CLEAR_MASK2 ((uint16_t)0xFFFB) |
#define | CR2_LDMA_MASK ((uint16_t)0x9FFF) |
#define | I2SCFGR_CLEAR_Mask ((uint16_t)0xF040) |
Functions | |
void | SPI_I2S_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 | I2S_Init (SPI_TypeDef *SPIx, I2S_InitTypeDef *I2S_InitStruct) |
Initializes the SPIx peripheral according to the specified parameters in the I2S_InitStruct. More... | |
void | SPI_StructInit (SPI_InitTypeDef *SPI_InitStruct) |
Fills each SPI_InitStruct member with its default value. More... | |
void | I2S_StructInit (I2S_InitTypeDef *I2S_InitStruct) |
Fills each I2S_InitStruct member with its default value. More... | |
void | SPI_TIModeCmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the TI Mode. More... | |
void | SPI_NSSPulseModeCmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the NSS pulse management mode. More... | |
void | SPI_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the specified SPI peripheral. More... | |
void | I2S_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the specified SPI peripheral (in I2S mode). More... | |
void | SPI_DataSizeConfig (SPI_TypeDef *SPIx, uint16_t SPI_DataSize) |
Configures the data size for the selected SPI. More... | |
void | SPI_RxFIFOThresholdConfig (SPI_TypeDef *SPIx, uint16_t SPI_RxFIFOThreshold) |
Configures the FIFO reception threshold for the selected SPI. More... | |
void | SPI_BiDirectionalLineConfig (SPI_TypeDef *SPIx, uint16_t SPI_Direction) |
Selects the data transfer direction in bidirectional mode for the specified SPI. More... | |
void | SPI_NSSInternalSoftwareConfig (SPI_TypeDef *SPIx, uint16_t SPI_NSSInternalSoft) |
Configures internally by software the NSS pin for the selected SPI. More... | |
void | SPI_SSOutputCmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the SS output for the selected SPI. More... | |
void | SPI_SendData8 (SPI_TypeDef *SPIx, uint8_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... | |
uint8_t | SPI_ReceiveData8 (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_CRCLengthConfig (SPI_TypeDef *SPIx, uint16_t SPI_CRCLength) |
Configures the CRC calculation length for the selected SPI. More... | |
void | SPI_CalculateCRC (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the CRC value calculation of the transferred bytes. More... | |
void | SPI_TransmitCRC (SPI_TypeDef *SPIx) |
Transmit the SPIx CRC value. More... | |
uint16_t | SPI_GetCRC (SPI_TypeDef *SPIx, uint8_t SPI_CRC) |
Returns the transmit or the receive CRC register value for the specified SPI. More... | |
uint16_t | SPI_GetCRCPolynomial (SPI_TypeDef *SPIx) |
Returns the CRC Polynomial register value for the specified SPI. More... | |
void | SPI_I2S_DMACmd (SPI_TypeDef *SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState) |
Enables or disables the SPIx/I2Sx DMA interface. 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_I2S_ITConfig (SPI_TypeDef *SPIx, uint8_t SPI_I2S_IT, FunctionalState NewState) |
Enables or disables the specified SPI/I2S interrupts. More... | |
uint16_t | SPI_GetTransmissionFIFOStatus (SPI_TypeDef *SPIx) |
Returns the current SPIx Transmission FIFO filled level. More... | |
uint16_t | SPI_GetReceptionFIFOStatus (SPI_TypeDef *SPIx) |
Returns the current SPIx Reception FIFO filled level. More... | |
FlagStatus | SPI_I2S_GetFlagStatus (SPI_TypeDef *SPIx, uint16_t SPI_I2S_FLAG) |
Checks whether the specified SPI flag is set or not. More... | |
void | SPI_I2S_ClearFlag (SPI_TypeDef *SPIx, uint16_t SPI_I2S_FLAG) |
Clears the SPIx CRC Error (CRCERR) flag. More... | |
ITStatus | SPI_I2S_GetITStatus (SPI_TypeDef *SPIx, uint8_t SPI_I2S_IT) |
Checks whether the specified SPI/I2S interrupt has occurred or not. More... | |
SPI driver modules.
void I2S_Cmd | ( | SPI_TypeDef * | SPIx, |
FunctionalState | NewState | ||
) |
Enables or disables the specified SPI peripheral (in I2S mode).
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
NewState,: | new state of the SPIx peripheral. This parameter can be: ENABLE or DISABLE. |
None |
void I2S_Init | ( | SPI_TypeDef * | SPIx, |
I2S_InitTypeDef * | I2S_InitStruct | ||
) |
Initializes the SPIx peripheral according to the specified parameters in the I2S_InitStruct.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
I2S_InitStruct,: | pointer to an I2S_InitTypeDef structure that contains the configuration information for the specified SPI peripheral configured in I2S mode. |
None |
void I2S_StructInit | ( | I2S_InitTypeDef * | I2S_InitStruct | ) |
Fills each I2S_InitStruct member with its default value.
I2S_InitStruct,: | pointer to a I2S_InitTypeDef structure which will be initialized. |
None |
void SPI_BiDirectionalLineConfig | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_Direction | ||
) |
Selects the data transfer direction in bidirectional mode for the specified SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_Direction,: | specifies the data transfer direction in bidirectional mode. This parameter can be one of the following values:
|
None |
void SPI_CalculateCRC | ( | SPI_TypeDef * | SPIx, |
FunctionalState | NewState | ||
) |
Enables or disables the CRC value calculation of the transferred bytes.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral.. |
NewState,: | new state of the SPIx CRC value calculation. This parameter can be: ENABLE or DISABLE. |
None |
void SPI_Cmd | ( | SPI_TypeDef * | SPIx, |
FunctionalState | NewState | ||
) |
Enables or disables the specified SPI peripheral.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
NewState,: | new state of the SPIx peripheral. This parameter can be: ENABLE or DISABLE. |
None |
void SPI_CRCLengthConfig | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_CRCLength | ||
) |
Configures the CRC calculation length for the selected SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_CRCLength,: | specifies the SPI CRC calculation length. This parameter can be one of the following values:
|
None |
void SPI_DataSizeConfig | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_DataSize | ||
) |
Configures the data size for the selected SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_DataSize,: | specifies the SPI data size. For the SPIx peripheral this parameter can be one of the following values:
|
None |
uint16_t SPI_GetCRC | ( | SPI_TypeDef * | SPIx, |
uint8_t | SPI_CRC | ||
) |
Returns the transmit or the receive CRC register value for the specified SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_CRC,: | specifies the CRC register to be read. This parameter can be one of the following values:
|
The | selected CRC register value.. |
uint16_t SPI_GetCRCPolynomial | ( | SPI_TypeDef * | SPIx | ) |
Returns the CRC Polynomial register value for the specified SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
The | CRC Polynomial register value. |
uint16_t SPI_GetReceptionFIFOStatus | ( | SPI_TypeDef * | SPIx | ) |
Returns the current SPIx Reception FIFO filled level.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
The | Reception FIFO filling state.
|
uint16_t SPI_GetTransmissionFIFOStatus | ( | SPI_TypeDef * | SPIx | ) |
Returns the current SPIx Transmission FIFO filled level.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
The | Transmission FIFO filling state.
|
void SPI_I2S_ClearFlag | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_I2S_FLAG | ||
) |
Clears the SPIx CRC Error (CRCERR) flag.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_I2S_FLAG,: | specifies the SPI flag to clear. This function clears only CRCERR flag. |
None |
void SPI_I2S_DeInit | ( | SPI_TypeDef * | SPIx | ) |
Deinitializes the SPIx peripheral registers to their default reset values.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
None |
void SPI_I2S_DMACmd | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_I2S_DMAReq, | ||
FunctionalState | NewState | ||
) |
Enables or disables the SPIx/I2Sx DMA interface.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_I2S_DMAReq,: | specifies the SPI DMA transfer request to be enabled or disabled. This parameter can be any combination of the following values:
|
NewState,: | new state of the selected SPI DMA transfer request. This parameter can be: ENABLE or DISABLE. |
None |
FlagStatus SPI_I2S_GetFlagStatus | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_I2S_FLAG | ||
) |
Checks whether the specified SPI flag is set or not.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_I2S_FLAG,: | specifies the SPI flag to check. This parameter can be one of the following values:
|
The | new state of SPI_I2S_FLAG (SET or RESET). |
ITStatus SPI_I2S_GetITStatus | ( | SPI_TypeDef * | SPIx, |
uint8_t | SPI_I2S_IT | ||
) |
Checks whether the specified SPI/I2S interrupt has occurred or not.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_I2S_IT,: | specifies the SPI interrupt source to check. This parameter can be one of the following values:
|
The | new state of SPI_I2S_IT (SET or RESET). |
void SPI_I2S_ITConfig | ( | SPI_TypeDef * | SPIx, |
uint8_t | SPI_I2S_IT, | ||
FunctionalState | NewState | ||
) |
Enables or disables the specified SPI/I2S interrupts.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_I2S_IT,: | specifies the SPI interrupt source to be enabled or disabled. This parameter can be one of the following values:
|
NewState,: | new state of the specified SPI interrupt. This parameter can be: ENABLE or DISABLE. |
None |
uint16_t SPI_I2S_ReceiveData16 | ( | SPI_TypeDef * | SPIx | ) |
Returns the most recent received data by the SPIx peripheral.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
The | value of the received data. |
void SPI_I2S_SendData16 | ( | SPI_TypeDef * | SPIx, |
uint16_t | Data | ||
) |
Transmits a Data through the SPIx/I2Sx peripheral.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
Data,: | Data to be transmitted. |
None |
void SPI_Init | ( | SPI_TypeDef * | SPIx, |
SPI_InitTypeDef * | SPI_InitStruct | ||
) |
Initializes the SPIx peripheral according to the specified parameters in the SPI_InitStruct.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_InitStruct,: | pointer to a SPI_InitTypeDef structure that contains the configuration information for the specified SPI peripheral. |
None |
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.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_LastDMATransfer,: | specifies the SPI last DMA transfers state. This parameter can be one of the following values:
|
None |
void SPI_NSSInternalSoftwareConfig | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_NSSInternalSoft | ||
) |
Configures internally by software the NSS pin for the selected SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_NSSInternalSoft,: | specifies the SPI NSS internal state. This parameter can be one of the following values:
|
None |
void SPI_NSSPulseModeCmd | ( | SPI_TypeDef * | SPIx, |
FunctionalState | NewState | ||
) |
Enables or disables the NSS pulse management mode.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
NewState,: | new state of the NSS pulse management mode. This parameter can be: ENABLE or DISABLE. |
None |
uint8_t SPI_ReceiveData8 | ( | SPI_TypeDef * | SPIx | ) |
Returns the most recent received data by the SPIx/I2Sx peripheral.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
The | value of the received data. |
void SPI_RxFIFOThresholdConfig | ( | SPI_TypeDef * | SPIx, |
uint16_t | SPI_RxFIFOThreshold | ||
) |
Configures the FIFO reception threshold for the selected SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
SPI_RxFIFOThreshold,: | specifies the FIFO reception threshold. This parameter can be one of the following values:
|
None |
void SPI_SendData8 | ( | SPI_TypeDef * | SPIx, |
uint8_t | Data | ||
) |
Transmits a Data through the SPIx/I2Sx peripheral.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
Data,: | Data to be transmitted. |
None |
void SPI_SSOutputCmd | ( | SPI_TypeDef * | SPIx, |
FunctionalState | NewState | ||
) |
Enables or disables the SS output for the selected SPI.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
NewState,: | new state of the SPIx SS output. This parameter can be: ENABLE or DISABLE. |
None |
void SPI_StructInit | ( | SPI_InitTypeDef * | SPI_InitStruct | ) |
Fills each SPI_InitStruct member with its default value.
SPI_InitStruct,: | pointer to a SPI_InitTypeDef structure which will be initialized. |
None |
void SPI_TIModeCmd | ( | SPI_TypeDef * | SPIx, |
FunctionalState | NewState | ||
) |
Enables or disables the TI Mode.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
NewState,: | new state of the selected SPI TI communication mode. This parameter can be: ENABLE or DISABLE. |
None |
void SPI_TransmitCRC | ( | SPI_TypeDef * | SPIx | ) |
Transmit the SPIx CRC value.
SPIx,: | where x can be 1, 2 or 3 to select the SPI peripheral. |
None |