PAN1080 Peripheral API
|
Panchip series spi driver header file. More...
Go to the source code of this file.
Data Structures | |
struct | SPI_InitTypeDef |
SPI Init Structure definition. More... | |
Macros | |
#define | SPI_BAUD_RATE_DIV(x) ((x)?(x):(256)) |
Typedefs | |
typedef enum SPI_Irq | SPI_IrqDef |
typedef enum SPI_Role | SPI_RoleDef |
typedef enum SPI_DataFrameSize | SPI_DataFrameSizeDef |
typedef enum SPI_BaudRateDiv | SPI_BaudRateDivDef |
typedef enum SPI_ClockPol | SPI_ClockPolDef |
typedef enum SPI_ClockPhase | SPI_ClockPhaseDef |
typedef enum SPI_FrameFormat | SPI_FrameFormatDef |
Functions | |
__STATIC_INLINE void | SPI_EnableSpi (SPI_T *SPIx) |
Synchronous serial port enable. More... | |
__STATIC_INLINE void | SPI_DisableSpi (SPI_T *SPIx) |
Synchronous serial port disable. More... | |
__STATIC_INLINE bool | SPI_IsSpiEnabled (SPI_T *SPIx) |
get synchronous serial port status More... | |
__STATIC_INLINE void | SPI_EnableDmaTx (SPI_T *SPIx) |
DMA for the transmit FIFO is enabled. More... | |
__STATIC_INLINE void | SPI_DisableDmaTx (SPI_T *SPIx) |
DMA for the transmit FIFO is disabled. More... | |
__STATIC_INLINE bool | SPI_IsDmaTxEnabled (SPI_T *SPIx) |
get DMA for the transmit FIFO status More... | |
__STATIC_INLINE void | SPI_EnableDmaRx (SPI_T *SPIx) |
DMA for the receive FIFO is enabled. More... | |
__STATIC_INLINE void | SPI_DisableDmaRx (SPI_T *SPIx) |
DMA for the receive FIFO is disabled. More... | |
__STATIC_INLINE bool | SPI_IsDmaRxEnabled (SPI_T *SPIx) |
get DMA for the receive FIFO status More... | |
__STATIC_INLINE void | SPI_SendData (SPI_T *SPIx, uint32_t Data) |
Send data,DR is the data register and is 16-bits wide. More... | |
__STATIC_INLINE uint32_t | SPI_ReceiveData (SPI_T *SPIx) |
Receive data,DR is the data register and is 16-bits wide. More... | |
__STATIC_INLINE void | SPI_EnableIrq (SPI_T *SPIx, SPI_IrqDef irq) |
Interruput mask Enable. More... | |
__STATIC_INLINE void | SPI_DisableIrq (SPI_T *SPIx, SPI_IrqDef irq) |
Interruput mask Disable. More... | |
__STATIC_INLINE bool | SPI_IsIrqEnabled (SPI_T *SPIx, SPI_IrqDef irq) |
Get Interruput mask status. More... | |
__STATIC_INLINE SPI_IrqDef | SPI_GetMskedActiveIrq (SPI_T *SPIx) |
Get Masked Interruput status. More... | |
__STATIC_INLINE bool | SPI_IsIrqActive (SPI_T *SPIx, SPI_IrqDef irq) |
Get Masked Interruput status. More... | |
__STATIC_INLINE bool | SPI_IsRawIrqActive (SPI_T *SPIx, SPI_IrqDef irq) |
Get raw Interruput status. More... | |
__STATIC_INLINE void | SPI_ClearIrq (SPI_T *SPIx, SPI_IrqDef irq) |
clear Interruput status More... | |
__STATIC_INLINE SPI_IrqDef | SPI_GetRawActiveIrq (SPI_T *SPIx) |
Get Raw Interruput status. More... | |
__STATIC_INLINE bool | SPI_IsTxFifoEmpty (SPI_T *SPIx) |
Get Tx FIFO empty status. More... | |
__STATIC_INLINE bool | SPI_IsTxFifoFull (SPI_T *SPIx) |
Get Tx FIFO full status. More... | |
__STATIC_INLINE bool | SPI_IsRxFifoEmpty (SPI_T *SPIx) |
Get Tx FIFO empty status. More... | |
__STATIC_INLINE bool | SPI_IsRxFifoFull (SPI_T *SPIx) |
Get Tx FIFO full status. More... | |
__STATIC_INLINE bool | SPI_IsBusy (SPI_T *SPIx) |
Get Synchronous serial port busy status. More... | |
__STATIC_INLINE void | SPI_TxLsbEnable (SPI_T *SPIx, bool enable) |
Tx Lsb Send function control. More... | |
__STATIC_INLINE void | SPI_RxLsbEnable (SPI_T *SPIx, bool enable) |
Rx Lsb Send function control. More... | |
void | SPI_Init (SPI_T *SPIx, SPI_InitTypeDef *SPI_InitStruct) |
Initializes the SPIx peripheral according to the specified parameters in the SPI_InitStruct . More... | |
Panchip series spi driver header file.
__STATIC_INLINE void SPI_ClearIrq | ( | SPI_T * | SPIx, |
SPI_IrqDef | irq | ||
) |
clear Interruput status
SPIx | where x can be 1, 2 to select the SPI peripheral. |
irq | can be SPI_IRQ_RX_TIMEOUT SPI_IRQ_RX_OVERRUN |
__STATIC_INLINE void SPI_DisableDmaRx | ( | SPI_T * | SPIx | ) |
DMA for the receive FIFO is disabled.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE void SPI_DisableDmaTx | ( | SPI_T * | SPIx | ) |
DMA for the transmit FIFO is disabled.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE void SPI_DisableIrq | ( | SPI_T * | SPIx, |
SPI_IrqDef | irq | ||
) |
Interruput mask Disable.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
irq | where x can be SPI_IRQ_TX_HALF_EMPTY SPI_IRQ_RX_HALF_FULL SPI_IRQ_RX_TIMEOUT SPI_IRQ_RX_OVERRUN SPI_IRQ_ALL |
__STATIC_INLINE void SPI_DisableSpi | ( | SPI_T * | SPIx | ) |
Synchronous serial port disable.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE void SPI_EnableDmaRx | ( | SPI_T * | SPIx | ) |
DMA for the receive FIFO is enabled.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE void SPI_EnableDmaTx | ( | SPI_T * | SPIx | ) |
DMA for the transmit FIFO is enabled.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE void SPI_EnableIrq | ( | SPI_T * | SPIx, |
SPI_IrqDef | irq | ||
) |
Interruput mask Enable.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
irq | where x can be SPI_IRQ_TX_HALF_EMPTY SPI_IRQ_RX_HALF_FULL SPI_IRQ_RX_TIMEOUT SPI_IRQ_RX_OVERRUN SPI_IRQ_ALL |
__STATIC_INLINE void SPI_EnableSpi | ( | SPI_T * | SPIx | ) |
Synchronous serial port enable.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE SPI_IrqDef SPI_GetMskedActiveIrq | ( | SPI_T * | SPIx | ) |
Get Masked Interruput status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE SPI_IrqDef SPI_GetRawActiveIrq | ( | SPI_T * | SPIx | ) |
Get Raw Interruput status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
void SPI_Init | ( | SPI_T * | SPIx, |
SPI_InitTypeDef * | SPI_InitStruct | ||
) |
Initializes the SPIx peripheral according to the specified parameters in the SPI_InitStruct .
SPIx | where x can be 1, 2 to select the SPI peripheral. |
SPI_InitStruct | pointer to a SPI_InitTypeDef structure that contains the configuration information for the specified SPI peripheral. |
__STATIC_INLINE bool SPI_IsBusy | ( | SPI_T * | SPIx | ) |
Get Synchronous serial port busy status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE bool SPI_IsDmaRxEnabled | ( | SPI_T * | SPIx | ) |
get DMA for the receive FIFO status
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE bool SPI_IsDmaTxEnabled | ( | SPI_T * | SPIx | ) |
get DMA for the transmit FIFO status
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE bool SPI_IsIrqActive | ( | SPI_T * | SPIx, |
SPI_IrqDef | irq | ||
) |
Get Masked Interruput status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
irq | where x can be SPI_IRQ_TX_HALF_EMPTY SPI_IRQ_RX_HALF_FULL SPI_IRQ_RX_TIMEOUT SPI_IRQ_RX_OVERRUN SPI_IRQ_ALL |
__STATIC_INLINE bool SPI_IsIrqEnabled | ( | SPI_T * | SPIx, |
SPI_IrqDef | irq | ||
) |
Get Interruput mask status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
irq | where x can be SPI_IRQ_TX_HALF_EMPTY SPI_IRQ_RX_HALF_FULL SPI_IRQ_RX_TIMEOUT SPI_IRQ_RX_OVERRUN SPI_IRQ_ALL |
__STATIC_INLINE bool SPI_IsRawIrqActive | ( | SPI_T * | SPIx, |
SPI_IrqDef | irq | ||
) |
Get raw Interruput status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
irq | where x can be SPI_IRQ_TX_HALF_EMPTY SPI_IRQ_RX_HALF_FULL SPI_IRQ_RX_TIMEOUT SPI_IRQ_RX_OVERRUN SPI_IRQ_ALL |
__STATIC_INLINE bool SPI_IsRxFifoEmpty | ( | SPI_T * | SPIx | ) |
Get Tx FIFO empty status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE bool SPI_IsRxFifoFull | ( | SPI_T * | SPIx | ) |
Get Tx FIFO full status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE bool SPI_IsSpiEnabled | ( | SPI_T * | SPIx | ) |
get synchronous serial port status
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE bool SPI_IsTxFifoEmpty | ( | SPI_T * | SPIx | ) |
Get Tx FIFO empty status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE bool SPI_IsTxFifoFull | ( | SPI_T * | SPIx | ) |
Get Tx FIFO full status.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE uint32_t SPI_ReceiveData | ( | SPI_T * | SPIx | ) |
Receive data,DR is the data register and is 16-bits wide.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE void SPI_RxLsbEnable | ( | SPI_T * | SPIx, |
bool | enable | ||
) |
Rx Lsb Send function control.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
none |
__STATIC_INLINE void SPI_SendData | ( | SPI_T * | SPIx, |
uint32_t | Data | ||
) |
Send data,DR is the data register and is 16-bits wide.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
__STATIC_INLINE void SPI_TxLsbEnable | ( | SPI_T * | SPIx, |
bool | enable | ||
) |
Tx Lsb Send function control.
SPIx | where x can be 1, 2 to select the SPI peripheral. |
none |