MTB CAT5 Peripheral driver library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

General Description

Functions

cy_en_scb_spi_status_t Cy_SCB_SPI_Init (CySCB_Type *base, cy_stc_scb_spi_config_t const *config, cy_stc_scb_spi_context_t *context)
 
void Cy_SCB_SPI_DeInit (CySCB_Type *base)
 
__STATIC_INLINE void Cy_SCB_SPI_Enable (CySCB_Type *base)
 Enables the SCB block for the SPI operation. More...
 
void Cy_SCB_SPI_Disable (CySCB_Type *base, cy_stc_scb_spi_context_t *context)
 
__STATIC_INLINE void Cy_SCB_SPI_SetActiveSlaveSelect (CySCB_Type *base, cy_en_scb_spi_slave_select_t slaveSelect)
 Selects an active slave select line from one of four available. More...
 
__STATIC_INLINE void Cy_SCB_SPI_SetActiveSlaveSelectPolarity (CySCB_Type *base, cy_en_scb_spi_slave_select_t slaveSelect, cy_en_scb_spi_polarity_t polarity)
 Sets the active polarity for the slave select line. More...
 
__STATIC_INLINE BOOL8 Cy_SCB_SPI_IsBusBusy (CySCB_Type const *base)
 Returns whether the SPI bus is busy or not. More...
 

Function Documentation

__STATIC_INLINE void Cy_SCB_SPI_Enable ( CySCB_Type base)

Enables the SCB block for the SPI operation.

Parameters
baseThe pointer to the SPI SCB instance.
__STATIC_INLINE void Cy_SCB_SPI_SetActiveSlaveSelect ( CySCB_Type base,
cy_en_scb_spi_slave_select_t  slaveSelect 
)

Selects an active slave select line from one of four available.

This function is applicable for the master and slave.

Parameters
baseThe pointer to the SPI SCB instance.
slaveSelectThe slave select line number. See cy_en_scb_spi_slave_select_t for the set of constants.
Note
The SCB must be idle or disabled before calling this function.
__STATIC_INLINE void Cy_SCB_SPI_SetActiveSlaveSelectPolarity ( CySCB_Type base,
cy_en_scb_spi_slave_select_t  slaveSelect,
cy_en_scb_spi_polarity_t  polarity 
)

Sets the active polarity for the slave select line.

Parameters
baseThe pointer to the SPI SCB instance.
slaveSelectThe slave select line number. See cy_en_scb_spi_slave_select_t for the set of constants.
polarityThe polarity of the slave select line. See cy_en_scb_spi_polarity_t for the set of constants.
Note
The SCB must be idle or disabled before calling this function.
__STATIC_INLINE BOOL8 Cy_SCB_SPI_IsBusBusy ( CySCB_Type const *  base)

Returns whether the SPI bus is busy or not.

The bus busy is determined using the slave select signal.

  • Motorola and National Semiconductor sub-modes: the bus is busy after the slave select line is activated and lasts until the slave select line is deactivated.
  • Texas Instrument sub-modes: The bus is busy the moment of the initial pulse on the slave select line and lasts until the transfer is complete (all bytes from the TX FIFO area shifted-out on the bus).
Parameters
baseThe pointer to the SPI SCB instance.
Returns
True - the bus is busy; FALSE - the bus is idle.
Note
  • The SPI master does not assign the slave select line immediately after the first data element is written into the TX FIFO. It takes up to two SCLK clocks to assign the slave select line. Before this happens, the bus is considered idle.
  • If the SPI master is configured to transmit each data element separated by a de-assertion of the slave select line, the bus is busy during each element transfer and is free between them.