zephyr/include/drivers/console/uart_pipe.h
Kumar Gala cc334c7273 Convert remaining code to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.  This handles the remaining includes and kernel, plus
touching up various points that we skipped because of include
dependancies.  We also convert the PRI printf formatters in the arch
code over to normal formatters.

Jira: ZEP-2051

Change-Id: Iecbb12601a3ee4ea936fd7ddea37788a645b08b0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 11:38:23 -05:00

58 lines
1.4 KiB
C

/** @file
* @brief Pipe UART driver header file.
*
* A pipe UART driver that allows applications to handle all aspects of
* received protocol data.
*/
/*
* Copyright (c) 2015 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Received data callback.
*
* This function is called when new data is received on UART. The off parameter
* can be used to alter offset at which received data is stored. Typically,
* when the complete data is received and a new buffer is provided off should
* be set to 0.
*
* @param buf Buffer with received data.
* @param off Data offset on next received and accumulated data length.
*
* @return Buffer to be used on next receive.
*/
typedef u8_t *(*uart_pipe_recv_cb)(u8_t *buf, size_t *off);
/** @brief Register UART application.
*
* This function is used to register new UART application.
*
* @param buf Initial buffer for received data.
* @param len Size of buffer.
* @param cb Callback to be called on data reception.
*/
void uart_pipe_register(u8_t *buf, size_t len, uart_pipe_recv_cb cb);
/** @brief Send data over UART.
*
* This function is used to send data over UART.
*
* @param data Buffer with data to be send.
* @param len Size of data.
*
* @return 0 on success or negative error
*/
int uart_pipe_send(const u8_t *data, int len);
#ifdef __cplusplus
}
#endif