![]() |
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
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... | |
#define USPI_CLR_BUF_INT_FLAG | ( | uspi, | |
u32IntTypeFlag | |||
) |
Clear specified buffer interrupt flag.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntTypeFlag | Interrupt Type Flag, should be |
Definition at line 269 of file usci_spi.h.
#define USPI_CLR_PROT_INT_FLAG | ( | uspi, | |
u32IntTypeFlag | |||
) |
Clear specified protocol interrupt flag.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntTypeFlag | Interrupt Type Flag, should be |
Definition at line 250 of file usci_spi.h.
#define USPI_CLR_WAKEUP_FLAG | ( | uspi | ) |
Clear the USCI_SPI wakeup flag.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 225 of file usci_spi.h.
#define USPI_DISABLE_3WIRE_MODE | ( | uspi | ) |
Disable slave 3-wire mode.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 75 of file usci_spi.h.
#define USPI_DISABLE_BUF_INT | ( | uspi, | |
u32IntSel | |||
) |
Disable specified buffer interrupt.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntSel | Interrupt Type, should be |
Definition at line 317 of file usci_spi.h.
#define USPI_DISABLE_PROT_INT | ( | uspi, | |
u32IntSel | |||
) |
Disable specified protocol interrupt.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntSel | Interrupt Type, should be |
Definition at line 295 of file usci_spi.h.
#define USPI_DISABLE_RX_PDMA | ( | uspi | ) |
Disable RX PDMA transfer.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Clear RXPDMAEN bit of USPI_PDMACTL register to disable RX PDMA transfer function.
Definition at line 380 of file usci_spi.h.
#define USPI_DISABLE_TRANS_INT | ( | uspi, | |
u32IntSel | |||
) |
Disable specified transfer interrupt.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntSel | Interrupt Type, should be |
Definition at line 343 of file usci_spi.h.
#define USPI_DISABLE_TX_PDMA | ( | uspi | ) |
Disable TX PDMA transfer.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Clear TXPDMAEN bit of USPI_PDMACTL register to disable TX PDMA transfer function.
Definition at line 389 of file usci_spi.h.
#define USPI_DISABLE_TX_RX_PDMA | ( | uspi | ) |
Disable TX and RX PDMA transfer.
[in] | uspi | The pointer of the specified USCI_SPI module. |
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.
#define USPI_ENABLE_3WIRE_MODE | ( | uspi | ) |
Enable slave 3-wire mode.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 83 of file usci_spi.h.
#define USPI_ENABLE_BUF_INT | ( | uspi, | |
u32IntSel | |||
) |
Enable specified buffer interrupt.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntSel | Interrupt Type, should be |
Definition at line 306 of file usci_spi.h.
#define USPI_ENABLE_PROT_INT | ( | uspi, | |
u32IntSel | |||
) |
Enable specified protocol interrupt.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntSel | Interrupt Type, should be |
Definition at line 282 of file usci_spi.h.
#define USPI_ENABLE_TRANS_INT | ( | uspi, | |
u32IntSel | |||
) |
Enable specified transfer interrupt.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32IntSel | Interrupt Type, should be |
Definition at line 330 of file usci_spi.h.
#define USPI_GET_BUF_STATUS | ( | uspi | ) |
Get buffer interrupt flag/status.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 258 of file usci_spi.h.
#define USPI_GET_PROT_STATUS | ( | uspi | ) |
Get protocol interrupt flag/status.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 233 of file usci_spi.h.
#define USPI_GET_RX_EMPTY_FLAG | ( | uspi | ) |
Get the Rx buffer empty flag.
[in] | uspi | The pointer of the specified USCI_SPI module. |
0 | Rx buffer is not empty |
1 | Rx buffer is empty |
Definition at line 93 of file usci_spi.h.
#define USPI_GET_TX_EMPTY_FLAG | ( | uspi | ) |
Get the Tx buffer empty flag.
[in] | uspi | The pointer of the specified USCI_SPI module. |
0 | Tx buffer is not empty |
1 | Tx buffer is empty |
Definition at line 103 of file usci_spi.h.
#define USPI_GET_TX_FULL_FLAG | ( | uspi | ) |
Get the Tx buffer full flag.
[in] | uspi | The pointer of the specified USCI_SPI module. |
0 | Tx buffer is not full |
1 | Tx buffer is full |
Definition at line 113 of file usci_spi.h.
#define USPI_GET_WAKEUP_FLAG | ( | uspi | ) |
Get the USCI_SPI wakeup flag.
[in] | uspi | The pointer of the specified USCI_SPI module. |
0 | Flag is not set. |
1 | Flag is set. |
Definition at line 217 of file usci_spi.h.
#define USPI_IS_BUSY | ( | uspi | ) |
Get the USCI_SPI busy state.
[in] | uspi | The pointer of the specified USCI_SPI module. |
0 | USCI_SPI module is not busy |
1 | USCI_SPI module is busy |
Definition at line 207 of file usci_spi.h.
#define USPI_READ_RX | ( | uspi | ) |
Get the datum read from RX register.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 121 of file usci_spi.h.
#define USPI_SET_DATA_WIDTH | ( | uspi, | |
u32Width | |||
) |
Set the data width of a USCI_SPI transaction.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32Width | The data width |
Definition at line 190 of file usci_spi.h.
#define USPI_SET_LSB_FIRST | ( | uspi | ) |
Set the USCI_SPI transfer sequence with LSB first.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 173 of file usci_spi.h.
#define USPI_SET_MSB_FIRST | ( | uspi | ) |
Set the USCI_SPI transfer sequence with MSB first.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 181 of file usci_spi.h.
#define USPI_SET_SS_HIGH | ( | uspi | ) |
Set USCI_SPI_SS pin to high state.
[in] | uspi | The pointer of the specified USCI_SPI module. |
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.
#define USPI_SET_SS_LOW | ( | uspi | ) |
Set USCI_SPI_SS pin to low state.
[in] | uspi | The pointer of the specified USCI_SPI module. |
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.
#define USPI_SET_SUSPEND_CYCLE | ( | uspi, | |
u32SuspCycle | |||
) |
Set the length of suspend interval.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32SuspCycle | Decide the length of suspend interval. |
Definition at line 165 of file usci_spi.h.
#define USPI_TRIGGER_RX_PDMA | ( | uspi | ) |
Trigger RX PDMA function.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Set RXPDMAEN bit of USPI_PDMACTL register to enable RX PDMA transfer function.
Definition at line 353 of file usci_spi.h.
#define USPI_TRIGGER_TX_PDMA | ( | uspi | ) |
Trigger TX PDMA function.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Set TXPDMAEN bit of USPI_PDMACTL register to enable TX PDMA transfer function.
Definition at line 362 of file usci_spi.h.
#define USPI_TRIGGER_TX_RX_PDMA | ( | uspi | ) |
Trigger TX and RX PDMA function.
[in] | uspi | The pointer of the specified USCI_SPI module. |
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.
#define USPI_WRITE_TX | ( | uspi, | |
u32TxData | |||
) |
Write datum to TX register.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32TxData | The datum which user attempt to transfer through USCI_SPI bus. |
Definition at line 130 of file usci_spi.h.
void USPI_ClearIntFlag | ( | USPI_T * | uspi, |
uint32_t | u32Mask | ||
) |
Clear interrupt flag.
[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: |
Definition at line 504 of file usci_spi.c.
void USPI_ClearRxBuf | ( | USPI_T * | uspi | ) |
Clear Rx buffer.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 123 of file usci_spi.c.
void USPI_ClearTxBuf | ( | USPI_T * | uspi | ) |
Clear Tx buffer.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 133 of file usci_spi.c.
void USPI_Close | ( | USPI_T * | uspi | ) |
Disable USCI_SPI function mode.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 113 of file usci_spi.c.
void USPI_DisableAutoSS | ( | USPI_T * | uspi | ) |
Disable the automatic slave select function.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 143 of file usci_spi.c.
void USPI_DisableInt | ( | USPI_T * | uspi, |
uint32_t | u32Mask | ||
) |
Disable related interrupts specified by u32Mask parameter.
[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: |
Definition at line 317 of file usci_spi.c.
void USPI_DisableWakeup | ( | USPI_T * | uspi | ) |
Disable USCI_SPI Wake-up Function.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 653 of file usci_spi.c.
void USPI_EnableAutoSS | ( | USPI_T * | uspi, |
uint32_t | u32SSPinMask, | ||
uint32_t | u32ActiveLevel | ||
) |
Enable the automatic slave select function. Only available in Master mode.
[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: |
Definition at line 157 of file usci_spi.c.
void USPI_EnableInt | ( | USPI_T * | uspi, |
uint32_t | u32Mask | ||
) |
Enable related interrupts specified by u32Mask parameter.
[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: |
Definition at line 234 of file usci_spi.c.
void USPI_EnableWakeup | ( | USPI_T * | uspi | ) |
Enable USCI_SPI Wake-up Function.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 643 of file usci_spi.c.
uint32_t USPI_GetBusClock | ( | USPI_T * | uspi | ) |
Get the actual frequency of USCI_SPI bus clock. Only available in Master mode.
[in] | uspi | The pointer of the specified USCI_SPI module. |
Definition at line 197 of file usci_spi.c.
uint32_t USPI_GetIntFlag | ( | USPI_T * | uspi, |
uint32_t | u32Mask | ||
) |
Get interrupt flag.
[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: |
Definition at line 399 of file usci_spi.c.
uint32_t USPI_GetStatus | ( | USPI_T * | uspi, |
uint32_t | u32Mask | ||
) |
Get USCI_SPI status.
[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: |
Definition at line 583 of file usci_spi.c.
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.
[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: |
[in] | u32SPIMode | Decide the transfer timing. Valid values are: |
[in] | u32DataWidth | The data width of a USCI_SPI transaction. |
[in] | u32BusClock | The expected frequency of USCI_SPI bus clock in Hz. |
Definition at line 43 of file usci_spi.c.
uint32_t USPI_SetBusClock | ( | USPI_T * | uspi, |
uint32_t | u32BusClock | ||
) |
Set the USCI_SPI bus clock. Only available in Master mode.
[in] | uspi | The pointer of the specified USCI_SPI module. |
[in] | u32BusClock | The expected frequency of USCI_SPI bus clock. |
Definition at line 169 of file usci_spi.c.