USB_ISR_H.#3
上传用户:gxz1972
上传日期:2019-09-13
资源大小:323k
文件大小:3k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. //-----------------------------------------------------------------------------
  2. // USB_ISR_H.h
  3. //-----------------------------------------------------------------------------
  4. // Copyright 2007 Vson Technology, Inc.
  5. // http://www.usbmcu.com
  6. //
  7. // Program Description:
  8. //
  9. //
  10. //
  11. //
  12. //
  13. // MCU:            C8051F347
  14. // Tool chain:     Keil C51 7.50 / Keil EVAL C51
  15. //                 Silicon Laboratories IDE version 2.6
  16. // Command Line:   
  17. // Project Name:   TR1000
  18. //
  19. //
  20. // Release 1.0
  21. //    -All changes by Brian Cai
  22. //    -24 JUL 2007
  23. //
  24. //
  25. #include "USB_Structs_H.h"
  26. #ifndef  _USB_ISR_H_
  27. #define  _USB_ISR_H_
  28. //sbit sbitLed = P0^5; // These blink to indicate data transmission
  29. //-----------------------------------------------------------------------------
  30. // Global Constants
  31. //-----------------------------------------------------------------------------
  32. //  Constants Definitions
  33. #define NUM_STG_PAGES   20             // Total number of flash pages to
  34.                                        // be used for file storage
  35. #define MAX_BLOCK_SIZE  64             // Use the maximum block size of 64
  36. #define FLASH_PAGE_SIZE 512            // Size of each flash page
  37. #define BLOCKS_PR_PAGE  FLASH_PAGE_SIZE/MAX_BLOCK_SIZE
  38. #define MAX_NUM_BLOCKS  BLOCKS_PR_PAGE*NUM_STG_PAGES
  39. //  Message Types
  40. #define READ_MSG    0x00    // Message types for communication with host
  41. #define WRITE_MSG   0x01
  42. #define SIZE_MSG    0x02
  43. //  Machine States
  44. #define WAIT_OPEN_DEVICE_STATUS 0x01                      // Wait for application to open a device instance
  45. #define DEVICE_IDLE_STATUS 0x02                      // Device is open, wait for Setup Message from host
  46. #define RX_CONFIG_DATA_FROM_HOST_STATUS 0x03
  47. #define TX_CONFIG_RESPONSE_TO_HOST_STATUS 0x04    // Received Setup Message, decode and wait for data
  48. #define TX_STUDENT_KEY_DATA_TO_HOST_STATUS       0x07
  49. #define TX_STUDENT_EXAM_DATA_TO_HOST_STATUS       0x07
  50. #define TX_TEACHER_KEY_DATA_TO_HOST_STATUS       0x08    // Receive file data from host
  51. #define TX_TOUCHPAD_DATA_TO_HOST_STATUS   0x10    // Transmit file data to host
  52. #define EP0_HANDLER_STATUS   0x20    // Transmit ACK 0xFF to host after every 8 packets
  53. #define USB_RESET_STATUS   0x40
  54. #define ERROR_STATUS    0x80    // Error state
  55. //-----------------------------------------------------------------------------
  56. // Function Prototypes
  57. //-----------------------------------------------------------------------------
  58. void USBReset ();
  59. void Endpoint0 ();
  60. void BulkOrInterruptOut(PEP_STATUS);
  61. void BulkOrInterruptIn (PEP_STATUS, BYTE *,UINT );
  62. #endif   // F34x_USB_DESCRIPTORS_H 
  63. //-----------------------------------------------------------------------------
  64. // End Of File
  65. //-----------------------------------------------------------------------------