PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Low-Level
PDL API Reference » SCB (Serial Communication Block) » UART (SCB) » Functions

## General Description

## Functions
__STATIC_INLINE uint32_t | Cy_SCB_UART_Put (CySCB_Type *base, uint32_t data)
| Places a single data element in the UART TX FIFO. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_PutArray (CySCB_Type *base, void *buffer, uint32_t size)
| Places an array of data in the UART TX FIFO. More...
__STATIC_INLINE void | Cy_SCB_UART_PutArrayBlocking (CySCB_Type *base, void *buffer, uint32_t size)
| Places an array of data in the UART TX FIFO. More...
__STATIC_INLINE void | Cy_SCB_UART_PutString (CySCB_Type *base, char_t const string[])
| Places a NULL terminated string in the UART TX FIFO. More...
void | Cy_SCB_UART_SendBreakBlocking (CySCB_Type *base, uint32_t breakWidth)
| Sends a break condition (logic low) of specified width on UART TX line. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_Get (CySCB_Type const *base)
| Reads a single data element from the UART RX FIFO. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetArray (CySCB_Type const *base, void *buffer, uint32_t size)
| Reads an array of data out of the UART RX FIFO. More...
__STATIC_INLINE void | Cy_SCB_UART_GetArrayBlocking (CySCB_Type const *base, void *buffer, uint32_t size)
| Reads an array of data out of the UART RX FIFO. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetTxFifoStatus (CySCB_Type const *base)
| Returns the current status of the TX FIFO. More...
__STATIC_INLINE void | Cy_SCB_UART_ClearTxFifoStatus (CySCB_Type *base, uint32_t clearMask)
| Clears the selected statuses of the TX FIFO. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetRxFifoStatus (CySCB_Type const *base)
| Returns the current status of the RX FIFO. More...
__STATIC_INLINE void | Cy_SCB_UART_ClearRxFifoStatus (CySCB_Type *base, uint32_t clearMask)
| Clears the selected statuses of the RX FIFO. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetNumInTxFifo (CySCB_Type const *base)
| Returns the number of data elements in the UART TX FIFO. More...
__STATIC_INLINE bool | Cy_SCB_UART_IsTxComplete (CySCB_Type const *base)
| Checks whether the TX FIFO and Shifter are empty and there is no more data to send. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetNumInRxFifo (CySCB_Type const *base)
| Returns the number of data elements in the UART RX FIFO. More...
__STATIC_INLINE void | Cy_SCB_UART_ClearRxFifo (CySCB_Type *base)
| Clears all data out of the UART RX FIFO. More...
__STATIC_INLINE void | Cy_SCB_UART_ClearTxFifo (CySCB_Type *base)
| Clears all data out of the UART TX FIFO. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetOverSample (CySCB_Type const *base)
| Returns the value of oversample. More...
cy_en_scb_uart_status_t | Cy_SCB_UART_SetOverSample (CySCB_Type *base, uint32_t overSample, cy_stc_scb_uart_context_t *context)
| Sets oversample bits of UART. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetDataWidth (CySCB_Type const *base)
| Returns the value of datawidth. More...
void | Cy_SCB_UART_SetDataWidth (CySCB_Type *base, uint32_t dataWidth)
| Sets datawidth for UART transaction. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetParity (CySCB_Type const *base)
| Returns the value of parity. More...
void | Cy_SCB_UART_SetParity (CySCB_Type *base, cy_en_scb_uart_parity_t parity)
| Sets parity for UART transaction. More...
__STATIC_INLINE uint32_t | Cy_SCB_UART_GetStopBits (CySCB_Type const *base)
| Returns the value of stop bits. More...
void | Cy_SCB_UART_SetStopBits (CySCB_Type *base, cy_en_scb_uart_stop_bits_t stopBits)
| Sets stop bits for UART transaction. More...
__STATIC_INLINE bool | Cy_SCB_UART_GetDropOnParityError (CySCB_Type const *base)
| Returns the value of SetDropOnParityError. More...
void | Cy_SCB_UART_SetDropOnParityError (CySCB_Type *base, bool dropOnParityError)
| Sets SetDropOnParityError for UART transaction. More...
__STATIC_INLINE bool | Cy_SCB_UART_GetEnableMsbFirst (CySCB_Type const *base)
| Returns the value of enableMsbFirst. More...
void | Cy_SCB_UART_SetEnableMsbFirst (CySCB_Type *base, bool enableMsbFirst)
| Sets enableMsbFirst for UART transaction. More...

