| BlueNRG-1 Peripherals drivers APIs

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

Classes | Macros | Functions
BlueNRG1_spi.h File Reference

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

`#include "BlueNRG1.h"`

Go to the source code of this file.

## Classes

struct | SPI_InitType
| Structure definition of SPI initialization. More...

## Macros

#define | IS_SPI_BAUDRATE(BAUDRATE) ((BAUDRATE>=10000) && (BAUDRATE<=8000000))
#define | SPI_FULL_DUPLEX_MODE ((uint32_t)0x00000000)
#define | SPI_TRANSMIT_MODE ((uint32_t)0x00000001)
#define | SPI_RECEIVE_MODE ((uint32_t)0x00000002)
#define | SPI_COMBINED_MODE ((uint32_t)0x00000003)
#define | IS_SPI_COM_MODE(MODE)
#define | SPI_Mode_Master ((uint8_t)0x00)
#define | SPI_Mode_Slave ((uint8_t)0x01)
#define | IS_SPI_MODE(MODE)
#define | SPI_DataSize_32b ((uint8_t)0x1F)
#define | SPI_DataSize_31b ((uint8_t)0x1E)
#define | SPI_DataSize_30b ((uint8_t)0x1D)
#define | SPI_DataSize_29b ((uint8_t)0x1C)
#define | SPI_DataSize_28b ((uint8_t)0x1B)
#define | SPI_DataSize_27b ((uint8_t)0x1A)
#define | SPI_DataSize_26b ((uint8_t)0x19)
#define | SPI_DataSize_25b ((uint8_t)0x18)
#define | SPI_DataSize_24b ((uint8_t)0x17)
#define | SPI_DataSize_23b ((uint8_t)0x16)
#define | SPI_DataSize_22b ((uint8_t)0x15)
#define | SPI_DataSize_21b ((uint8_t)0x14)
#define | SPI_DataSize_20b ((uint8_t)0x13)
#define | SPI_DataSize_19b ((uint8_t)0x12)
#define | SPI_DataSize_18b ((uint8_t)0x11)
#define | SPI_DataSize_17b ((uint8_t)0x10)
#define | SPI_DataSize_16b ((uint8_t)0x0F)
#define | SPI_DataSize_15b ((uint8_t)0x0E)
#define | SPI_DataSize_14b ((uint8_t)0x0D)
#define | SPI_DataSize_13b ((uint8_t)0x0C)
#define | SPI_DataSize_12b ((uint8_t)0x0B)
#define | SPI_DataSize_11b ((uint8_t)0x0A)
#define | SPI_DataSize_10b ((uint8_t)0x09)
#define | SPI_DataSize_9b ((uint8_t)0x08)
#define | SPI_DataSize_8b ((uint8_t)0x07)
#define | SPI_DataSize_7b ((uint8_t)0x06)
#define | SPI_DataSize_6b ((uint8_t)0x05)
#define | SPI_DataSize_5b ((uint8_t)0x04)
#define | SPI_DataSize_4b ((uint8_t)0x03)
#define | IS_SPI_DATASIZE(DATASIZE) ((DATASIZE > 2) && (DATASIZE < 0x20))
#define | SPI_CPOL_Low ((uint8_t)0)
#define | SPI_CPOL_High ((uint8_t)1)
#define | IS_SPI_CPOL(CPOL)
#define | SPI_CPHA_1Edge ((uint8_t)0)
#define | SPI_CPHA_2Edge ((uint8_t)1)
#define | IS_SPI_CPHA(CPHA)
#define | SPI_IT_TE ((uint8_t)0x20)
#define | SPI_IT_TUR ((uint8_t)0x10)
#define | SPI_IT_TX ((uint8_t)0x08)
#define | SPI_IT_RX ((uint8_t)0x04)
#define | SPI_IT_RT ((uint8_t)0x02)
#define | SPI_IT_ROR ((uint8_t)0x01)
#define | SPI_IT_MSK ((uint8_t)0x3F)
#define | IS_SPI_CONFIG_IT(IT) (((IT & ~SPI_IT_MSK) == 0x00) && ((IT) != 0x00))
#define | IS_SPI_CLEAR_IT(IT)
#define | IS_SPI_GET_IT(IT)
#define | SPI_FLAG_TFE ((uint8_t)0x01)
#define | SPI_FLAG_TNF ((uint8_t)0x02)
#define | SPI_FLAG_RNE ((uint8_t)0x04)
#define | SPI_FLAG_RFF ((uint8_t)0x08)
#define | SPI_FLAG_BSY ((uint8_t)0x10)
#define | IS_SPI_GET_FLAG(FLAG)
#define | SPI_DMAReq_Tx ((uint8_t)0x04)
#define | SPI_DMAReq_Rx ((uint8_t)0x01)
#define | IS_SPI_DMAREQ(DMAREQ) ((DMAREQ==SPI_DMAReq_Tx) || (DMAREQ==SPI_DMAReq_Rx) || (DMAREQ==(SPI_DMAReq_Rx | SPI_DMAReq_Tx)))
#define | SPI_FIFO_LEV_1 ((uint8_t)0)
#define | SPI_FIFO_LEV_4 ((uint8_t)1)
#define | SPI_FIFO_LEV_8 ((uint8_t)2)
#define | IS_SPI_FIFO_LEV(FIFO_LEV)
#define | SPI_ENDIAN_MSByte_MSBit ((uint8_t)0)
#define | SPI_ENDIAN_LSByte_MSBit ((uint8_t)1)
#define | SPI_ENDIAN_MSByte_LSBit ((uint8_t)2)
#define | SPI_ENDIAN_LSByte_LSBit ((uint8_t)3)
#define | IS_SPI_ENDIAN(FORMAT)
#define | IS_WAIT_VALUE(VALUE) ( (VALUE) < 16)

