M480 BSP V3.05.005
The Board Support Package for M480 Series
Macros | Functions

Macros

#define USPI_DISABLE_3WIRE_MODE(uspi)
 Disable slave 3-wire mode. More...
 
#define USPI_ENABLE_3WIRE_MODE(uspi)
 Enable slave 3-wire mode. More...
 
#define USPI_GET_RX_EMPTY_FLAG(uspi)
 Get the Rx buffer empty flag. More...
 
#define USPI_GET_TX_EMPTY_FLAG(uspi)
 Get the Tx buffer empty flag. More...
 
#define USPI_GET_TX_FULL_FLAG(uspi)
 Get the Tx buffer full flag. More...
 
#define USPI_READ_RX(uspi)
 Get the datum read from RX register. More...
 
#define USPI_WRITE_TX(uspi, u32TxData)
 Write datum to TX register. More...
 
#define USPI_SET_SS_HIGH(uspi)
 Set USCI_SPI_SS pin to high state. More...
 
#define USPI_SET_SS_LOW(uspi)
 Set USCI_SPI_SS pin to low state. More...
 
#define USPI_SET_SUSPEND_CYCLE(uspi, u32SuspCycle)
 Set the length of suspend interval. More...
 
#define USPI_SET_LSB_FIRST(uspi)
 Set the USCI_SPI transfer sequence with LSB first. More...
 
#define USPI_SET_MSB_FIRST(uspi)
 Set the USCI_SPI transfer sequence with MSB first. More...
 
#define USPI_SET_DATA_WIDTH(uspi, u32Width)
 Set the data width of a USCI_SPI transaction. More...
 
#define USPI_IS_BUSY(uspi)
 Get the USCI_SPI busy state. More...
 
#define USPI_GET_WAKEUP_FLAG(uspi)
 Get the USCI_SPI wakeup flag. More...
 
#define USPI_CLR_WAKEUP_FLAG(uspi)
 Clear the USCI_SPI wakeup flag. More...
 
#define USPI_GET_PROT_STATUS(uspi)
 Get protocol interrupt flag/status. More...
 
#define USPI_CLR_PROT_INT_FLAG(uspi, u32IntTypeFlag)
 Clear specified protocol interrupt flag. More...
 
#define USPI_GET_BUF_STATUS(uspi)
 Get buffer interrupt flag/status. More...
 
#define USPI_CLR_BUF_INT_FLAG(uspi, u32IntTypeFlag)
 Clear specified buffer interrupt flag. More...
 
#define USPI_ENABLE_PROT_INT(uspi, u32IntSel)
 Enable specified protocol interrupt. More...
 
#define USPI_DISABLE_PROT_INT(uspi, u32IntSel)
 Disable specified protocol interrupt. More...
 
#define USPI_ENABLE_BUF_INT(uspi, u32IntSel)
 Enable specified buffer interrupt. More...
 
#define USPI_DISABLE_BUF_INT(uspi, u32IntSel)
 Disable specified buffer interrupt. More...
 
#define USPI_ENABLE_TRANS_INT(uspi, u32IntSel)
 Enable specified transfer interrupt. More...
 
#define USPI_DISABLE_TRANS_INT(uspi, u32IntSel)
 Disable specified transfer interrupt. More...
 
#define USPI_TRIGGER_RX_PDMA(uspi)
 Trigger RX PDMA function. More...
 
#define USPI_TRIGGER_TX_PDMA(uspi)
 Trigger TX PDMA function. More...
 
#define USPI_TRIGGER_TX_RX_PDMA(uspi)
 Trigger TX and RX PDMA function. More...
 
#define USPI_DISABLE_RX_PDMA(uspi)
 Disable RX PDMA transfer. More...
 
#define USPI_DISABLE_TX_PDMA(uspi)
 Disable TX PDMA transfer. More...
 
#define USPI_DISABLE_TX_RX_PDMA(uspi)
 Disable TX and RX PDMA transfer. More...
 

Functions

