usb_cdc.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /***********************************************************************************
  2. Filename: usb_cdc.h
  3. Description: USB CDC definitions.
  4. ***********************************************************************************/
  5. #ifndef USB_CDC_H
  6. #define USB_CDC_H
  7. /* Device Class Code */
  8. #define CDC_DEVICE 0x02
  9. /* Communication Interface Class Code */
  10. #define COMM_INTF 0x02
  11. /* Communication Interface Class SubClass Codes */
  12. #define ABSTRACT_CONTROL_MODEL 0x02
  13. /* Communication Interface Class Control Protocol Codes */
  14. #define V25TER 0x01 // Common AT commands ("Hayes(TM)")
  15. /* Data Interface Class Codes */
  16. #define DATA_INTF 0x0A
  17. /* Data Interface Class Protocol Codes */
  18. #define NO_PROTOCOL 0x00 // No class specific protocol required
  19. /* Communication Feature Selector Codes */
  20. #define ABSTRACT_STATE 0x01
  21. #define COUNTRY_SETTING 0x02
  22. /* Functional Descriptors */
  23. /* Type Values for the bDescType Field */
  24. #define CS_INTERFACE 0x24
  25. #define CS_ENDPOINT 0x25
  26. /* bDescSubType in Functional Descriptors */
  27. #define DSC_FN_HEADER 0x00
  28. #define DSC_FN_CALL_MGT 0x01
  29. #define DSC_FN_ACM 0x02 // ACM - Abstract Control Management
  30. #define DSC_FN_DLM 0x03 // DLM - Direct Line Managment
  31. #define DSC_FN_TELEPHONE_RINGER 0x04
  32. #define DSC_FN_RPT_CAPABILITIES 0x05
  33. #define DSC_FN_UNION 0x06
  34. #define DSC_FN_COUNTRY_SELECTION 0x07
  35. #define DSC_FN_TEL_OP_MODES 0x08
  36. #define DSC_FN_USB_TERMINAL 0x09
  37. /* more.... see Table 25 in USB CDC Specification 1.1 */
  38. #define CDC_COMM_INTF_ID 0x00
  39. #define CDC_DATA_INTF_ID 0x01
  40. // CLASS REQUESTS
  41. #define CDC_SEND_ENCAPSULATED_COMMAND 0x00
  42. #define CDC_GET_ENCAPSULATED_RESPONSE 0x01
  43. #define CDC_SET_COMM_FEATURE 0x02 //optional
  44. #define CDC_GET_COMM_FEATURE 0x03 //optional
  45. #define CDC_CLEAR_COMM_FEATURE 0x04 //optional
  46. #define CDC_SET_LINE_CODING 0x20 //optional
  47. #define CDC_GET_LINE_CODING 0x21 //optional
  48. #define CDC_SET_CONTROL_LINE_STATE 0x22 //optional
  49. #define CDC_SEND_BREAK 0x23 //optional
  50. #define CDC_CHAR_FORMAT_1_STOP_BIT 0
  51. #define CDC_CHAR_FORMAT_1_5_STOP_BIT 1
  52. #define CDC_CHAR_FORMAT_2_STOP_BIT 2
  53. #define CDC_PARITY_TYPE_NONE 0
  54. #define CDC_PARITY_TYPE_ODD 1
  55. #define CDC_PARITY_TYPE_EVEN 2
  56. #define CDC_PARITY_TYPE_MARK 3
  57. #define CDC_PARITY_TYPE_SPACE 4
  58. /*
  59. +------------------------------------------------------------------------------
  60. | Copyright 2004-2009 Texas Instruments Incorporated. All rights reserved.
  61. |
  62. | IMPORTANT: Your use of this Software is limited to those specific rights
  63. | granted under the terms of a software license agreement between the user who
  64. | downloaded the software, his/her employer (which must be your employer) and
  65. | Texas Instruments Incorporated (the "License"). You may not use this Software
  66. | unless you agree to abide by the terms of the License. The License limits
  67. | your use, and you acknowledge, that the Software may not be modified, copied
  68. | or distributed unless embedded on a Texas Instruments microcontroller or used
  69. | solely and exclusively in conjunction with a Texas Instruments radio
  70. | frequency transceiver, which is integrated into your product. Other than for
  71. | the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  72. | works of, modify, distribute, perform, display or sell this Software and/or
  73. | its documentation for any purpose.
  74. |
  75. | YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  76. | PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  77. | INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  78. | NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  79. | TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  80. | NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  81. | LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING
  82. | BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
  83. | CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
  84. | SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  85. | (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  86. |
  87. | Should you have any questions regarding your right to use this Software,
  88. | contact Texas Instruments Incorporated at www.TI.com.
  89. |
  90. +------------------------------------------------------------------------------
  91. */
  92. #endif