PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
General
PDL API Reference » SCB (Serial Communication Block) » UART (SCB) » Functions

## General Description

## Functions
cy_en_scb_uart_status_t | Cy_SCB_UART_Init (CySCB_Type *base, cy_stc_scb_uart_config_t const *config, cy_stc_scb_uart_context_t *context)
| Initializes the SCB for UART operation. More...
void | Cy_SCB_UART_DeInit (CySCB_Type *base)
| De-initializes the SCB block. More...
__STATIC_INLINE void | Cy_SCB_UART_Enable (CySCB_Type *base)
| Enables the SCB block for the UART operation. More...
void | Cy_SCB_UART_Disable (CySCB_Type *base, cy_stc_scb_uart_context_t *context)
| Disables the SCB block and clears context statuses. More...
__STATIC_INLINE void | Cy_SCB_UART_EnableCts (CySCB_Type *base)
| Enables the Clear to Send (CTS) input for the UART. More...
__STATIC_INLINE void | Cy_SCB_UART_DisableCts (CySCB_Type *base)
| Disables the Clear to Send (CTS) input for the UART. More...
__STATIC_INLINE void | Cy_SCB_UART_SetRtsFifoLevel (CySCB_Type *base, uint32_t level)
| Sets a level for the Ready To Send (RTS) signal activation. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetRtsFifoLevel (CySCB_Type const *base)
| Returns the level in the RX FIFO for the RTS signal activation. More...
__STATIC_INLINE void | Cy_SCB_UART_EnableSkipStart (CySCB_Type *base)
| Enables the skip start-bit functionality. More...
__STATIC_INLINE void | Cy_SCB_UART_DisableSkipStart (CySCB_Type *base)
| Disable the skip start-bit functionality. More...
__STATIC_INLINE void | Cy_SCB_UART_EnableSingleWireHalfDuplex (CySCB_Type *base)
| Enables Single Wire Half Duplex Communication. More...
__STATIC_INLINE void | Cy_SCB_UART_DisableSingleWireHalfDuplex (CySCB_Type *base)
| Disables Single Wire Half Duplex Communication. More...

## Function Documentation

## ◆ Cy_SCB_UART_Init()

cy_en_scb_uart_status_t Cy_SCB_UART_Init | ( | CySCB_Type * | base,
|  | cy_stc_scb_uart_config_t const * | config,
|  | cy_stc_scb_uart_context_t * | context
| ) |  |

Initializes the SCB for UART operation.

Parameters

  base | The pointer to the UART SCB instance.
  config | The pointer to configuration structure cy_stc_scb_uart_config_t.
  context | The pointer to the context structure cy_stc_scb_uart_context_t allocated by the user. The structure is used during the UART operation for internal configuration and data retention. The user must not modify anything in this structure. If only UART Low-Level API will be used pass NULL as pointer to context.

Returns
  cy_en_scb_uart_status_t

Note
  Ensure that the SCB block is disabled before calling this function.

## ◆ Cy_SCB_UART_DeInit()

void Cy_SCB_UART_DeInit | ( | CySCB_Type * | base | ) |

De-initializes the SCB block.

Returns the register values to default.

Parameters

  base | The pointer to the UART SCB instance.

Note
  Ensure that the SCB block is disabled before calling this function.

## ◆ Cy_SCB_UART_Enable()

__STATIC_INLINE void Cy_SCB_UART_Enable | ( | CySCB_Type * | base | ) |

Enables the SCB block for the UART operation.

Parameters

  base | The pointer to the UART SCB instance.

## ◆ Cy_SCB_UART_Disable()

void Cy_SCB_UART_Disable | ( | CySCB_Type * | base,
|  | cy_stc_scb_uart_context_t * | context
| ) |  |

Disables the SCB block and clears context statuses.

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 UART pins when SCB disabled.

Parameters

  base | The pointer to the UART SCB instance.
  context | The pointer to the context structure cy_stc_scb_uart_context_t allocated by the user. The structure is used during the UART operation for internal configuration and data retention. The user must not modify anything in this structure. If only UART functions that do not require context will be used to pass NULL as pointer to context.

