MG32L003 Standard Peripherals Firmware Library

结构体 | 宏定义 | 函数
mg32l003_spi.h 文件参考

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

`#include "mg32l003.h"`

浏览源代码.

## 结构体
struct | SPI_InitTypeDef
| SPI Init structure definition 更多...

## 宏定义
#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)

## 函数
void | SPI_DeInit (SPI_TypeDef *SPIx)
| Deinitializes the SPIx peripheral registers to their default reset values. 更多...
void | SPI_Init (SPI_TypeDef *SPIx, SPI_InitTypeDef *SPI_InitStruct)
| Initializes the SPIx peripheral according to the specified parameters in the SPI_InitStruct. 更多...
void | SPI_Cmd (SPI_TypeDef *SPIx, FunctionalState NewState)
| Enables or disables the specified SPI peripheral. 更多...
void | SPI_NSSConfig (SPI_TypeDef *SPIx, FunctionalState NewState)
| Enables or disables the specified slave select line. 更多...
uint8_t | SPI_ReadData (SPI_TypeDef *SPIx)
| Read one data from DATA register. 更多...
void | SPI_WriteData (SPI_TypeDef *SPIx, uint8_t Data)
| Write one data to DATA register. 更多...
FlagStatus | SPI_GetFlagStatus (SPI_TypeDef *SPIx, uint8_t SPI_FLAG)
| Checks whether the specified SPIx flag is set or not. 更多...

## 详细描述

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

作者
  megawin Application Team

版本
  V0.0.5

日期
  13-August-2024