common.h
资源名称:51-SD.rar [点击查看]
上传用户:jcsy2001
上传日期:2013-11-29
资源大小:201k
文件大小:1k
源码类别:
嵌入式/单片机编程
开发平台:
C/C++
- ///////////////////////////////////////////////////////
- #define NULL 0
- #define TRUE 1
- #define FALSE 0
- #define UARTBUF_LENGTH 16384//520//
- #define BUFFER_LENGTH 8192//520 //
- #define MAX_READ_LENGTH 16384//1024//
- #define MAX_WRITE_LENGTH 2048//1024//
- // Disable all interrupts
- #define DISABLE_INTERRUPTS EA = 0
- // Enable all interrupts
- #define ENABLE_INTERRUPTS EA = 1
- typedef unsigned char INT8;
- typedef unsigned short INT16;
- typedef unsigned long INT32;
- typedef union __FLAGS
- {
- struct _FLAGS
- {
- unsigned char SLAVE_IS_ATTACHED ;
- unsigned char SLAVE_REMOVED ;
- unsigned char SLAVE_FOUND ; // Slave USB device found
- unsigned char SLAVE_ENUMERATED ; // slave USB device enumeration done
- unsigned char SLAVE_ONLINE ;
- unsigned char TIMEOUT_ERR ; // timeout error during data endpoint transfer
- unsigned char DATA_STOP ; // device unplugged during data transfer
- unsigned char bData1 ;
- unsigned char bUartInDone ;
- unsigned char bMassDevice ;
- } bits;
- } FLAGS;