## Function Documentation

## ◆ Cy_SCB_UART_Put()

__STATIC_INLINE uint32_t Cy_SCB_UART_Put | ( | CySCB_Type * | base,
|  | uint32_t | data
| ) |  |

Places a single data element in the UART TX FIFO.

This function does not block and returns how many data elements were placed in the TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  data | Data to put in the TX FIFO. The element size is defined by the data type, which depends on the configured data width.

Returns
  The number of data elements placed in the TX FIFO: 0 or 1.

## ◆ Cy_SCB_UART_PutArray()

__STATIC_INLINE uint32_t Cy_SCB_UART_PutArray | ( | CySCB_Type * | base,
|  | void * | buffer,
|  | uint32_t | size
| ) |  |

Places an array of data in the UART TX FIFO.

This function does not block. It returns how many data elements were placed in the TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  buffer | The pointer to data to place in the TX FIFO. The element size is defined by the data type, which depends on the configured TX data width.
  size | The number of data elements to TX.

Returns
  The number of data elements placed in the TX FIFO.

## ◆ Cy_SCB_UART_PutArrayBlocking()

__STATIC_INLINE void Cy_SCB_UART_PutArrayBlocking | ( | CySCB_Type * | base,
|  | void * | buffer,
|  | uint32_t | size
| ) |  |

Places an array of data in the UART TX FIFO.

This function blocks until the number of data elements specified by the size is placed in the TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  buffer | The pointer to data to place in the TX FIFO. The element size is defined by the data type, which depends on the configured data width.
  size | The number of data elements to write into the TX FIFO.

## ◆ Cy_SCB_UART_PutString()

__STATIC_INLINE void Cy_SCB_UART_PutString | ( | CySCB_Type * | base,
|  | char_t const | string[]
| ) |  |

Places a NULL terminated string in the UART TX FIFO.

This function blocks until the entire string is placed in the TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  string | The pointer to the null terminated string array.

## ◆ Cy_SCB_UART_SendBreakBlocking()

void Cy_SCB_UART_SendBreakBlocking | ( | CySCB_Type * | base,
|  | uint32_t | breakWidth
| ) |  |

Sends a break condition (logic low) of specified width on UART TX line.

Blocks until break is completed. Only call this function when UART TX FIFO and shifter are empty.

Parameters

  base | The pointer to the UART SCB instance.
  breakWidth | Width of break condition. Valid range is the TX data width (4 to 16 bits)

Note
  Before sending break all UART TX interrupt sources are disabled. The state of UART TX interrupt sources is restored before function returns.

Side Effects
  If this function is called while there is data in the TX FIFO or shifter that data will be shifted out in packets the size of breakWidth.

## ◆ Cy_SCB_UART_Get()

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

Reads a single data element from the UART RX FIFO.

This function does not check whether the RX FIFO has data before reading it. If the RX FIFO is empty, the function returns CY_SCB_UART_RX_NO_DATA.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  Data from the RX FIFO. The data element size is defined by the configured data width.

## ◆ Cy_SCB_UART_GetArray()

__STATIC_INLINE uint32_t Cy_SCB_UART_GetArray | ( | CySCB_Type const * | base,
|  | void * | buffer,
|  | uint32_t | size
| ) |  |

Reads an array of data out of the UART RX FIFO.

This function does not block. It returns how many data elements were read from the RX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  buffer | The pointer to the location to place the data read from the RX FIFO. The element size is defined by the data type, which depends on the configured data width.
  size | The number of data elements to read from the RX FIFO.

Returns
  The number of data elements read from the RX FIFO.

## ◆ Cy_SCB_UART_GetArrayBlocking()

__STATIC_INLINE void Cy_SCB_UART_GetArrayBlocking | ( | CySCB_Type const * | base,
|  | void * | buffer,
|  | uint32_t | size
| ) |  |

Reads an array of data out of the UART RX FIFO.

This function blocks until the number of data elements specified by the size has been read from the RX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  buffer | The pointer to the location to place the data read from the RX FIFO. The element size is defined by the data type, which depends on the configured data width.
  size | The number of data elements to read from the RX FIFO.

## ◆ Cy_SCB_UART_GetTxFifoStatus()

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

Returns the current status of the TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  UART TX FIFO Statuses

## ◆ Cy_SCB_UART_ClearTxFifoStatus()

