M4521_BSP V3.02.000
The Board Support Package for M4521
Functions
spi.c File Reference

M4521 SPI driver source file. More...

#include "M4521.h"
Include dependency graph for spi.c:

Go to the source code of this file.

Functions

uint32_t SPI_Open (SPI_T *spi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock)
 This function make SPI module be ready to transfer. More...
 
void SPI_Close (SPI_T *spi)
 Disable SPI controller. More...
 
void SPI_ClearRxFIFO (SPI_T *spi)
 Clear RX FIFO buffer. More...
 
void SPI_ClearTxFIFO (SPI_T *spi)
 Clear TX FIFO buffer. More...
 
void SPI_DisableAutoSS (SPI_T *spi)
 Disable the automatic slave selection function. More...
 
void SPI_EnableAutoSS (SPI_T *spi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel)
 Enable the automatic slave selection function. More...
 
uint32_t SPI_SetBusClock (SPI_T *spi, uint32_t u32BusClock)
 Set the SPI bus clock. More...
 
void SPI_SetFIFO (SPI_T *spi, uint32_t u32TxThreshold, uint32_t u32RxThreshold)
 Configure FIFO threshold setting. More...
 
uint32_t SPI_GetBusClock (SPI_T *spi)
 Get the actual frequency of SPI bus clock. Only available in Master mode. More...
 
void SPI_EnableInt (SPI_T *spi, uint32_t u32Mask)
 Enable interrupt function. More...
 
void SPI_DisableInt (SPI_T *spi, uint32_t u32Mask)
 Disable interrupt function. More...
 
uint32_t SPI_GetIntFlag (SPI_T *spi, uint32_t u32Mask)
 Get interrupt flag. More...
 
void SPI_ClearIntFlag (SPI_T *spi, uint32_t u32Mask)
 Clear interrupt flag. More...
 
uint32_t SPI_GetStatus (SPI_T *spi, uint32_t u32Mask)
 Get SPI status. More...
 
static uint32_t I2S_GetSourceClockFreq (SPI_T *i2s)
 This function is used to get I2S source clock frequency. More...
 
uint32_t I2S_Open (SPI_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32Channels, uint32_t u32DataFormat)
 This function configures some parameters of I2S interface for general purpose use. More...
 
void I2S_Close (SPI_T *i2s)
 Disable I2S function. More...
 
void I2S_EnableInt (SPI_T *i2s, uint32_t u32Mask)
 Enable interrupt function. More...
 
void I2S_DisableInt (SPI_T *i2s, uint32_t u32Mask)
 Disable interrupt function. More...
 
uint32_t I2S_EnableMCLK (SPI_T *i2s, uint32_t u32BusClock)
 Enable master clock (MCLK). More...
 
void I2S_DisableMCLK (SPI_T *i2s)
 Disable master clock (MCLK). More...
 
void I2S_SetFIFO (SPI_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold)
 Configure FIFO threshold setting. More...
 

Detailed Description

M4521 SPI driver source file.

Version
V3.00
Revision
11
Date
15/08/11 10:26a
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2022 Nuvoton Technology Corp. All rights reserved.

Definition in file spi.c.