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) |
Initializes the SCB for SPI operation. More... | |
void | Cy_SCB_SPI_DeInit (CySCB_Type *base) |
De-initializes the SCB block; returns the register values to default. More... | |
__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) |
Disables the SCB block, clears context statuses, and disables TX and RX interrupt sources. More... | |
__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 bool | Cy_SCB_SPI_IsBusBusy (CySCB_Type const *base) |
Returns whether the SPI bus is busy or not. More... | |
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 | ||
) |
Initializes the SCB for SPI operation.
base | The pointer to the SPI SCB instance. |
config | The pointer to the configuration structure cy_stc_scb_spi_config_t. |
context | The pointer to the context structure cy_stc_scb_spi_context_t allocated by the user. The structure is used during the SPI operation for internal configuration and data retention. The user must not modify anything in this structure. If only SPI Low-Level API will be used pass NULL as pointer to context. |
void Cy_SCB_SPI_DeInit | ( | CySCB_Type * | base | ) |
De-initializes the SCB block; returns the register values to default.
base | The pointer to the SPI SCB instance. |
__STATIC_INLINE void Cy_SCB_SPI_Enable | ( | CySCB_Type * | base | ) |
Enables the SCB block for the SPI operation.
base | The pointer to the SPI SCB instance. |
void Cy_SCB_SPI_Disable | ( | CySCB_Type * | base, |
cy_stc_scb_spi_context_t * | context | ||
) |
Disables the SCB block, clears context statuses, and disables TX and RX interrupt sources.
Note that after the block is disabled, the TX and RX FIFOs and hardware statuses are cleared. Also, the hardware stops driving the output and ignores the input. Refer to section Low Power Support for more information about SPI pins when SCB disabled.
base | The pointer to the SPI SCB instance. |
context | The pointer to the context structure cy_stc_scb_spi_context_t allocated by the user. The structure is used during the SPI operation for internal configuration and data retention. The user must not modify anything in this structure. If only SPI functions that do not require context will be used to pass NULL as pointer to 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.
This function is applicable for the master and slave.
base | The pointer to the SPI SCB instance. |
slaveSelect | The slave select line number. See cy_en_scb_spi_slave_select_t for the set of constants. |
__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.
base | The pointer to the SPI SCB instance. |
slaveSelect | The slave select line number. See cy_en_scb_spi_slave_select_t for the set of constants. |
polarity | The polarity of the slave select line. See cy_en_scb_spi_polarity_t for the set of constants. |
__STATIC_INLINE bool 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.
base | The pointer to the SPI SCB instance. |