lcd.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-03-05 bernard first version.
  9. */
  10. #ifndef RT_LCD_H__
  11. #define RT_LCD_H__
  12. /* ioctls
  13. 0x46 is 'F' */
  14. #define FBIOGET_VSCREENINFO 0x4600
  15. #define FBIOPUT_VSCREENINFO 0x4601
  16. #define FBIOGET_FSCREENINFO 0x4602
  17. #define FBIOGET_PIXELINFO 0x4603
  18. #define FBIOGETCMAP 0x4604
  19. #define FBIOPUTCMAP 0x4605
  20. #define FBIOPAN_DISPLAY 0x4606
  21. #define FBIO_CURSOR 0x4608
  22. /* #define FBIOGET_MONITORSPEC 0x460C */
  23. /* #define FBIOPUT_MONITORSPEC 0x460D */
  24. /* #define FBIOSWITCH_MONIBIT 0x460E */
  25. #define FBIOGET_CON2FBMAP 0x460F
  26. #define FBIOPUT_CON2FBMAP 0x4610
  27. #define FBIOBLANK 0x4611 /* arg: 0 or vesa level + 1 */
  28. #define FBIOGET_VBLANK 0x4612
  29. #define FBIO_ALLOC 0x4613
  30. #define FBIO_FREE 0x4614
  31. #define FBIOGET_GLYPH 0x4615
  32. #define FBIOGET_HWCINFO 0x4616
  33. #define FBIOPUT_MODEINFO 0x4617
  34. #define FBIOGET_DISPINFO 0x4618
  35. #define FBIO_WAITFORVSYNC 0x4620
  36. struct fb_bitfield
  37. {
  38. uint32_t offset; /* beginning of bitfield */
  39. uint32_t length; /* length of bitfield */
  40. uint32_t msb_right; /* != 0 : Most significant bit is */
  41. /* right */
  42. };
  43. struct fb_var_screeninfo
  44. {
  45. uint32_t xres; /* visible resolution */
  46. uint32_t yres;
  47. uint32_t xres_virtual; /* virtual resolution */
  48. uint32_t yres_virtual;
  49. uint32_t xoffset; /* offset from virtual to visible */
  50. uint32_t yoffset; /* resolution */
  51. uint32_t bits_per_pixel; /* guess what */
  52. uint32_t grayscale; /* 0 = color, 1 = grayscale, */
  53. /* >1 = FOURCC */
  54. struct fb_bitfield red; /* bitfield in fb mem if true color, */
  55. struct fb_bitfield green; /* else only length is significant */
  56. struct fb_bitfield blue;
  57. struct fb_bitfield transp; /* transparency */
  58. uint32_t nonstd; /* != 0 Non standard pixel format */
  59. uint32_t activate; /* see FB_ACTIVATE_* */
  60. uint32_t height; /* height of picture in mm */
  61. uint32_t width; /* width of picture in mm */
  62. uint32_t accel_flags; /* (OBSOLETE) see fb_info.flags */
  63. /* Timing: All values in pixclocks, except pixclock (of course) */
  64. uint32_t pixclock; /* pixel clock in ps (pico seconds) */
  65. uint32_t left_margin; /* time from sync to picture */
  66. uint32_t right_margin; /* time from picture to sync */
  67. uint32_t upper_margin; /* time from sync to picture */
  68. uint32_t lower_margin;
  69. uint32_t hsync_len; /* length of horizontal sync */
  70. uint32_t vsync_len; /* length of vertical sync */
  71. uint32_t sync; /* see FB_SYNC_* */
  72. uint32_t vmode; /* see FB_VMODE_* */
  73. uint32_t rotate; /* angle we rotate counter clockwise */
  74. uint32_t colorspace; /* colorspace for FOURCC-based modes */
  75. uint32_t reserved[4]; /* Reserved for future compatibility */
  76. };
  77. struct fb_fix_screeninfo
  78. {
  79. char id[16]; /* identification string eg "TT Builtin" */
  80. unsigned long smem_start; /* Start of frame buffer mem */
  81. /* (physical address) */
  82. uint32_t smem_len; /* Length of frame buffer mem */
  83. uint32_t type; /* see FB_TYPE_* */
  84. uint32_t type_aux; /* Interleave for interleaved Planes */
  85. uint32_t visual; /* see FB_VISUAL_* */
  86. uint16_t xpanstep; /* zero if no hardware panning */
  87. uint16_t ypanstep; /* zero if no hardware panning */
  88. uint16_t ywrapstep; /* zero if no hardware ywrap */
  89. uint32_t line_length; /* length of a line in bytes */
  90. unsigned long mmio_start; /* Start of Memory Mapped I/O */
  91. /* (physical address) */
  92. uint32_t mmio_len; /* Length of Memory Mapped I/O */
  93. uint32_t accel; /* Indicate to driver which */
  94. /* specific chip/card we have */
  95. uint16_t capabilities; /* see FB_CAP_* */
  96. uint16_t reserved[2]; /* Reserved for future compatibility */
  97. };
  98. #endif