#ifndef _PIPE_H
#define _PIPE_H
#include "ch32x035_usbpd.h"

#define BUF_MAX 256
#define OFFSET_MASK  0x00FF
typedef struct _Pipe_t {
   UINT16 header;
   UINT16 tail;
   UINT8 buf[BUF_MAX];
}  Pipe_t;
#if DEBUG == Debug_USB
extern Pipe_t debug_pipe;
#endif
extern Pipe_t sys_pipe;

extern Pipe_t uart_cmd_pipe;

extern Pipe_t coor_pipe;

void pipe_init(Pipe_t *pipe);

UINT8 pipe_read(Pipe_t *pipe, UINT8 * value, UINT8 len);

void pipe_write_c(Pipe_t *pipe, UINT8 value);

//void pipe_write_t(Pipe_t *pipe, UINT8* value, UINT8 len, COMMAND_TYPE cmd);

void pipe_write(Pipe_t *pipe, UINT8* value, UINT8 len);
#endif

