def.h
上传用户:mhstny
上传日期:2022-08-05
资源大小:793k
文件大小:2k
源码类别:

微处理器开发

开发平台:

Unix_Linux

  1. #ifndef __DEF_H__
  2. #define __DEF_H__
  3. #define U32 unsigned int
  4. #define U16 unsigned short
  5. #define S32 int
  6. #define S16 short int
  7. #define U8  unsigned char
  8. #define S8  char
  9. #define BYTE char
  10. #define WORD  short
  11. #define DWORD int
  12. #define UINT U32
  13. #define LPSTR U8 *
  14. #define TRUE  1   
  15. #define FALSE  0
  16. #define SIZE_1K 0x00000400
  17. #define SIZE_2K 0x00000800
  18. #define SIZE_4K 0x00001000
  19. #define SIZE_8K 0x00002000
  20. #define SIZE_16K 0x00004000
  21. #define SIZE_32K 0x00008000
  22. #define SIZE_64K 0x00010000
  23. #define SIZE_128K 0x00020000
  24. #define SIZE_256K 0x00040000
  25. #define SIZE_512K 0x00080000
  26. #define SIZE_1M 0x00100000
  27. #define SIZE_2M 0x00200000
  28. #define SIZE_4M 0x00400000
  29. #define SIZE_8M 0x00800000
  30. #define SIZE_16M 0x01000000
  31. #define SIZE_32M 0x02000000
  32. #define SIZE_64M 0x04000000
  33. #define SIZE_128M 0x08000000
  34. #define SIZE_256M 0x10000000
  35. #define SIZE_512M 0x20000000
  36. #define SIZE_1G 0x40000000
  37. #define SIZE_2G 0x80000000
  38. /*
  39. #define SIZE_128K (128*1024)
  40. #define SIZE_256K (256*1024)
  41. #define SIZE_512K (512*1024)
  42. #define SIZE_1M (1024*1024)
  43. */
  44. #define ENTER_KEY 0x0d
  45. #define BACK_KEY 0x08
  46. #define BEEP_KEY 0x07
  47. #define UP_KEY 0x41
  48. #define DOWN_KEY 0x42
  49. #define RIGHT_KEY 0x43
  50. #define LEFT_KEY 0x44
  51. #define HOME_KEY 0x48
  52. #define END_KEY 0x4b
  53. #define ESC_KEY 0x1b
  54. #define outportb(port, data) *(volatile U8 *)(port) = (data)
  55. #define outportw(port, data) *(volatile U16 *)(port) = (data)
  56. #define outportd(port, data) *(volatile U32 *)(port) = (data)
  57. #define inportb(port) *(volatile U8 *)(port)
  58. #define inportw(port) *(volatile U16 *)(port)
  59. #define inportd(port) *(volatile U32 *)(port)
  60. #endif /*__DEF_H__*/