usbPlatform.h
上传用户:nvosite88
上传日期:2007-01-17
资源大小:4983k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usbPlatform.h - Basic platform definitions for USB driver stack */
  2. /* Copyright 2000 Wind River Systems, Inc. */
  3. /*
  4. Modification history
  5. --------------------
  6. 01e,18sep01,wef  merge from wrs.tor2_0.usb1_1-f for veloce
  7. 01d,05dec00,wef  removed M_usb* and put in vwModNum.h
  8. 01c,12jan00,rcb  Add definition for M_usbSpeakerLib.
  9. 01b,26may99,rcb  Add definition of VOLATILE.
  10. 01a,31may99,rcb  First.
  11. */
  12. /*
  13. DESCRIPTION
  14. This file contains basic platform definitions used to write portable (O/S-
  15. independent) code.  
  16. By convention, this should be the only file in a set of "portable" code which
  17. contains #ifdef's and other constructs used to accomodate machine or O/S
  18. dependencies.
  19. */
  20. #ifndef __INCusbPlatformh
  21. #define __INCusbPlatformh
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /*
  26.  * Structure packing
  27.  *
  28.  * By convention, all code wants "zero-byte packing".  That is, the compiler
  29.  * should assemble structures so that fields are contiguous in memory...no
  30.  * padding should be added.  CMC's use of this convention was approved by
  31.  * D'Anne Thompson of WRS on 09jun99.
  32.  */
  33. /* 
  34.  * Basic data types
  35.  *
  36.  * vxWorks.h defines UINT8, UINT16, UINT32, BOOL, VOID, and STATUS.
  37.  *
  38.  * vxWorks.h defines min(x,y), max(x,y).
  39.  *
  40.  * vxWorks.h defines _BIG_ENDIAN, _BYTE_ORDER, MSB, LSB, LONGSWAP.
  41.  *
  42.  * vxWorks.h defines OK, ERROR.
  43.  */
  44. #include "vxWorks.h"
  45. /* pointers to data types */
  46. typedef UINT8 *pUINT8;
  47. typedef UINT16 *pUINT16;
  48. typedef UINT32 *pUINT32;
  49. typedef BOOL *pBOOL;
  50. typedef char *pCHAR;
  51. typedef VOID *pVOID;
  52. /* VOLATILE */
  53. #define VOLATILE    volatile
  54. /* Macros to deal with byte order issues */
  55. #if (_BYTE_ORDER == _BIG_ENDIAN)
  56. #define FROM_LITTLEW(w)  (MSB((w)) | (LSB((w)) << 8))
  57. #define FROM_LITTLEL(l)  (LONGSWAP((l)))
  58. #define FROM_BIGW(w) (w)
  59. #define FROM_BIGL(l) (l)
  60. #else
  61. #define FROM_LITTLEW(w)  (w)
  62. #define FROM_LITTLEL(l)  (l)
  63. #define FROM_BIGW(w) (MSB((w)) | (LSB((w)) << 8))
  64. #define FROM_BIGL(l) (LONGSWAP((l)))
  65. #endif
  66. #define TO_LITTLEW(w) FROM_LITTLEW((w))
  67. #define TO_LITTLEL(l) FROM_LITTLEL((l))
  68. #define TO_BIGW(w) FROM_BIGW((w))
  69. #define TO_BIGL(w) FROM_BIGL((l))
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* __INCusbPlatformh */
  74. /* End of file. */