EV-Embedded-Control-System/middlewares/libmodbus/uart_device.h

47 lines
1.7 KiB
C
Raw Normal View History

// SPDX-License-Identifier: GPL-3.0-only
/*
* Copyright (c) 2008-2023 100askTeam : Dongshan WEI <weidongshan@qq.com>
* Discourse: https://forums.100ask.net
*/
/* Copyright (C) 2008-2023 深圳百问网科技有限公司
* All rights reserved
*
* : , 使, (),
* : , ,
*
* GPL V3协议,
* : https://www.100ask.net
* : https://forums.100ask.net
* B站 : https://space.bilibili.com/275908810
* : DShanMCU-F103
* : https://100ask.taobao.com
* (E-mail): weidongshan@qq.com
*
*
*
*
*-----------------------------------------------------
* 2024.02.01 v01
*-----------------------------------------------------
*/
#ifndef __UART_DEVICE_H
#define __UART_DEVICE_H
#include <stdint.h>
typedef struct UART_Device {
char *name;
int (*Init)( struct UART_Device *pDev, int baud, char parity, int data_bit, int stop_bit);
int (*Send)( struct UART_Device *pDev, uint8_t *datas, uint32_t len, int timeout);
int (*RecvByte)( struct UART_Device *pDev, uint8_t *data, int timeout);
int (*Flush)(struct UART_Device *pDev);
void *priv_data;
}UART_Device, *PUART_Device;
UART_Device *GetUARTDevice(char *name);
#endif /* __UART_DEVICE_H */