hv_pm51_Base.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * @file hv_pm51_Base.h
  3. * @brief Header file of base definition(include data type, bits and others).
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use ()
  10. *
  11. * @endverbatim
  12. * @author HiView SoC Software Team
  13. * @version 1.0.0
  14. * @date 2023-03-01
  15. */
  16. #ifndef __HV_PM51_BASE_H__
  17. #define __HV_PM51_BASE_H__
  18. typedef unsigned char UCHAR8;
  19. typedef unsigned short USHORT16;
  20. typedef unsigned long ULONG32;
  21. typedef unsigned char BOOL;
  22. typedef unsigned char idata iBOOL;
  23. typedef unsigned char xdata xUCHAR8;
  24. typedef unsigned short xdata xUSHORT16;
  25. typedef unsigned long xdata xULONG32;
  26. typedef unsigned char idata iUCHAR8;
  27. typedef unsigned short idata iUSHORT16;
  28. typedef unsigned long idata iULONG32;
  29. #define __IO volatile
  30. #define __I volatile const
  31. #define __O volatile
  32. #ifndef NULL
  33. #define NULL ((void *)0)
  34. #endif
  35. #ifndef HV_TRUE
  36. #define HV_TRUE 1
  37. #endif
  38. #ifndef HV_FALSE
  39. #define HV_FALSE 0
  40. #endif
  41. #define HV_UNUSED(var) ((var) = (var))
  42. #define HV_MODE_OFF 0
  43. #define HV_MODE_ON 1
  44. /* */
  45. #define C51_CLK_FREQ (26600000)
  46. /* difine deglitch num */
  47. #define IO_DEGLITCH_NUM (0x2000)
  48. /* define BIT0~BIT31 */
  49. #define BIT_0 0x00000001 /* define BIT_0 */
  50. #define BIT_1 0x00000002 /* define BIT_1 */
  51. #define BIT_2 0x00000004 /* define BIT_2 */
  52. #define BIT_3 0x00000008 /* define BIT_3 */
  53. #define BIT_4 0x00000010 /* define BIT_4 */
  54. #define BIT_5 0x00000020 /* define BIT_5 */
  55. #define BIT_6 0x00000040 /* define BIT_6 */
  56. #define BIT_7 0x00000080 /* define BIT_7 */
  57. #define BIT_8 0x00000100 /* define BIT_8 */
  58. #define BIT_9 0x00000200 /* define BIT_9 */
  59. #define BIT_10 0x00000400 /* define BIT_10 */
  60. #define BIT_11 0x00000800 /* define BIT_11 */
  61. #define BIT_12 0x00001000 /* define BIT_12 */
  62. #define BIT_13 0x00002000 /* define BIT_13 */
  63. #define BIT_14 0x00004000 /* define BIT_14 */
  64. #define BIT_15 0x00008000 /* define BIT_15 */
  65. #define BIT_16 0x00010000 /* define BIT_16 */
  66. #define BIT_17 0x00020000 /* define BIT_17 */
  67. #define BIT_18 0x00040000 /* define BIT_18 */
  68. #define BIT_19 0x00080000 /* define BIT_19 */
  69. #define BIT_20 0x00100000 /* define BIT_20 */
  70. #define BIT_21 0x00200000 /* define BIT_21 */
  71. #define BIT_22 0x00400000 /* define BIT_22 */
  72. #define BIT_23 0x00800000 /* define BIT_23 */
  73. #define BIT_24 0x01000000 /* define BIT_24 */
  74. #define BIT_25 0x02000000 /* define BIT_25 */
  75. #define BIT_26 0x04000000 /* define BIT_26 */
  76. #define BIT_27 0x08000000 /* define BIT_27 */
  77. #define BIT_28 0x10000000 /* define BIT_28 */
  78. #define BIT_29 0x20000000 /* define BIT_29 */
  79. #define BIT_30 0x40000000 /* define BIT_30 */
  80. #define BIT_31 0x80000000 /* define BIT_31 */
  81. #endif