STM8L15x Standard Peripherals Drivers
|
stm8l15x_spi.c File Reference
This file provides firmware functions to manage the following functionalities of the Serial peripheral interface (SPI):
- Initialization and Configuration
- Data transfers functions
- Hardware CRC Calculation
- DMA transfers management
- Interrupts and flags management.
#include "stm8l15x_spi.h"
Go to the source code of this file.
Functions | |
void | SPI_BiDirectionalLineConfig (SPI_TypeDef *SPIx, SPI_Direction_TypeDef SPI_Direction) |
Selects the data transfer direction in Bi-directional mode. | |
void | SPI_CalculateCRCCmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the CRC value calculation of the transferred bytes. | |
void | SPI_ClearFlag (SPI_TypeDef *SPIx, SPI_FLAG_TypeDef SPI_FLAG) |
Clears the SPI flags. | |
void | SPI_ClearITPendingBit (SPI_TypeDef *SPIx, SPI_IT_TypeDef SPI_IT) |
Clears the interrupt pending bits. | |
void | SPI_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Enables or disables the SPI peripheral. | |
void | SPI_DeInit (SPI_TypeDef *SPIx) |
Deinitializes the SPI peripheral registers to their default reset values. | |
void | SPI_DMACmd (SPI_TypeDef *SPIx, SPI_DMAReq_TypeDef SPI_DMAReq, FunctionalState NewState) |
Enables or disables the SPI DMA interface. | |
uint8_t | SPI_GetCRC (SPI_TypeDef *SPIx, SPI_CRC_TypeDef SPI_CRC) |
Returns the transmit or the receive CRC register value. | |
uint8_t | SPI_GetCRCPolynomial (SPI_TypeDef *SPIx) |
Returns the CRC Polynomial register value. | |
FlagStatus | SPI_GetFlagStatus (SPI_TypeDef *SPIx, SPI_FLAG_TypeDef SPI_FLAG) |
Checks whether the specified SPI flag is set or not. | |
ITStatus | SPI_GetITStatus (SPI_TypeDef *SPIx, SPI_IT_TypeDef SPI_IT) |
Checks whether the specified interrupt has occurred or not. | |
void | SPI_Init (SPI_TypeDef *SPIx, SPI_FirstBit_TypeDef SPI_FirstBit, SPI_BaudRatePrescaler_TypeDef SPI_BaudRatePrescaler, SPI_Mode_TypeDef SPI_Mode, SPI_CPOL_TypeDef SPI_CPOL, SPI_CPHA_TypeDef SPI_CPHA, SPI_DirectionMode_TypeDef SPI_Data_Direction, SPI_NSS_TypeDef SPI_Slave_Management, uint8_t CRCPolynomial) |
Initializes the SPI according to the specified parameters. | |
void | SPI_ITConfig (SPI_TypeDef *SPIx, SPI_IT_TypeDef SPI_IT, FunctionalState NewState) |
Enables or disables the specified interrupts. | |
void | SPI_NSSInternalSoftwareCmd (SPI_TypeDef *SPIx, FunctionalState NewState) |
Configures internally by software the NSS pin. | |
uint8_t | SPI_ReceiveData (SPI_TypeDef *SPIx) |
Returns the most recent received data by the SPI peripheral. | |
void | SPI_ResetCRC (SPI_TypeDef *SPIx) |
Reset the Rx CRCR and Tx CRCR registers. | |
void | SPI_SendData (SPI_TypeDef *SPIx, uint8_t Data) |
Transmits a Data through the SPI peripheral. | |
void | SPI_TransmitCRC (SPI_TypeDef *SPIx) |
Enables the transmit of the CRC value. |
Detailed Description
This file provides firmware functions to manage the following functionalities of the Serial peripheral interface (SPI):
- Initialization and Configuration
- Data transfers functions
- Hardware CRC Calculation
- DMA transfers management
- Interrupts and flags management.
- Attention:
THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
© COPYRIGHT 2011 STMicroelectronics
Definition in file stm8l15x_spi.c.