USB_ISR_H.#1
上传用户:gxz1972
上传日期:2019-09-13
资源大小:323k
文件大小:3k
- //-----------------------------------------------------------------------------
- // USB_ISR_H.h
- //-----------------------------------------------------------------------------
- // Copyright 2007 Vson Technology, Inc.
- // http://www.usbmcu.com
- //
- // Program Description:
- //
- //
- //
- //
- //
- // MCU: C8051F347
- // Tool chain: Keil C51 7.50 / Keil EVAL C51
- // Silicon Laboratories IDE version 2.6
- // Command Line:
- // Project Name: TR1000
- //
- //
- // Release 1.0
- // -All changes by Brian Cai
- // -24 JUL 2007
- //
- //
- #include "USB_Structs_H.h"
- #ifndef _USB_ISR_H_
- #define _USB_ISR_H_
- //sbit sbitLed = P0^5; // These blink to indicate data transmission
- //-----------------------------------------------------------------------------
- // Global Constants
- //-----------------------------------------------------------------------------
- // Constants Definitions
- #define NUM_STG_PAGES 20 // Total number of flash pages to
- // be used for file storage
- #define MAX_BLOCK_SIZE 64 // Use the maximum block size of 64
- #define FLASH_PAGE_SIZE 512 // Size of each flash page
- #define BLOCKS_PR_PAGE FLASH_PAGE_SIZE/MAX_BLOCK_SIZE
- #define MAX_NUM_BLOCKS BLOCKS_PR_PAGE*NUM_STG_PAGES
- // Message Types
- #define READ_MSG 0x00 // Message types for communication with host
- #define WRITE_MSG 0x01
- #define SIZE_MSG 0x02
- // Machine States
- #define WAIT_OPEN_DEVICE_STATUS 0x01 // Wait for application to open a device instance
- #define DEVICE_IDLE_STATUS 0x02 // Device is open, wait for Setup Message from host
- #define RX_CONFIG_DATA_FROM_HOST_STATUS 0x03
- #define TX_CONFIG_RESPONSE_TO_HOST_STATUS 0x04 // Received Setup Message, decode and wait for data
- #define TX_STUDENT_KEY_DATA_TO_HOST_STATUS 0x07
- #define TX_STUDENT_EXAM_DATA_TO_HOST_STATUS 0x08
- #define TX_TEACHER_KEY_DATA_TO_HOST_STATUS 0x09 // Receive file data from host
- #define TX_TOUCHPAD_DATA_TO_HOST_STATUS 0x10 // Transmit file data to host
- #define EP0_HANDLER_STATUS 0x20 // Transmit ACK 0xFF to host after every 8 packets
- #define USB_RESET_STATUS 0x40
- #define ERROR_STATUS 0x80 // Error state
- //-----------------------------------------------------------------------------
- // Function Prototypes
- //-----------------------------------------------------------------------------
- void USBReset ();
- void Endpoint0 ();
- void BulkOrInterruptOut(PEP_STATUS);
- void BulkOrInterruptIn (PEP_STATUS, BYTE *,UINT );
- #endif // F34x_USB_DESCRIPTORS_H
- //-----------------------------------------------------------------------------
- // End Of File
- //-----------------------------------------------------------------------------