Classes | Macros | Functions
stm32f30x_spi.h File Reference

This file contains all the functions prototypes for the SPI firmware library. More...

#include "stm32f30x.h"
Include dependency graph for stm32f30x_spi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Macros

#define I2S_AudioFreq_11k   ((uint32_t)11025)
 
#define I2S_AudioFreq_16k   ((uint32_t)16000)
 
#define I2S_AudioFreq_192k   ((uint32_t)192000)
 
#define I2S_AudioFreq_22k   ((uint32_t)22050)
 
#define I2S_AudioFreq_32k   ((uint32_t)32000)
 
#define I2S_AudioFreq_44k   ((uint32_t)44100)
 
#define I2S_AudioFreq_48k   ((uint32_t)48000)
 
#define I2S_AudioFreq_8k   ((uint32_t)8000)
 
#define I2S_AudioFreq_96k   ((uint32_t)96000)
 
#define I2S_AudioFreq_Default   ((uint32_t)2)
 
#define I2S_CPOL_High   ((uint16_t)0x0008)
 
#define I2S_CPOL_Low   ((uint16_t)0x0000)
 
#define I2S_DataFormat_16b   ((uint16_t)0x0000)
 
#define I2S_DataFormat_16bextended   ((uint16_t)0x0001)
 
#define I2S_DataFormat_24b   ((uint16_t)0x0003)
 
#define I2S_DataFormat_32b   ((uint16_t)0x0005)
 
#define I2S_FLAG_CHSIDE   ((uint16_t)0x0004)
 
#define I2S_FLAG_UDR   ((uint16_t)0x0008)
 
#define I2S_IT_UDR   ((uint8_t)0x53)
 
#define I2S_MCLKOutput_Disable   ((uint16_t)0x0000)
 
#define I2S_MCLKOutput_Enable   ((uint16_t)0x0200)
 
#define I2S_Mode_MasterRx   ((uint16_t)0x0300)
 
#define I2S_Mode_MasterTx   ((uint16_t)0x0200)
 
#define I2S_Mode_SlaveRx   ((uint16_t)0x0100)
 
#define I2S_Mode_SlaveTx   ((uint16_t)0x0000)
 
#define I2S_Standard_LSB   ((uint16_t)0x0020)
 
#define I2S_Standard_MSB   ((uint16_t)0x0010)
 
#define I2S_Standard_PCMLong   ((uint16_t)0x00B0)
 
#define I2S_Standard_PCMShort   ((uint16_t)0x0030)
 
#define I2S_Standard_Phillips   ((uint16_t)0x0000)
 
#define IS_I2S_AUDIO_FREQ(FREQ)
 
#define IS_I2S_CPOL(CPOL)
 
#define IS_I2S_DATA_FORMAT(FORMAT)
 
#define IS_I2S_EXT_PERIPH(PERIPH)
 
#define IS_I2S_MCLK_OUTPUT(OUTPUT)
 
#define IS_I2S_MODE(MODE)
 
#define IS_I2S_STANDARD(STANDARD)
 
#define IS_SPI_23_PERIPH(PERIPH)
 
#define IS_SPI_23_PERIPH_EXT(PERIPH)
 
#define IS_SPI_ALL_PERIPH(PERIPH)
 
#define IS_SPI_ALL_PERIPH_EXT(PERIPH)
 
#define IS_SPI_BAUDRATE_PRESCALER(PRESCALER)
 
#define IS_SPI_CLEAR_FLAG(FLAG)   (((FLAG) == SPI_FLAG_CRCERR))
 
#define IS_SPI_CPHA(CPHA)
 
#define IS_SPI_CPOL(CPOL)
 
#define IS_SPI_CRC(CRC)   (((CRC) == SPI_CRC_Tx) || ((CRC) == SPI_CRC_Rx))
 
#define IS_SPI_CRC_LENGTH(LENGTH)
 
#define IS_SPI_CRC_POLYNOMIAL(POLYNOMIAL)   ((POLYNOMIAL) >= 0x1)
 
#define IS_SPI_DATA_SIZE(SIZE)
 
#define IS_SPI_DIRECTION(DIRECTION)
 
#define IS_SPI_DIRECTION_MODE(MODE)
 
#define IS_SPI_FIRST_BIT(BIT)
 
#define IS_SPI_I2S_CONFIG_IT(IT)
 
#define IS_SPI_I2S_DMA_REQ(REQ)   ((((REQ) & (uint16_t)0xFFFC) == 0x00) && ((REQ) != 0x00))
 
#define IS_SPI_I2S_GET_FLAG(FLAG)
 
#define IS_SPI_I2S_GET_IT(IT)
 
