| BlueNRG-1 Peripherals drivers APIs

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

Macros | Functions
BlueNRG1_spi.c File Reference

This file provides all the SPI firmware functions. More...

`#include "BlueNRG1_spi.h"`

Go to the source code of this file.

## Macros

#define | MAX_SCR (255)
#define | MAX_CPSVDR (254)
#define | MIN_DIVIDER (1)
#define | MAX_DIVIDER (65024)
#define | SPI_CLOCK (16000000)

## Functions

void | SPI_SetBaudrate (uint32_t Baudrate)
| SPI set baud rate function. 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_StructInit (SPI_InitType *SPI_InitStruct)
| Fills each SPI_InitStruct member with its default value. 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_SlaveModeOutputCmd (FunctionalState NewState)
| Enables or disables the output if in slave mode. 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...
void | SPI_DataSizeConfig (uint16_t SPI_DataSize)
| Configures the data size for the selected SPI. 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_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...
void | SPI_DMACmd (uint8_t SPI_DMAReq, FunctionalState NewState)
| Enables or disables the SPI DMA interface. More...

## Detailed Description

This file provides all the SPI firmware functions.

Author
  VMA 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.c.