__STATIC_INLINE void Cy_SCB_UART_ClearTxFifoStatus | ( | CySCB_Type * | base,
|  | uint32_t | clearMask
| ) |  |

Clears the selected statuses of the TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  clearMask | The mask whose statuses to clear. See UART TX FIFO Statuses for the set of constants.

Note
  - The status is also used for interrupt generation, so clearing it also clears the interrupt sources.
  - Level-sensitive statuses such as CY_SCB_UART_TX_TRIGGER, CY_SCB_UART_TX_EMPTY and CY_SCB_UART_TX_NOT_FULL are set high again after being cleared if the condition remains true.

## ◆ Cy_SCB_UART_GetRxFifoStatus()

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

Returns the current status of the RX FIFO.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  UART RX FIFO status.

## ◆ Cy_SCB_UART_ClearRxFifoStatus()

__STATIC_INLINE void Cy_SCB_UART_ClearRxFifoStatus | ( | CySCB_Type * | base,
|  | uint32_t | clearMask
| ) |  |

Clears the selected statuses of the RX FIFO.

Parameters

  base | The pointer to the UART SCB instance.
  clearMask | The mask whose statuses to clear. See UART RX FIFO status. for the set of constants.

Note
  - This status is also used for interrupt generation, so clearing it also clears the interrupt sources.
  - Level-sensitive statuses such as CY_SCB_UART_RX_TRIGGER, CY_SCB_UART_RX_NOT_EMPTY and CY_SCB_UART_RX_FULL are set high again after being cleared if the condition remains true.

## ◆ Cy_SCB_UART_GetNumInTxFifo()

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

Returns the number of data elements in the UART TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The number of data elements in the TX FIFO. The size of date element defined by the configured data width.

Note
  This number does not include any data currently in the TX shifter.

## ◆ Cy_SCB_UART_IsTxComplete()

__STATIC_INLINE bool Cy_SCB_UART_IsTxComplete | ( | CySCB_Type const * | base | ) |

Checks whether the TX FIFO and Shifter are empty and there is no more data to send.

Parameters

  base | Pointer to the UART SCB instance.

Returns
  If true, transmission complete. If false, transmission is not complete.

## ◆ Cy_SCB_UART_GetNumInRxFifo()

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

Returns the number of data elements in the UART RX FIFO.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The number of data elements in the RX FIFO. The size of date element defined by the configured data width.

## ◆ Cy_SCB_UART_ClearRxFifo()

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

Clears all data out of the UART RX FIFO.

Parameters

  base | The pointer to the UART SCB instance.

Side Effects
  Any data currently in the shifter is cleared and lost.

## ◆ Cy_SCB_UART_ClearTxFifo()

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

Clears all data out of the UART TX FIFO.

Parameters

  base | The pointer to the UART SCB instance.

Side Effects
  The TX FIFO clear operation also clears the shift register, so that the shifter could be cleared in the middle of a data element transfer, corrupting it. The data element corruption means that all bits that have not been transmitted are transmitted as 1s on the bus.

## ◆ Cy_SCB_UART_GetOverSample()

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

Returns the value of oversample.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The value of oversample.

/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Get current oversample value for provided SCB */
(void) Cy_SCB_UART_GetOverSample(SCB5);
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.
Definition: cy_scb_uart.c:267
Cy_SCB_UART_GetOverSample
__STATIC_INLINE uint32_t Cy_SCB_UART_GetOverSample(CySCB_Type const *base)
Returns the value of oversample.
Definition: cy_scb_uart.h:1201

## ◆ Cy_SCB_UART_SetOverSample()

cy_en_scb_uart_status_t Cy_SCB_UART_SetOverSample | ( | CySCB_Type * | base,
|  | uint32_t | overSample,
|  | cy_stc_scb_uart_context_t * | context
| ) |  |

Sets oversample bits of UART.

Parameters

  base | The pointer to the UART SCB instance.
  overSample | Value of oversample to be set.
  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. User should not 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.

/* Assign appropriate oversample value for UART */
uint32_t OverSample = 8UL;
/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Set oversample value for UART */
(void) Cy_SCB_UART_SetOverSample(SCB5, OverSample, &UART_1_context);
/* Enable UART to operate */
Cy_SCB_UART_Enable(SCB5);
Cy_SCB_UART_Enable
__STATIC_INLINE void Cy_SCB_UART_Enable(CySCB_Type *base)
Enables the SCB block for the UART operation.
Definition: cy_scb_uart.h:1008
Cy_SCB_UART_SetOverSample
cy_en_scb_uart_status_t Cy_SCB_UART_SetOverSample(CySCB_Type *base, uint32_t overSample, cy_stc_scb_uart_context_t *context)
Sets oversample bits of UART.
Definition: cy_scb_uart.c:70