#define IS_SPI_LAST_DMA_TRANSFER(TRANSFER)
 
#define IS_SPI_MODE(MODE)
 
#define IS_SPI_NSS(NSS)
 
#define IS_SPI_NSS_INTERNAL(INTERNAL)
 
#define IS_SPI_RX_FIFO_THRESHOLD(THRESHOLD)
 
#define SPI_BaudRatePrescaler_128   ((uint16_t)0x0030)
 
#define SPI_BaudRatePrescaler_16   ((uint16_t)0x0018)
 
#define SPI_BaudRatePrescaler_2   ((uint16_t)0x0000)
 
#define SPI_BaudRatePrescaler_256   ((uint16_t)0x0038)
 
#define SPI_BaudRatePrescaler_32   ((uint16_t)0x0020)
 
#define SPI_BaudRatePrescaler_4   ((uint16_t)0x0008)
 
#define SPI_BaudRatePrescaler_64   ((uint16_t)0x0028)
 
#define SPI_BaudRatePrescaler_8   ((uint16_t)0x0010)
 
#define SPI_CPHA_1Edge   ((uint16_t)0x0000)
 
#define SPI_CPHA_2Edge   ((uint16_t)0x0001)
 
#define SPI_CPOL_High   ((uint16_t)0x0002)
 
#define SPI_CPOL_Low   ((uint16_t)0x0000)
 
#define SPI_CRC_Rx   ((uint8_t)0x01)
 
#define SPI_CRC_Tx   ((uint8_t)0x00)
 
#define SPI_CRCLength_16b   ((uint16_t)0x0800)
 
#define SPI_CRCLength_8b   ((uint16_t)0x0000)
 
#define SPI_DataSize_10b   ((uint16_t)0x0900)
 
#define SPI_DataSize_11b   ((uint16_t)0x0A00)
 
#define SPI_DataSize_12b   ((uint16_t)0x0B00)
 
#define SPI_DataSize_13b   ((uint16_t)0x0C00)
 
#define SPI_DataSize_14b   ((uint16_t)0x0D00)
 
#define SPI_DataSize_15b   ((uint16_t)0x0E00)
 
#define SPI_DataSize_16b   ((uint16_t)0x0F00)
 
#define SPI_DataSize_4b   ((uint16_t)0x0300)
 
#define SPI_DataSize_5b   ((uint16_t)0x0400)
 
#define SPI_DataSize_6b   ((uint16_t)0x0500)
 
#define SPI_DataSize_7b   ((uint16_t)0x0600)
 
#define SPI_DataSize_8b   ((uint16_t)0x0700)
 
#define SPI_DataSize_9b   ((uint16_t)0x0800)
 
#define SPI_Direction_1Line_Rx   ((uint16_t)0x8000)
 
#define SPI_Direction_1Line_Tx   ((uint16_t)0xC000)
 
#define SPI_Direction_2Lines_FullDuplex   ((uint16_t)0x0000)
 
#define SPI_Direction_2Lines_RxOnly   ((uint16_t)0x0400)
 
#define SPI_Direction_Rx   ((uint16_t)0xBFFF)
 
#define SPI_Direction_Tx   ((uint16_t)0x4000)
 
#define SPI_FirstBit_LSB   ((uint16_t)0x0080)
 
#define SPI_FirstBit_MSB   ((uint16_t)0x0000)
 
#define SPI_FLAG_CRCERR   ((uint16_t)0x0010)
 
#define SPI_FLAG_MODF   ((uint16_t)0x0020)
 
#define SPI_I2S_DMAReq_Rx   ((uint16_t)0x0001)
 
#define SPI_I2S_DMAReq_Tx   ((uint16_t)0x0002)
 
#define SPI_I2S_FLAG_BSY   ((uint16_t)0x0080)
 
#define SPI_I2S_FLAG_FRE   ((uint16_t)0x0100)
 
#define SPI_I2S_FLAG_OVR   ((uint16_t)0x0040)
 
#define SPI_I2S_FLAG_RXNE   ((uint16_t)0x0001)
 
#define SPI_I2S_FLAG_TXE   ((uint16_t)0x0002)
 
#define SPI_I2S_IT_ERR   ((uint8_t)0x50)
 
#define SPI_I2S_IT_FRE   ((uint8_t)0x58)
 
#define SPI_I2S_IT_OVR   ((uint8_t)0x56)
 
#define SPI_I2S_IT_RXNE   ((uint8_t)0x60)
 
#define SPI_I2S_IT_TXE   ((uint8_t)0x71)
 
#define SPI_IT_MODF   ((uint8_t)0x55)
 
#define SPI_LastDMATransfer_TxEvenRxEven   ((uint16_t)0x0000)
 