## Functions

void | SPI_StructInit (SPI_InitType *SPI_InitStruct)
| Fills each SPI_InitStruct member with its default value. More...
void | SPI_DeInit (void)
| Deinitializes the SPI peripheral registers to their default reset values. More...
void | SPI_Init (SPI_InitType *SPI_InitStruct)
| Initializes the SPI peripheral according to the specified parameters in the SPI_InitStruct. More...
void | SPI_Cmd (FunctionalState NewState)
| Enables or disables the SPI peripheral. More...
void | SPI_ITConfig (uint8_t SPI_IT, FunctionalState NewState)
| Enables or disables the specified SPI interrupts. More...
void | SPI_DataSizeConfig (uint16_t SPI_DataSize)
| Configures the data size for the selected SPI. More...
void | SPI_SendData (uint32_t Data)
| Transmits a Data through the SPI peripheral. More...
uint32_t | SPI_ReceiveData (void)
| Returns the most recent received data by the SPI peripheral. More...
FlagStatus | SPI_GetFlagStatus (uint16_t SPI_FLAG)
| Checks whether the specified SPI flag is set or not. More...
ITStatus | SPI_GetITStatus (uint8_t SPI_IT)
| Checks whether the specified SPI interrupt has occurred or not. More...
void | SPI_ClearITPendingBit (uint8_t SPI_IT)
| Clears the SPI interrupt pending bits. More...
void | SPI_ClearRXFIFO (void)
| Clear all data present within the RX FIFO of the SPI peripherial. SPI peripherial clocks have to be enabled first before the use. More...
void | SPI_ClearTXFIFO (void)
| Clear all data present within the TX FIFO of the SPI peripherial. SPI peripherial clocks have to be enabled first before the use. More...
void | SPI_SetMasterCommunicationMode (uint32_t Mode)
| Set the SPI communication mode. More...
void | SPI_SetDummyCharacter (uint32_t NullCharacter)
| Set the dummy character used for the SPI master communication. More...
void | SPI_SetNumFramesToReceive (uint16_t Number)
| Set the number of frames to receive from slave. More...
void | SPI_SetNumFramesToTransmit (uint16_t Number)
| Set the number of frames to transmit to slave. More...
void | SPI_SlaveSwSelection (FunctionalState NewState)
| Master can select the slave by driving the CS pin by software. More...
void | SPI_EndianFormatReception (uint8_t Endian)
| Master can select the slave by driving the CS pin by software. More...
void | SPI_EndianFormatTransmission (uint8_t Endian)
| Master can select the slave by driving the CS pin by software. More...
void | SPI_DelayBetweenFrames (uint8_t Delay)
| Configure the delay between the frames. The MSPIWAIT value is used to insert a wait state between frames. The SSPFRM pulse duration is given by the equation: SSPCLKOUT x {MSPIWAIT - (SCR-1) / [2x(SCR+1)]}. When SCR=1, MSPIWAIT indicates the number of SSPCLKO cycle that the SSPFRM pulse duration should have between frames. More...
void | SPI_DelayDataInput (FunctionalState NewState)
| Master insert a delay of two clock cycle if enabled. More...
void | SPI_SlaveModeOutputCmd (FunctionalState NewState)
| Enables or disables the output if in slave mode. More...
void | SPI_DMACmd (uint8_t SPI_DMAReq, FunctionalState NewState)
| Enables or disables the SPI DMA interface. More...
void | SPI_TxFifoInterruptLevelConfig (uint8_t SPI_TX_FIFO_LEV)
| Sets the SPI interrupt FIFO level. More...
void | SPI_RxFifoInterruptLevelConfig (uint8_t SPI_RX_FIFO_LEV)
| Sets the SPI interrupt FIFO level. More...

## Detailed Description

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

Author
  AMS VMA RF application team

Version
  V2.0.0

Date
  21-March-2016

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 2016 STMicroelectronics

Definition in file BlueNRG1_spi.h.