## ◆ Cy_SCB_UART_GetDataWidth()

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

Returns the value of datawidth.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The value of datawidth.

Note
  Values of Tx and Rx datawidth are same.

/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Get current datawidth value for provided SCB */
(void) Cy_SCB_UART_GetDataWidth(SCB5);
Cy_SCB_UART_GetDataWidth
__STATIC_INLINE uint32_t Cy_SCB_UART_GetDataWidth(CySCB_Type const *base)
Returns the value of datawidth.
Definition: cy_scb_uart.h:1225

## ◆ Cy_SCB_UART_SetDataWidth()

void Cy_SCB_UART_SetDataWidth | ( | CySCB_Type * | base,
|  | uint32_t | dataWidth
| ) |  |

Sets datawidth for UART transaction.

Parameters

  base | The pointer to the UART SCB instance.
  dataWidth | The width of UART data in the UART transaction.

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

/* Assign appropriate datawidth value for UART */
uint32_t dataWidth = 8UL;
/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Set datawidth value for UART */
(void) Cy_SCB_UART_SetDataWidth(SCB5, dataWidth);
/* Enable UART to operate */
Cy_SCB_UART_Enable(SCB5);
Cy_SCB_UART_SetDataWidth
void Cy_SCB_UART_SetDataWidth(CySCB_Type *base, uint32_t dataWidth)
Sets datawidth for UART transaction.
Definition: cy_scb_uart.c:117

## ◆ Cy_SCB_UART_GetParity()

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

Returns the value of parity.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The value of parity.

Note
  Values of Tx and Rx parity are same.

/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Get current parity value for provided SCB */
(void) Cy_SCB_UART_GetParity(SCB5);
Cy_SCB_UART_GetParity
__STATIC_INLINE uint32_t Cy_SCB_UART_GetParity(CySCB_Type const *base)
Returns the value of parity.
Definition: cy_scb_uart.h:1249

## ◆ Cy_SCB_UART_SetParity()

void Cy_SCB_UART_SetParity | ( | CySCB_Type * | base,
|  | cy_en_scb_uart_parity_t | parity
| ) |  |

Sets parity for UART transaction.

Parameters

  base | The pointer to the UART SCB instance.
  parity | The UART parity bit in the UART transaction.

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

/* Assign appropriate parity value for UART */
cy_en_scb_uart_parity_t parity = CY_SCB_UART_PARITY_NONE;
/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Set parity value for UART */
(void) Cy_SCB_UART_SetParity(SCB5, parity);
/* Enable UART to operate */
Cy_SCB_UART_Enable(SCB5);
cy_en_scb_uart_parity_t
cy_en_scb_uart_parity_t
UART Parity.
Definition: cy_scb_uart.h:357
CY_SCB_UART_PARITY_NONE
@ CY_SCB_UART_PARITY_NONE
UART has no parity check
Definition: cy_scb_uart.h:358
Cy_SCB_UART_SetParity
void Cy_SCB_UART_SetParity(CySCB_Type *base, cy_en_scb_uart_parity_t parity)
Sets parity for UART transaction.
Definition: cy_scb_uart.c:147

## ◆ Cy_SCB_UART_GetStopBits()

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

Returns the value of stop bits.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The value of stop bits.

Note
  Values of Tx and Rx stop bits are same.

/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Get current stop bits value for provided SCB */
(void) Cy_SCB_UART_GetStopBits(SCB5);
Cy_SCB_UART_GetStopBits
__STATIC_INLINE uint32_t Cy_SCB_UART_GetStopBits(CySCB_Type const *base)
Returns the value of stop bits.
Definition: cy_scb_uart.h:1273

## ◆ Cy_SCB_UART_SetStopBits()

void Cy_SCB_UART_SetStopBits | ( | CySCB_Type * | base,
|  | cy_en_scb_uart_stop_bits_t | stopBits
| ) |  |

Sets stop bits for UART transaction.

Parameters

  base | The pointer to the UART SCB instance.
  stopBits | The number of stop bits in the UART transaction.

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

