CAT2 Peripheral Driver Library
SCB (Serial Communication Block)

General Description

The Serial Communications Block (SCB) supports three serial communication protocols: Serial Peripheral Interface (SPI), Universal Asynchronous Receiver Transmitter (UART), and Inter Integrated Circuit (I2C or IIC).

Only one of the protocols is supported by an SCB at any given time.

The functions and other declarations used in this driver are in cy_scb_spi.h, cy_scb_uart.h, cy_scb_ezi2c.h, cy_scb_i2c.h respectively. Include cy_pdl.h to get access to all functions and declarations in the PDL.

More Information

For more information on the SCB peripheral, refer to the technical reference manual (TRM).


VersionChangesReason for Change
4.20 The Cy_SCB_EZI2C_DeepSleepCallback, Cy_SCB_I2C_DeepSleepCallback, Cy_SCB_SPI_DeepSleepCallback, and Cy_SCB_UART_DeepSleepCallback parameter types are changed to match the cy_stc_syspm_callback_t::callback type. Eliminate compiler warnings
4.10 SPI: Fixed the issue when SPI Master and Slave interrupts are not enabled by the Cy_SCB_SPI_Init() function. Bug fixes.
4.0 Update the paths to the code snippets. PDL structure update.
Minor documentation updates. Code snippets were updated. Documentation enhancement.
I2C: Removed the unused members of the configuration structure. Reduced the memory footprint.
3.20 UART: Newly added API's for runtime parameter set/get functionality: Cy_SCB_UART_SetOverSample to set oversample bits of UART, Cy_SCB_UART_GetOverSample to add return value of oversample. To improve functionality.
UART: Fixed an issue with sending short transactions on high baud rates.
I2C: Fixed the defect in the Cy_SCB_I2C_MasterAbortWrite() function to prevent device stuck in the CY_SCB_I2C_MASTER_BUSY state on some devices.
3.10 I2C: Fixed the issue when an address byte is treated as a data byte with an enabled Accepting address in the FIFO option. For the PSoC P4000S, P4100S, P4100S Plus, and PSoC 4500S devices, added the parameter to cy_stc_scb_i2c_config_t to configure a delay after the Address Match event. To improve the Accepting address in FIFO, if enabled.
SPI: Fixed the parity error report for High-Level functions. As a result, the registered callback function reports the CY_SCB_SPI_TRANSFER_ERR_EVENT event and Cy_SCB_SPI_GetTransferStatus() returns CY_SCB_SPI_RX_ERR_PARITY when a parity error happens. Earlier, High-level functions didn't report about parity errors.
SPI: Added information that for the PSoC 4000S, PSoC 4100S, PSoC 4100 Plus, and PSoC 4500S series, the SPI in Motorola mode generates a spare CY_SCB_TX_INTR_UNDERFLOW interrupt at the end of the transmission (the TX FIFO buffer is empty and no additional data is requested by Master) in CY_SCB_SPI_CPHA0_CPOL0 and CY_SCB_SPI_CPHA1_CPOL0 SCLK modes. Documentation updates.
SPI: Now Cy_SCB_SPI_Transfer() clears RX FIFO buffer before start of the transfer. High-Level API operation improvement.
Minor documentation updates. Documentation enhancement.
3.0.1 UART: Added information that for PSoC 4000S, PSoC 4100S, PSoC 4100S Plus, and PSoC 4500S series, a stop bits error is detected only if the stop bits length equals or exceeds 1.5 bits. Documentation updates.
UART: Added information that for PSoC 4000S, PSoC 4100S, PSoC 4100S Plus, and PSoC 4500S series, the actual break width may be up to one bit less than the specified break width. Documentation updates.
Minor documentation updates. Documentation enhancement.
3.0 Added support of SCB blocks with FIFO buffers size other than 32 byte. New device support.
Added Cy_SCB_UART_GetBaudRateCount() to get number of peripheral clock periods that constitutes the transmission of the LIN's sync byte.
Added enableLinMode member to cy_stc_scb_uart_config_t.
enableLinMode has effect on CY_SCB_UART_TX_ARB_LOST and CY_SCB_UART_RX_BREAK_DETECT interrupts.
LIN mode support.

Added new features:

  • High-speed mode for I2C Slave
  • SPI Parity
  • Setup delay for SPI Master
  • Hold delay for SPI Master
  • Inter-dataframe delay for SPI Master
  • UART break level

Updated interface of the Cy_SCB_I2C_Enable() by adding additional parameter for the context.

New device support.

Added new functions:

Modified following function:

Low power feature support.
Fixed the Cy_SCB_SPI_SetActiveSlaveSelectPolarity() function to properly configure the polarity of the slave select line. Defect fix.
Minor documentation updates. Documentation enhancement.
Fixed MISRA violations. MISRA compliance.
1.0 Initial version.

API Reference

 Common API for the Serial Communication Block.
 Driver API for EZI2C Slave Peripheral.
 I2C (SCB)
 Driver API for I2C Bus Peripheral.
 Driver API for SPI Peripheral.
 Driver API for UART.