#define SPI_LastDMATransfer_TxEvenRxOdd   ((uint16_t)0x2000)
 
#define SPI_LastDMATransfer_TxOddRxEven   ((uint16_t)0x4000)
 
#define SPI_LastDMATransfer_TxOddRxOdd   ((uint16_t)0x6000)
 
#define SPI_Mode_Master   ((uint16_t)0x0104)
 
#define SPI_Mode_Slave   ((uint16_t)0x0000)
 
#define SPI_NSS_Hard   ((uint16_t)0x0000)
 
#define SPI_NSS_Soft   ((uint16_t)0x0200)
 
#define SPI_NSSInternalSoft_Reset   ((uint16_t)0xFEFF)
 
#define SPI_NSSInternalSoft_Set   ((uint16_t)0x0100)
 
#define SPI_ReceptionFIFOStatus_1QuarterFull   ((uint16_t)0x0200)
 
#define SPI_ReceptionFIFOStatus_Empty   ((uint16_t)0x0000)
 
#define SPI_ReceptionFIFOStatus_Full   ((uint16_t)0x0600)
 
#define SPI_ReceptionFIFOStatus_HalfFull   ((uint16_t)0x0400)
 
#define SPI_RxFIFOThreshold_HF   ((uint16_t)0x0000)
 
#define SPI_RxFIFOThreshold_QF   ((uint16_t)0x1000)
 
#define SPI_TransmissionFIFOStatus_1QuarterFull   ((uint16_t)0x0800)
 
#define SPI_TransmissionFIFOStatus_Empty   ((uint16_t)0x0000)
 
#define SPI_TransmissionFIFOStatus_Full   ((uint16_t)0x1800)
 
#define SPI_TransmissionFIFOStatus_HalfFull   ((uint16_t)0x1000)
 

Functions

void I2S_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the specified SPI peripheral (in I2S mode). More...
 
void I2S_FullDuplexConfig (SPI_TypeDef *I2Sxext, I2S_InitTypeDef *I2S_InitStruct)
 Configures the full duplex mode for the I2Sx peripheral using its extension I2Sxext according to the specified parameters in the I2S_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 I2S_StructInit (I2S_InitTypeDef *I2S_InitStruct)
 Fills each I2S_InitStruct member with its default value. 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_CalculateCRC (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the CRC value calculation of the transferred bytes. More...
 
void SPI_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the specified SPI peripheral. More...
 
void SPI_CRCLengthConfig (SPI_TypeDef *SPIx, uint16_t SPI_CRCLength)
 Configures the CRC calculation length for the selected SPI. More...
 
void SPI_DataSizeConfig (SPI_TypeDef *SPIx, uint16_t SPI_DataSize)
 Configures the data size for the selected SPI. 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...
 
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_ClearFlag (SPI_TypeDef *SPIx, uint16_t SPI_I2S_FLAG)
 Clears the SPIx CRC Error (CRCERR) flag. More...
 
void SPI_I2S_DeInit (SPI_TypeDef *SPIx)
 Deinitializes the SPIx peripheral registers to their default reset values. More...
 
void SPI_I2S_DMACmd (SPI_TypeDef *SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState)
 Enables or disables the SPIx/I2Sx DMA interface. More...
 
FlagStatus SPI_I2S_GetFlagStatus (SPI_TypeDef *SPIx, uint16_t SPI_I2S_FLAG)
 Checks whether the specified SPI flag is set or not. 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...
 
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_I2S_ReceiveData16 (SPI_TypeDef *SPIx)
 Returns the most recent received data by the SPIx peripheral. More...
 
void SPI_I2S_SendData16 (SPI_TypeDef *SPIx, uint16_t Data)
 Transmits a Data through the SPIx/I2Sx peripheral. 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_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_NSSInternalSoftwareConfig (SPI_TypeDef *SPIx, uint16_t SPI_NSSInternalSoft)
 Configures internally by software the NSS pin 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...
 
void SPI_SSOutputCmd (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the SS output for the selected SPI. More...
 
void SPI_StructInit (SPI_InitTypeDef *SPI_InitStruct)
 Fills each SPI_InitStruct member with its default value. More...
 
void SPI_TIModeCmd (SPI_TypeDef *SPIx, FunctionalState NewState)
 Enables or disables the TI Mode. More...
 
void SPI_TransmitCRC (SPI_TypeDef *SPIx)
 Transmits the SPIx CRC value. More...
 

Detailed Description

This file contains all the functions prototypes for the SPI firmware library.

Author
MCD Application Team
Version
V1.1.1
Date
04-April-2014
Attention

© COPYRIGHT 2014 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm32f30x_spi.h.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:21