2022-12-31 14:42:31 +00:00
|
|
|
|
/******************************************************************************
|
|
|
|
|
* @brief tty<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ӡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2015, <morro_luo@163.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*
|
|
|
|
|
* Change Logs:
|
|
|
|
|
* Date Author Notes
|
|
|
|
|
* 2015-07-03 Morro
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef _TTY_H_
|
|
|
|
|
#define _TTY_H_
|
|
|
|
|
|
|
|
|
|
#define TTY_RXBUF_SIZE 256
|
|
|
|
|
#define TTY_TXBUF_SIZE 1024
|
|
|
|
|
|
|
|
|
|
/*<2A>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> --------------------------------------------------------------------*/
|
|
|
|
|
typedef struct {
|
|
|
|
|
void (*init)(int baudrate);
|
|
|
|
|
unsigned int (*write)(const void *buf, unsigned int len);
|
|
|
|
|
unsigned int (*read)(void *buf, unsigned int len);
|
|
|
|
|
bool (*tx_isfull)(void); /*<2A><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
bool (*rx_isempty)(void); /*<2A><><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
}tty_t;
|
|
|
|
|
|
|
|
|
|
extern const tty_t tty;
|
|
|
|
|
|
|
|
|
|
#endif
|