Note
  Calling this function when the UART is busy (transmitter preforms data transfer or receiver is in the middle of data reception) may result transfer corruption because the hardware stops driving the outputs and ignores the inputs. Ensure that the UART is not busy before calling this function.

## ◆ Cy_SCB_UART_EnableCts()

__STATIC_INLINE void Cy_SCB_UART_EnableCts | ( | CySCB_Type * | base | ) |

Enables the Clear to Send (CTS) input for the UART.

The UART will not transmit data while this signal is inactive.

Parameters

  base | The pointer to the UART SCB instance.

## ◆ Cy_SCB_UART_DisableCts()

__STATIC_INLINE void Cy_SCB_UART_DisableCts | ( | CySCB_Type * | base | ) |

Disables the Clear to Send (CTS) input for the UART.

See Cy_SCB_UART_EnableCts for the details.

Parameters

  base | The pointer to the UART SCB instance.

## ◆ Cy_SCB_UART_SetRtsFifoLevel()

__STATIC_INLINE void Cy_SCB_UART_SetRtsFifoLevel | ( | CySCB_Type * | base,
|  | uint32_t | level
| ) |  |

Sets a level for the Ready To Send (RTS) signal activation.

When the number of data elements in the receive FIFO is below this level, then the RTS output is active. Otherwise, the RTS signal is inactive. To disable the RTS signal generation, set this level to zero.

Parameters

  base | The pointer to the UART SCB instance.
  level | The level in the RX FIFO for RTS signal activation.

## ◆ Cy_SCB_UART_GetRtsFifoLevel()

__STATIC_INLINE uint32_t Cy_SCB_UART_GetRtsFifoLevel | ( | CySCB_Type const * | base | ) |

Returns the level in the RX FIFO for the RTS signal activation.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The level in the RX FIFO for RTS signal activation.

## ◆ Cy_SCB_UART_EnableSkipStart()

__STATIC_INLINE void Cy_SCB_UART_EnableSkipStart | ( | CySCB_Type * | base | ) |

Enables the skip start-bit functionality.

When skip start is enabled the UART hardware does not synchronize to a start bit but synchronizes to the first rising edge. To create a rising edge, the first data bit must be a 1. This feature is useful when the start bit falling edge is used to wake the device through a GPIO interrupt.

Parameters

  base | The pointer to the UART SCB instance.

Note
  When skip start-bit feature is enabled, it is applied (UART synchronizes to the first rising edge after start bit) whenever the SCB is enabled. This can cause incorrect UART synchronization and data reception when the first data bit is not a 1. Therefore, disable the skip start-bit when it should not be applied. Note that SCB is disabled before enter Deep Sleep mode or after calling Cy_SCB_UART_Disable.

## ◆ Cy_SCB_UART_DisableSkipStart()

__STATIC_INLINE void Cy_SCB_UART_DisableSkipStart | ( | CySCB_Type * | base | ) |

Disable the skip start-bit functionality.

See Cy_SCB_UART_EnableSkipStart for the details.

Parameters

  base | The pointer to the UART SCB instance.

## ◆ Cy_SCB_UART_EnableSingleWireHalfDuplex()

__STATIC_INLINE void Cy_SCB_UART_EnableSingleWireHalfDuplex | ( | CySCB_Type * | base | ) |

Enables Single Wire Half Duplex Communication.

Note
  This is applicable in standard UART submode only.

Parameters

  base | The pointer to the UART SCB instance.

Note
  This API is available for PSoC C3 devices.

## ◆ Cy_SCB_UART_DisableSingleWireHalfDuplex()

__STATIC_INLINE void Cy_SCB_UART_DisableSingleWireHalfDuplex | ( | CySCB_Type * | base | ) |

Disables Single Wire Half Duplex Communication.

Note
  This is applicable in standard UART submode only.

Parameters

  base | The pointer to the UART SCB instance.

Note
  This API is available for PSoC C3 devices.