JZ_uart.h 1.5 KB
/**
 ************************************************************************************************
 * @file    dji_sdk_app_info.h
 * @brief   This is the header file for defining the structure and (exported) function prototypes.
 *************************************************************************************************
 */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _JZ_UART_H
#define _JZ_UART_H
/* Includes ------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <error.h>
#include <termios.h>
#include <malloc.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <pthread.h>
#include <stdint.h>

/* Exported constants --------------------------------------------------------*/

/* Exported types ------------------------------------------------------------*/
typedef struct termios termios_t;
typedef struct JzSerData
{
    uint8_t dataBuf[256]; // 发送/接受数据
    int dataLen;          // 发送/接受数据长度
    int serFd;         // 串口文件描述符
} JzSerData;
/* Exported functions --------------------------------------------------------*/
int JzUartInit(const char *path,int bitRate);//串口初始化
int JzUartSet(const char *path,int bitRate);//串口设置
int uart_send(uint8_t *dataBuf,int dataLen);
static void *Recv_Task(void *arg);

#ifdef __cplusplus
}
#endif

#endif //_UART_H