Functions
Functions
Peripheral Driver » APP DRIVER » UART
Collaboration diagram for Functions:

## Functions
uint16_t | app_uart_init (app_uart_params_t *p_params, app_uart_evt_handler_t evt_handler, app_uart_tx_buf_t *tx_buffer)
| Initialize the APP UART DRIVER according to the specified parameters in the app_uart_params_t and app_uart_evt_handler_t. More...
uint16_t | app_uart_deinit (app_uart_id_t id)
| De-initialize the APP UART DRIVER peripheral. More...
uint16_t | app_uart_transmit_async (app_uart_id_t id, uint8_t *p_data, uint16_t size)
| Send an amount of data in interrupt mode. More...
uint16_t | app_uart_transmit_sync (app_uart_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
| Send an amount of data in blocking mode. More...
uint16_t | app_uart_receive_async (app_uart_id_t id, uint8_t *p_data, uint16_t size)
| Receive an amount of data in interrupt mode. More...
uint16_t | app_uart_receive_sync (app_uart_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
| Receive an amount of data in blocking mode. More...
uart_handle_t * | app_uart_get_handle (app_uart_id_t id)
| Return the UART handle. More...
void | app_uart_flush (app_uart_id_t id)
| Flush all log entries from the buffer. More...
uint16_t | app_uart_abort (app_uart_id_t id)
| Abort transmit and receive process and generate abort callback. More...
uint16_t | app_uart_abort_transmit (app_uart_id_t id)
| Abort transmit process and generate abort transmit callback. More...
uint16_t | app_uart_abort_receive (app_uart_id_t id)
| Abort receive process and generate abort receive callback. More...

## Detailed Description

## Function Documentation

## ◆ app_uart_abort()

uint16_t app_uart_abort | ( | app_uart_id_t | id | ) |

Abort transmit and receive process and generate abort callback.

Parameters

  [in] | id | which UART module want to use.

Returns
  Result of operation.

## ◆ app_uart_abort_receive()

uint16_t app_uart_abort_receive | ( | app_uart_id_t | id | ) |

Abort receive process and generate abort receive callback.

Parameters

  [in] | id | which UART module want to use.

Returns
  Result of operation.

## ◆ app_uart_abort_transmit()

uint16_t app_uart_abort_transmit | ( | app_uart_id_t | id | ) |

Abort transmit process and generate abort transmit callback.

Parameters

  [in] | id | which UART module want to use.

Returns
  Result of operation.

## ◆ app_uart_deinit()

uint16_t app_uart_deinit | ( | app_uart_id_t | id | ) |

De-initialize the APP UART DRIVER peripheral.

Parameters

  [in] | id | De-initialize for a specific ID.

Returns
  Result of De-initialization.

## ◆ app_uart_flush()

void app_uart_flush | ( | app_uart_id_t | id | ) |

Flush all log entries from the buffer.

Parameters

  [in] | id | UART Channel ID.

## ◆ app_uart_get_handle()

uart_handle_t* app_uart_get_handle | ( | app_uart_id_t | id | ) |

Return the UART handle.

Parameters

  [in] | id | UART Channel ID.

Returns
  Pointer to the specified ID's UART handle.

## ◆ app_uart_init()

uint16_t app_uart_init | ( | app_uart_params_t * | p_params,
|  | app_uart_evt_handler_t | evt_handler,
|  | app_uart_tx_buf_t * | tx_buffer
| ) |  |

Initialize the APP UART DRIVER according to the specified parameters in the app_uart_params_t and app_uart_evt_handler_t.

Parameters

  [in] | p_params | Pointer to app_uart_params_t parameter which contains the configuration information for the specified UART module.
  [in] | evt_handler | UART user callback function.
  [in] | tx_buffer | Pointer to tx send buffer.

Returns
  Result of initialization.

## ◆ app_uart_receive_async()

uint16_t app_uart_receive_async | ( | app_uart_id_t | id,
|  | uint8_t * | p_data,
|  | uint16_t | size
| ) |  |

Receive an amount of data in interrupt mode.

Parameters

  [in] | id | which UART module want to transmit.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent

Returns
  Result of operation.

## ◆ app_uart_receive_sync()

uint16_t app_uart_receive_sync | ( | app_uart_id_t | id,
|  | uint8_t * | p_data,
|  | uint16_t | size,
|  | uint32_t | timeout
| ) |  |

Receive an amount of data in blocking mode.

Parameters

  [in] | id | which UART module want to transmit.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_uart_transmit_async()

uint16_t app_uart_transmit_async | ( | app_uart_id_t | id,
|  | uint8_t * | p_data,
|  | uint16_t | size
| ) |  |

Send an amount of data in interrupt mode.

Parameters

  [in] | id | which UART module want to receive.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent

Returns
  Result of operation.

## ◆ app_uart_transmit_sync()

uint16_t app_uart_transmit_sync | ( | app_uart_id_t | id,
|  | uint8_t * | p_data,
|  | uint16_t | size,
|  | uint32_t | timeout
| ) |  |

Send an amount of data in blocking mode.

Parameters

  [in] | id | which UART module want to receive.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent
  [in] | timeout | Timeout duration

Returns
  Result of operation.