/* Assign appropriate stop bits value for UART */
cy_en_scb_uart_stop_bits_t stopBits = CY_SCB_UART_STOP_BITS_1;
/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Set stop bits value for UART */
(void) Cy_SCB_UART_SetStopBits(SCB5, stopBits);
/* Enable UART to operate */
Cy_SCB_UART_Enable(SCB5);
cy_en_scb_uart_stop_bits_t
cy_en_scb_uart_stop_bits_t
UART Stop Bits.
Definition: cy_scb_uart.h:345
CY_SCB_UART_STOP_BITS_1
@ CY_SCB_UART_STOP_BITS_1
UART looks for 1 Stop Bit
Definition: cy_scb_uart.h:346
Cy_SCB_UART_SetStopBits
void Cy_SCB_UART_SetStopBits(CySCB_Type *base, cy_en_scb_uart_stop_bits_t stopBits)
Sets stop bits for UART transaction.
Definition: cy_scb_uart.c:176

## ◆ Cy_SCB_UART_GetDropOnParityError()

__STATIC_INLINE bool Cy_SCB_UART_GetDropOnParityError | ( | CySCB_Type const * | base | ) |

Returns the value of SetDropOnParityError.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The value of SetDropOnParityError.

/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Get current SetDropOnParityError value for provided SCB */
(void) Cy_SCB_UART_GetDropOnParityError(SCB5);
Cy_SCB_UART_GetDropOnParityError
__STATIC_INLINE bool Cy_SCB_UART_GetDropOnParityError(CySCB_Type const *base)
Returns the value of SetDropOnParityError.
Definition: cy_scb_uart.h:1294

## ◆ Cy_SCB_UART_SetDropOnParityError()

void Cy_SCB_UART_SetDropOnParityError | ( | CySCB_Type * | base,
|  | bool | dropOnParityError
| ) |  |

Sets SetDropOnParityError for UART transaction.

Parameters

  base | The pointer to the UART SCB instance.
  dropOnParityError | To enable the hardware to drop data in the RX FIFO when a parity error is detected in the UART transaction.

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

/* Assign appropriate SetDropOnParityError value for UART */
bool setDropOnParityError = false;
/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Set SetDropOnParityError value for UART */
(void) Cy_SCB_UART_SetDropOnParityError(SCB5, setDropOnParityError);
/* Enable UART to operate */
Cy_SCB_UART_Enable(SCB5);
Cy_SCB_UART_SetDropOnParityError
void Cy_SCB_UART_SetDropOnParityError(CySCB_Type *base, bool dropOnParityError)
Sets SetDropOnParityError for UART transaction.
Definition: cy_scb_uart.c:206

## ◆ Cy_SCB_UART_GetEnableMsbFirst()

__STATIC_INLINE bool Cy_SCB_UART_GetEnableMsbFirst | ( | CySCB_Type const * | base | ) |

Returns the value of enableMsbFirst.

Parameters

  base | The pointer to the UART SCB instance.

Returns
  The value of enableMsbFirst.

Note
  Values of Tx and Rx enableMsbFirst are same.

/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Get current enableMsbFirst value for provided SCB */
(void) Cy_SCB_UART_GetEnableMsbFirst(SCB5);
Cy_SCB_UART_GetEnableMsbFirst
__STATIC_INLINE bool Cy_SCB_UART_GetEnableMsbFirst(CySCB_Type const *base)
Returns the value of enableMsbFirst.
Definition: cy_scb_uart.h:1318

## ◆ Cy_SCB_UART_SetEnableMsbFirst()

void Cy_SCB_UART_SetEnableMsbFirst | ( | CySCB_Type * | base,
|  | bool | enableMsbFirst
| ) |  |

Sets enableMsbFirst for UART transaction.

Parameters

  base | The pointer to the UART SCB instance.
  enableMsbFirst | Enables the hardware to shift out data element MSB first; otherwise, LSB first in the UART transaction.

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

/* Assign appropriate enableMsbFirst value for UART */
bool enableMsbFirst = false;
/* Initialize SCB for UART operation */
(void) Cy_SCB_UART_Init(SCB5, &UART_1_config, &UART_1_context);
/* Set enableMsbFirst value for UART */
(void) Cy_SCB_UART_SetEnableMsbFirst(SCB5, enableMsbFirst);
/* Enable UART to operate */
Cy_SCB_UART_Enable(SCB5);
Cy_SCB_UART_SetEnableMsbFirst
void Cy_SCB_UART_SetEnableMsbFirst(CySCB_Type *base, bool enableMsbFirst)
Sets enableMsbFirst for UART transaction.
Definition: cy_scb_uart.c:231