DevOS.h
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:2k
开发平台:

C/C++

  1. #ifndef __DEVOS_H__
  2. #define __DEVOS_H__
  3. //#define TRUE (1)
  4. //#define FALSE (0)
  5. #define ERROR (-1)
  6. #define ENABLE (1)
  7. #define DISABLE (0)
  8. #define CLEAR (0)
  9. #define _NULL (0)
  10. #define BYTE unsigned char
  11. #define WORD unsigned short
  12. #define DWRD unsigned long
  13. #define LPCTSTR const char code*
  14. typedef bit (code* _LPFNEVENTFUNC_)(void);
  15. typedef bit (code* _LPFNEXCEPTION_)(LPCTSTR ErrMsg);
  16. typedef struct __COMMAND_KEY__
  17. {
  18. LPCTSTR lpctszCommand; // command key word.
  19. BYTE    MaxParams; // maximum parameters.
  20. BYTE    MinParams; // minimum parameters.
  21. LPCTSTR lpctszComment; // command comment.
  22. _LPFNEVENTFUNC_ lpfnCmdFunc;
  23. _LPFNEXCEPTION_ lpfnGenExcp;
  24. } COMMAND_KEY;
  25. typedef bit (code* _LPFN_DIAGNOSTIC_TYPE_)(DWRD idata* lpdwAddrAry);
  26. typedef struct _DIAGNOSTIC_TYPE_
  27. {
  28. LPCTSTR lpctszType; // command key word.
  29. _LPFN_DIAGNOSTIC_TYPE_ lpfnType;
  30. } DIAGNOSTIC_TYPE;
  31. typedef bit (code* _LPFN_ERASE_FLASHMEM_CMDTYPE_)(void);
  32. typedef struct _ERASE_FLASHMEM_
  33. {
  34. LPCTSTR lpctszCmdType;
  35. _LPFN_ERASE_FLASHMEM_CMDTYPE_ lpfnCmdType;
  36. } ERASE_FLASHMEM;
  37. typedef const BYTE (code* _LPFN_PORTX_READ_ )(void);
  38. typedef       void (code* _LPFN_PORTX_WRITE_)(const BYTE state);
  39. typedef struct _PORTX_PROGRAMMING_
  40. {
  41. LPCTSTR lpctszPORTXname;
  42. _LPFN_PORTX_READ_ lpfnPORTXread;
  43. _LPFN_PORTX_WRITE_ lpfnPORTXwrite;
  44. } PORTX_PROGRAMMING;
  45. typedef const WORD (code* _LPFN_INTX_READ_ )(void);
  46. typedef       void (code* _LPFN_INTX_WRITE_)(const WORD wData);
  47. typedef struct _INTX_PROGRAMMING_
  48. {
  49. LPCTSTR lpctszINTKeyword;
  50. _LPFN_INTX_READ_ lpfnINTXread;
  51. _LPFN_INTX_WRITE_ lpfnINTXwrite;
  52. const WORD wMask;
  53. } INTX_PROGRAMMING;
  54. #define XADDR 0xE000
  55. #define XCS0 0xE000
  56. #define XCS1 0xE200
  57. #define XCS2 0xE400
  58. #define XCS3 0xE600
  59. #define FRESET 0xE800
  60. #define XALE0 0xEA00
  61. #define XALE1 0xEC00
  62. #define XALE2 0xEE00
  63. #endif