uint32_t USPI_Open (USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock)
 This function make USCI_SPI module be ready to transfer. By default, the USCI_SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic slave select function is disabled. In Slave mode, the u32BusClock must be NULL and the USCI_SPI clock divider setting will be 0. More...
 
void USPI_Close (USPI_T *uspi)
 Disable USCI_SPI function mode. More...
 
void USPI_ClearRxBuf (USPI_T *uspi)
 Clear Rx buffer. More...
 
void USPI_ClearTxBuf (USPI_T *uspi)
 Clear Tx buffer. More...
 
void USPI_DisableAutoSS (USPI_T *uspi)
 Disable the automatic slave select function. More...
 
void USPI_EnableAutoSS (USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel)
 Enable the automatic slave select function. Only available in Master mode. More...
 
uint32_t USPI_SetBusClock (USPI_T *uspi, uint32_t u32BusClock)
 Set the USCI_SPI bus clock. Only available in Master mode. More...
 
uint32_t USPI_GetBusClock (USPI_T *uspi)
 Get the actual frequency of USCI_SPI bus clock. Only available in Master mode. More...
 
void USPI_EnableInt (USPI_T *uspi, uint32_t u32Mask)
 Enable related interrupts specified by u32Mask parameter. More...
 
void USPI_DisableInt (USPI_T *uspi, uint32_t u32Mask)
 Disable related interrupts specified by u32Mask parameter. More...
 
uint32_t USPI_GetIntFlag (USPI_T *uspi, uint32_t u32Mask)
 Get interrupt flag. More...
 
void USPI_ClearIntFlag (USPI_T *uspi, uint32_t u32Mask)
 Clear interrupt flag. More...
 
uint32_t USPI_GetStatus (USPI_T *uspi, uint32_t u32Mask)
 Get USCI_SPI status. More...
 
void USPI_EnableWakeup (USPI_T *uspi)
 Enable USCI_SPI Wake-up Function. More...
 
void USPI_DisableWakeup (USPI_T *uspi)
 Disable USCI_SPI Wake-up Function. More...
 

Detailed Description

Macro Definition Documentation

◆ USPI_CLR_BUF_INT_FLAG

#define USPI_CLR_BUF_INT_FLAG (   uspi,
  u32IntTypeFlag 
)

Clear specified buffer interrupt flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntTypeFlagInterrupt Type Flag, should be
Returns
None

Definition at line 269 of file usci_spi.h.

◆ USPI_CLR_PROT_INT_FLAG

#define USPI_CLR_PROT_INT_FLAG (   uspi,
  u32IntTypeFlag 
)

Clear specified protocol interrupt flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntTypeFlagInterrupt Type Flag, should be
Returns
None

Definition at line 250 of file usci_spi.h.

◆ USPI_CLR_WAKEUP_FLAG

#define USPI_CLR_WAKEUP_FLAG (   uspi)

Clear the USCI_SPI wakeup flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 225 of file usci_spi.h.

◆ USPI_DISABLE_3WIRE_MODE

#define USPI_DISABLE_3WIRE_MODE (   uspi)

Disable slave 3-wire mode.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 75 of file usci_spi.h.

◆ USPI_DISABLE_BUF_INT

#define USPI_DISABLE_BUF_INT (   uspi,
  u32IntSel 
)

Disable specified buffer interrupt.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntSelInterrupt Type, should be
Returns
None

Definition at line 317 of file usci_spi.h.

◆ USPI_DISABLE_PROT_INT

#define USPI_DISABLE_PROT_INT (   uspi,
  u32IntSel 
)

Disable specified protocol interrupt.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntSelInterrupt Type, should be
Returns
None

Definition at line 295 of file usci_spi.h.

◆ USPI_DISABLE_RX_PDMA

#define USPI_DISABLE_RX_PDMA (   uspi)

Disable RX PDMA transfer.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Clear RXPDMAEN bit of USPI_PDMACTL register to disable RX PDMA transfer function.

