| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros | Functions
USCI_SPI Exported Functions
Standard Driver » USCI_SPI Driver

## 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntTypeFlag | Interrupt Type Flag, should be USPI_BUFSTS_TXUDRIF_Msk USPI_BUFSTS_RXOVIF_Msk

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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntTypeFlag | Interrupt Type Flag, should be USPI_PROTSTS_SSACTIF_Msk USPI_PROTSTS_SSINAIF_Msk USPI_PROTSTS_SLVBEIF_Msk USPI_PROTSTS_SLVTOIF_Msk USPI_PROTSTS_RXENDIF_Msk USPI_PROTSTS_RXSTIF_Msk USPI_PROTSTS_TXENDIF_Msk USPI_PROTSTS_TXSTIF_Msk

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] | uspi | The 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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntSel | Interrupt Type, should be USPI_BUFCTL_RXOVIEN_Msk USPI_BUFCTL_TXUDRIEN_Msk

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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntSel | Interrupt Type, should be USPI_PROTIEN_SLVBEIEN_Msk USPI_PROTIEN_SLVTOIEN_Msk USPI_PROTIEN_SSACTIEN_Msk USPI_PROTIEN_SSINAIEN_Msk

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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntSel | Interrupt Type, should be USPI_INTEN_RXENDIEN_Msk USPI_INTEN_RXSTIEN_Msk USPI_INTEN_TXENDIEN_Msk USPI_INTEN_TXSTIEN_Msk

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] | uspi | The 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] | uspi | The 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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntSel | Interrupt Type, should be USPI_BUFCTL_RXOVIEN_Msk USPI_BUFCTL_TXUDRIEN_Msk

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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntSel | Interrupt Type, should be USPI_PROTIEN_SLVBEIEN_Msk USPI_PROTIEN_SLVTOIEN_Msk USPI_PROTIEN_SSACTIEN_Msk USPI_PROTIEN_SSINAIEN_Msk

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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32IntSel | Interrupt Type, should be USPI_INTEN_RXENDIEN_Msk USPI_INTEN_RXSTIEN_Msk USPI_INTEN_TXENDIEN_Msk USPI_INTEN_TXSTIEN_Msk

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] | uspi | The 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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.

Returns
  Rx buffer flag

Return values

  0 | Rx buffer is not empty
  1 | Rx 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] | uspi | The pointer of the specified USCI_SPI module.

Returns
  Tx buffer flag

Return values

  0 | Tx buffer is not empty
  1 | Tx 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] | uspi | The pointer of the specified USCI_SPI module.

Returns
  Tx buffer flag

Return values

  0 | Tx buffer is not full
  1 | Tx 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] | uspi | The pointer of the specified USCI_SPI module.

Returns
  Wakeup status.

Return values

  0 | Flag is not set.
  1 | Flag 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] | uspi | The pointer of the specified USCI_SPI module.

Returns
  USCI_SPI busy status

Return values

  0 | USCI_SPI module is not busy
  1 | USCI_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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32Width | The 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] | uspi | The 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] | uspi | The 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] | uspi | The 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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32SuspCycle | Decide 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] | uspi | The 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] | uspi | The 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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32TxData | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32Mask | The 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: USPI_SSINACT_INT_MASK USPI_SSACT_INT_MASK USPI_SLVTO_INT_MASK USPI_SLVBE_INT_MASK USPI_TXUDR_INT_MASK USPI_RXOV_INT_MASK USPI_TXST_INT_MASK USPI_TXEND_INT_MASK USPI_RXST_INT_MASK USPI_RXEND_INT_MASK

Returns
  None

Definition at line 504 of file usci_spi.c.

## ◆ USPI_ClearRxBuf()

void USPI_ClearRxBuf | ( | USPI_T * | uspi | ) |

Clear Rx buffer.

Parameters

  [in] | uspi | The 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] | uspi | The 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] | uspi | The 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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32Mask | The 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: USPI_SSINACT_INT_MASK USPI_SSACT_INT_MASK USPI_SLVTO_INT_MASK USPI_SLVBE_INT_MASK USPI_TXUDR_INT_MASK USPI_RXOV_INT_MASK USPI_TXST_INT_MASK USPI_TXEND_INT_MASK USPI_RXST_INT_MASK USPI_RXEND_INT_MASK

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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32SSPinMask | This parameter is not used.
  [in] | u32ActiveLevel | The active level of slave select signal. Valid values are: USPI_SS_ACTIVE_HIGH USPI_SS_ACTIVE_LOW

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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32Mask | The 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: USPI_SSINACT_INT_MASK USPI_SSACT_INT_MASK USPI_SLVTO_INT_MASK USPI_SLVBE_INT_MASK USPI_TXUDR_INT_MASK USPI_RXOV_INT_MASK USPI_TXST_INT_MASK USPI_TXEND_INT_MASK USPI_RXST_INT_MASK USPI_RXEND_INT_MASK

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] | uspi | The 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] | uspi | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32Mask | The 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: USPI_SSINACT_INT_MASK USPI_SSACT_INT_MASK USPI_SLVTO_INT_MASK USPI_SLVBE_INT_MASK USPI_TXUDR_INT_MASK USPI_RXOV_INT_MASK USPI_TXST_INT_MASK USPI_TXEND_INT_MASK USPI_RXST_INT_MASK USPI_RXEND_INT_MASK

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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32Mask | The combination of all related sources. Each bit corresponds to a source. This parameter decides which flags will be read. It is combination of: USPI_BUSY_MASK USPI_RX_EMPTY_MASK USPI_RX_FULL_MASK USPI_TX_EMPTY_MASK USPI_TX_FULL_MASK USPI_SSLINE_STS_MASK

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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32MasterSlave | Decide the USCI_SPI module is operating in master mode or in slave mode. Valid values are: USPI_SLAVE USPI_MASTER
  [in] | u32SPIMode | Decide the transfer timing. Valid values are: USPI_MODE_0 USPI_MODE_1 USPI_MODE_2 USPI_MODE_3
  [in] | u32DataWidth | The data width of a USCI_SPI transaction.
  [in] | u32BusClock | The 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] | uspi | The pointer of the specified USCI_SPI module.
  [in] | u32BusClock | The expected frequency of USCI_SPI bus clock.

Returns
  Actual frequency of USCI_SPI peripheral clock.

Definition at line 169 of file usci_spi.c.