lcmComm_dgus.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * lcmComm_dwin.h
  3. *
  4. * Created on : 2020-10-20
  5. * Update on : 2022-03-01
  6. * Author : Folus Wen, Eason Yang
  7. * Version : V0.27
  8. *
  9. */
  10. #ifndef LCMCOMM_DGUS_H_
  11. #define LCMCOMM_DGUS_H_
  12. #include <sys/time.h>
  13. #include <sys/timeb.h>
  14. #include <sys/types.h>
  15. #include <sys/stat.h>
  16. #include <sys/types.h>
  17. #include <sys/ioctl.h>
  18. #include <sys/socket.h>
  19. #include <sys/ipc.h>
  20. #include <sys/shm.h>
  21. #include <sys/shm.h>
  22. #include <sys/mman.h>
  23. #include <linux/wireless.h>
  24. #include <arpa/inet.h>
  25. #include <netinet/in.h>
  26. #include <unistd.h>
  27. #include <stdarg.h>
  28. #include <stdio.h>
  29. #include <stdlib.h>
  30. #include <unistd.h>
  31. #include <fcntl.h>
  32. #include <termios.h>
  33. #include <errno.h>
  34. #include <errno.h>
  35. #include <string.h>
  36. #include <time.h>
  37. #include <ctype.h>
  38. #include <ifaddrs.h>
  39. #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
  40. #define PASS 1
  41. #define FAIL -1
  42. #define YES 1
  43. #define NO 0
  44. #define ON 1
  45. #define OFF 0
  46. #define PAGE_DISPLAY_PERIOD 3
  47. //=======================================
  48. // Register Control type
  49. //=======================================
  50. #define REG_TYPE_CONTROL 0x00
  51. #define REG_TYPE_RAM 0x01
  52. #define REG_TYPE_SPECIAL_CONTROL 0x02
  53. //=======================================
  54. // Register content (Variable storage)
  55. //=======================================
  56. #define REG_ADDRESS_READ_VERSION 0x0F
  57. #define REG_ADDRESS_READ_RTC 0x10
  58. #define REG_ADDRESS_READ_PAGE_ID 0x14
  59. #define REG_ADDRESS_READ_BRIGHTNESS 0x31
  60. #define REG_ADDRESS_WRITE_BRIGHTNESS 0X82
  61. #define REG_ADDRESS_SET_PAGE_ID 0x84
  62. #define REG_ADDRESS_SET_RTC 0x9C
  63. //=======================================
  64. // LCD command constant
  65. //=======================================
  66. #define CMD_HEADER_1 0x5A
  67. #define CMD_HEADER_2 0xA5
  68. #define CMD_REG_WRITE 0x80
  69. #define CMD_REG_READ 0x81
  70. #define CMD_REG_WRITE_DATA 0x82
  71. #define CMD_REG_READ_DATA 0x83
  72. #define CMD_ACK_VALUE_1 0x4F
  73. #define CMD_ACK_VALUE_2 0x4B
  74. extern int StoreLogMsg(const char *fmt, ...);
  75. extern int8_t lcdRegisterWrite(int32_t fd, uint16_t address, uint8_t *data, uint8_t dataLen);
  76. #endif /* LCMCOMM_DGUS_H_ */