Definition at line 380 of file usci_spi.h.

◆ USPI_DISABLE_TRANS_INT

#define USPI_DISABLE_TRANS_INT (   uspi,
  u32IntSel 
)

Disable specified transfer interrupt.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntSelInterrupt Type, should be
Returns
None

Definition at line 343 of file usci_spi.h.

◆ USPI_DISABLE_TX_PDMA

#define USPI_DISABLE_TX_PDMA (   uspi)

Disable TX PDMA transfer.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Clear TXPDMAEN bit of USPI_PDMACTL register to disable TX PDMA transfer function.

Definition at line 389 of file usci_spi.h.

◆ USPI_DISABLE_TX_RX_PDMA

#define USPI_DISABLE_TX_RX_PDMA (   uspi)

Disable TX and RX PDMA transfer.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Clear TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to disable TX and RX PDMA transfer function.

Definition at line 398 of file usci_spi.h.

◆ USPI_ENABLE_3WIRE_MODE

#define USPI_ENABLE_3WIRE_MODE (   uspi)

Enable slave 3-wire mode.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 83 of file usci_spi.h.

◆ USPI_ENABLE_BUF_INT

#define USPI_ENABLE_BUF_INT (   uspi,
  u32IntSel 
)

Enable specified buffer interrupt.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntSelInterrupt Type, should be
Returns
None

Definition at line 306 of file usci_spi.h.

◆ USPI_ENABLE_PROT_INT

#define USPI_ENABLE_PROT_INT (   uspi,
  u32IntSel 
)

Enable specified protocol interrupt.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntSelInterrupt Type, should be
Returns
None

Definition at line 282 of file usci_spi.h.

◆ USPI_ENABLE_TRANS_INT

#define USPI_ENABLE_TRANS_INT (   uspi,
  u32IntSel 
)

Enable specified transfer interrupt.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32IntSelInterrupt Type, should be
Returns
None

Definition at line 330 of file usci_spi.h.

◆ USPI_GET_BUF_STATUS

#define USPI_GET_BUF_STATUS (   uspi)

Get buffer interrupt flag/status.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
The interrupt flag/status of buffer status register.

Definition at line 258 of file usci_spi.h.

◆ USPI_GET_PROT_STATUS

#define USPI_GET_PROT_STATUS (   uspi)

Get protocol interrupt flag/status.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
The interrupt flag/status of protocol status register.

Definition at line 233 of file usci_spi.h.

◆ USPI_GET_RX_EMPTY_FLAG

#define USPI_GET_RX_EMPTY_FLAG (   uspi)

Get the Rx buffer empty flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
Rx buffer flag
Return values
0Rx buffer is not empty
1Rx buffer is empty

Definition at line 93 of file usci_spi.h.

◆ USPI_GET_TX_EMPTY_FLAG

#define USPI_GET_TX_EMPTY_FLAG (   uspi)

Get the Tx buffer empty flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
Tx buffer flag
Return values
0Tx buffer is not empty
1Tx buffer is empty

Definition at line 103 of file usci_spi.h.

◆ USPI_GET_TX_FULL_FLAG

#define USPI_GET_TX_FULL_FLAG (   uspi)

Get the Tx buffer full flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
Tx buffer flag
Return values
0Tx buffer is not full
1Tx buffer is full

Definition at line 113 of file usci_spi.h.

◆ USPI_GET_WAKEUP_FLAG

#define USPI_GET_WAKEUP_FLAG (   uspi)

Get the USCI_SPI wakeup flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
Wakeup status.
Return values
0Flag is not set.
1Flag is set.

Definition at line 217 of file usci_spi.h.

◆ USPI_IS_BUSY

#define USPI_IS_BUSY (   uspi)

Get the USCI_SPI busy state.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
USCI_SPI busy status
Return values
0USCI_SPI module is not busy
1USCI_SPI module is busy

Definition at line 207 of file usci_spi.h.

◆ USPI_READ_RX

#define USPI_READ_RX (   uspi)

