WB32L003 Standard Peripherals Firmware Library

Data Structures | Macros | Functions
wb32l003_spi.h File Reference

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

`#include "wb32l003.h"`

Go to the source code of this file.

## Data Structures
struct | SPI_InitTypeDef
| SPI Init structure definition. More...

## Macros
#define | SPI_MODE_SLAVE ((uint8_t)0x00U)
#define | SPI_MODE_MASTER ((uint8_t)SPI_CR_MSTR)
#define | SPI_CPOL_Low ((uint8_t)0x00U)
#define | SPI_CPOL_High ((uint8_t)SPI_CR_CPOL)
#define | SPI_CPHA_1Edge ((uint8_t)0x00U)
#define | SPI_CPHA_2Edge ((uint8_t)SPI_CR_CPHA)
#define | SPI_NSS_MODE_HIGH ((uint8_t)SPI_SSN_SSN)
#define | SPI_NSS_MODE_LOW ((uint8_t)0x00U)
#define | SPI_BAUD_RATE_PRESCALER_2 ((uint8_t)0x00U)
#define | SPI_BAUD_RATE_PRESCALER_4 ((uint8_t)SPI_CR_SPR0)
#define | SPI_BAUD_RATE_PRESCALER_8 ((uint8_t)SPI_CR_SPR1)
#define | SPI_BAUD_RATE_PRESCALER_16 ((uint8_t)(SPI_CR_SPR0 | SPI_CR_SPR1))
#define | SPI_BAUD_RATE_PRESCALER_32 ((uint8_t)SPI_CR_SPR2)
#define | SPI_BAUD_RATE_PRESCALER_64 ((uint8_t)(SPI_CR_SPR2 | SPI_CR_SPR0))
#define | SPI_BAUD_RATE_PRESCALER_128 ((uint8_t)(SPI_CR_SPR2 | SPI_CR_SPR1))
#define | SPI_FLAG_SPIF ((uint8_t)SPI_SR_SPIF) /* SPI status flag: Tx ok flag */
#define | SPI_FLAG_WCOL ((uint8_t)SPI_SR_WCOL) /* SPI status flag: write conflict flag */
#define | SPI_FLAG_SSERR ((uint8_t)SPI_SR_SSERR) /* SPI Error flag: Slave SSN flag */
#define | SPI_FLAG_MDF ((uint8_t)SPI_SR_MDF) /* SPI Error flag: Master Mode error flag */
#define | IS_SPI_MODE(MODE)
#define | IS_SPI_CPOL(CPOL)
#define | IS_SPI_CPHA(CPHA)
#define | IS_SPI_NSS(NSS)
#define | IS_SPI_BAUDRATE_PRESCALER(PRESCALER)
#define | IS_SPI_ALL_PERIPH(PERIPH) ((PERIPH) == SPI)

## Functions
void | SPI_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 | SPI_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState)
| Enables or disables the specified SPI peripheral. More...
void | SPI_NSSConfig (SPI_TypeDef *SPIx, FunctionalState NewState)
| Enables or disables the specified slave select line. More...
uint8_t | SPI_ReadData (SPI_TypeDef *SPIx)
| Read one data from DATA register. More...
void | SPI_WriteData (SPI_TypeDef *SPIx, uint8_t Data)
| Write one data to DATA register. More...
FlagStatus | SPI_GetFlagStatus (SPI_TypeDef *SPIx, uint8_t SPI_FLAG)
| Checks whether the specified SPIx flag is set or not. More...

## Detailed Description

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

Author
  Westberry Application Team

Version
  V0.0.4

Date
  23-April-2023