Subversion Repositories zxusbnet

Rev

Rev 47 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef _TYPE_H_
  2. #define _TYPE_H_
  3. /**
  4.  * \file    types.h
  5.  * Type Definition of Variables.
  6.  *
  7.  * The simple data types supported by the W5300 programs are used to define function return values,
  8.  * function and message parameters, and structure members.
  9.  * They define the size and meaning of these elements.
  10.  *
  11.  */
  12.  
  13.  
  14. typedef char int8;                        /**< The 8-bit signed data type. */
  15.  
  16. typedef volatile char vint8;              /**< The volatile 8-bit signed data type. */
  17.                                            
  18. typedef unsigned char uint8;              /**< The 8-bit unsigned data type. */
  19.                                            
  20. typedef volatile unsigned char vuint8;    /**< The volatile 8-bit unsigned data type. */
  21.                                            
  22. typedef short int16;                      /**< The 16-bit signed data type. */
  23.                                            
  24. typedef volatile short vint16;            /**< The volatile 16-bit signed data type. */
  25.                                            
  26. typedef unsigned short uint16;            /**< The 16-bit unsigned data type. */
  27.                                            
  28. typedef volatile unsigned short vuint16;  /**< The volatile 16-bit unsigned data type. */
  29.                                            
  30. typedef long int32;                       /**< The 32-bit signed data type. */
  31.                                            
  32. typedef volatile long vint32;             /**< The volatile 32-bit signed data type. */
  33.                                            
  34. typedef unsigned long uint32;             /**< The 32-bit unsigned data type. */
  35.                                            
  36. typedef volatile unsigned long vuint32;   /**< The volatile 32-bit unsigned data type. */
  37.  
  38. /**
  39.  * The SOCKET data type.
  40.  */
  41. typedef uint8 SOCKET;
  42.  
  43.  
  44. typedef unsigned long   ulong;
  45. typedef unsigned short  ushort;
  46. typedef unsigned char   uchar;
  47. typedef unsigned int    uint;
  48.  
  49. #ifndef __cplusplus
  50. typedef int                             bool;
  51. #define true                    1
  52. #define false                   0
  53. #endif
  54.  
  55. // print in hex value.
  56. // type= 8 : print in format "ff".
  57. // type=16 : print in format "ffff".
  58. // type=32 : print in format "ffffffff".
  59. typedef enum {
  60.         VAR_LONG=32,
  61.         VAR_SHORT=16,
  62.         VAR_CHAR=8
  63. } VAR_TYPE;
  64.  
  65. #ifndef NULL
  66. #define NULL (void *)0
  67. #endif
  68.  
  69. #endif          /* _TYPE_H_ */
  70.