Get the datum read from RX register.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
data in Rx register

Definition at line 121 of file usci_spi.h.

◆ USPI_SET_DATA_WIDTH

#define USPI_SET_DATA_WIDTH (   uspi,
  u32Width 
)

Set the data width of a USCI_SPI transaction.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32WidthThe data width
Returns
None

Definition at line 190 of file usci_spi.h.

◆ USPI_SET_LSB_FIRST

#define USPI_SET_LSB_FIRST (   uspi)

Set the USCI_SPI transfer sequence with LSB first.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 173 of file usci_spi.h.

◆ USPI_SET_MSB_FIRST

#define USPI_SET_MSB_FIRST (   uspi)

Set the USCI_SPI transfer sequence with MSB first.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 181 of file usci_spi.h.

◆ USPI_SET_SS_HIGH

#define USPI_SET_SS_HIGH (   uspi)

Set USCI_SPI_SS pin to high state.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Disable automatic slave selection function and set USCI_SPI_SS pin to high state. Only available in Master mode.

Definition at line 139 of file usci_spi.h.

◆ USPI_SET_SS_LOW

#define USPI_SET_SS_LOW (   uspi)

Set USCI_SPI_SS pin to low state.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Disable automatic slave selection function and set USCI_SPI_SS pin to low state. Only available in Master mode.

Definition at line 152 of file usci_spi.h.

◆ USPI_SET_SUSPEND_CYCLE

#define USPI_SET_SUSPEND_CYCLE (   uspi,
  u32SuspCycle 
)

Set the length of suspend interval.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32SuspCycleDecide the length of suspend interval.
Returns
None

Definition at line 165 of file usci_spi.h.

◆ USPI_TRIGGER_RX_PDMA

#define USPI_TRIGGER_RX_PDMA (   uspi)

Trigger RX PDMA function.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Set RXPDMAEN bit of USPI_PDMACTL register to enable RX PDMA transfer function.

Definition at line 353 of file usci_spi.h.

◆ USPI_TRIGGER_TX_PDMA

#define USPI_TRIGGER_TX_PDMA (   uspi)

Trigger TX PDMA function.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Set TXPDMAEN bit of USPI_PDMACTL register to enable TX PDMA transfer function.

Definition at line 362 of file usci_spi.h.

◆ USPI_TRIGGER_TX_RX_PDMA

#define USPI_TRIGGER_TX_RX_PDMA (   uspi)

Trigger TX and RX PDMA function.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None.

Set TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to enable TX and RX PDMA transfer function.

Definition at line 371 of file usci_spi.h.

◆ USPI_WRITE_TX

#define USPI_WRITE_TX (   uspi,
  u32TxData 
)

Write datum to TX register.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32TxDataThe datum which user attempt to transfer through USCI_SPI bus.
Returns
None

Definition at line 130 of file usci_spi.h.

Function Documentation

◆ USPI_ClearIntFlag()

void USPI_ClearIntFlag ( USPI_T uspi,
uint32_t  u32Mask 
)

Clear interrupt flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32MaskThe combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be cleared. It could be the combination of:
Returns
None

Definition at line 504 of file usci_spi.c.

◆ USPI_ClearRxBuf()

void USPI_ClearRxBuf ( USPI_T uspi)

Clear Rx buffer.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 123 of file usci_spi.c.

◆ USPI_ClearTxBuf()

void USPI_ClearTxBuf ( USPI_T uspi)

Clear Tx buffer.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 133 of file usci_spi.c.

◆ USPI_Close()

void USPI_Close ( USPI_T uspi)

Disable USCI_SPI function mode.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 113 of file usci_spi.c.

◆ USPI_DisableAutoSS()

void USPI_DisableAutoSS ( USPI_T uspi)

Disable the automatic slave select function.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 143 of file usci_spi.c.

◆ USPI_DisableInt()

void USPI_DisableInt ( USPI_T uspi,
uint32_t  u32Mask 
)

Disable related interrupts specified by u32Mask parameter.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32MaskThe combination of all related interrupt enable bits. Each bit corresponds to a interrupt bit. This parameter decides which interrupts will be disabled. Valid values are:
Returns
None

Definition at line 317 of file usci_spi.c.

◆ USPI_DisableWakeup()

void USPI_DisableWakeup ( USPI_T uspi)

Disable USCI_SPI Wake-up Function.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 653 of file usci_spi.c.

◆ USPI_EnableAutoSS()

void USPI_EnableAutoSS ( USPI_T uspi,
uint32_t  u32SSPinMask,
uint32_t  u32ActiveLevel 
)

Enable the automatic slave select function. Only available in Master mode.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32SSPinMaskThis parameter is not used.
[in]u32ActiveLevelThe active level of slave select signal. Valid values are:
Returns
None

Definition at line 157 of file usci_spi.c.

◆ USPI_EnableInt()

void USPI_EnableInt ( USPI_T uspi,
uint32_t  u32Mask 
)

Enable related interrupts specified by u32Mask parameter.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32MaskThe combination of all related interrupt enable bits. Each bit corresponds to a interrupt bit. This parameter decides which interrupts will be enabled. Valid values are:
Returns
None

Definition at line 234 of file usci_spi.c.

◆ USPI_EnableWakeup()

void USPI_EnableWakeup ( USPI_T uspi)

Enable USCI_SPI Wake-up Function.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
None

Definition at line 643 of file usci_spi.c.

◆ USPI_GetBusClock()

uint32_t USPI_GetBusClock ( USPI_T uspi)

Get the actual frequency of USCI_SPI bus clock. Only available in Master mode.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
Returns
Actual USCI_SPI bus clock frequency.

Definition at line 197 of file usci_spi.c.

◆ USPI_GetIntFlag()

uint32_t USPI_GetIntFlag ( USPI_T uspi,
uint32_t  u32Mask 
)

Get interrupt flag.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32MaskThe combination of all related interrupt sources. Each bit corresponds to a interrupt source. This parameter decides which interrupt flags will be read. It is combination of:
Returns
Interrupt flags of selected sources.

Definition at line 399 of file usci_spi.c.

◆ USPI_GetStatus()

uint32_t USPI_GetStatus ( USPI_T uspi,
uint32_t  u32Mask 
)

Get USCI_SPI status.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32MaskThe combination of all related sources. Each bit corresponds to a source. This parameter decides which flags will be read. It is combination of:
Returns
Flags of selected sources.

Definition at line 583 of file usci_spi.c.

◆ USPI_Open()

uint32_t USPI_Open ( USPI_T uspi,
uint32_t  u32MasterSlave,
uint32_t  u32SPIMode,
uint32_t  u32DataWidth,
uint32_t  u32BusClock 
)

This function make USCI_SPI module be ready to transfer. By default, the USCI_SPI transfer sequence is MSB first, the slave selection signal is active low and the automatic slave select function is disabled. In Slave mode, the u32BusClock must be NULL and the USCI_SPI clock divider setting will be 0.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32MasterSlaveDecide the USCI_SPI module is operating in master mode or in slave mode. Valid values are:
[in]u32SPIModeDecide the transfer timing. Valid values are:
[in]u32DataWidthThe data width of a USCI_SPI transaction.
[in]u32BusClockThe expected frequency of USCI_SPI bus clock in Hz.
Returns
Actual frequency of USCI_SPI peripheral clock.

Definition at line 43 of file usci_spi.c.

◆ USPI_SetBusClock()

uint32_t USPI_SetBusClock ( USPI_T uspi,
uint32_t  u32BusClock 
)

Set the USCI_SPI bus clock. Only available in Master mode.

Parameters
[in]uspiThe pointer of the specified USCI_SPI module.
[in]u32BusClockThe expected frequency of USCI_SPI bus clock.
Returns
Actual frequency of USCI_SPI peripheral clock.

Definition at line 169 of file usci_spi.c.