lcd_cfg.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef _LCD_CFG_H_
  2. #define _LCD_CFG_H_
  3. #include <stdint.h>
  4. #define COORD_Y_REVERSE (1<<0)
  5. #define COORD_X_REVERSE (1<<1)
  6. #define COORD_XY_EXCHANGE (1<<2)
  7. #define DEFAULT_LCD_CONFIG {\
  8. type: "rgb",\
  9. width:480,\
  10. height:272,\
  11. bits_pixel:18,\
  12. timing:\
  13. {\
  14. pixel_clock_hz:10000000,\
  15. h_front_porch:8,\
  16. h_back_porch:43,\
  17. h_sync_len:4,\
  18. v_front_porch:8,\
  19. v_back_porch:12,\
  20. v_sync_len:4,\
  21. h_sync_active:0,\
  22. v_sync_active:0,\
  23. den_active:1,\
  24. clk_active:1\
  25. },\
  26. swap_flag:0,\
  27. ctp_flag:0,\
  28. bl_mode:1,\
  29. bl_gpio_pin:GPIOB(6),\
  30. bl_gpio_level:1,\
  31. bl_pwm_name: "pwm",\
  32. bl_pwm_hz:1000,\
  33. bl_pwm_pol:0,\
  34. bl_pwm_val:60,\
  35. bl_pin:GPIOG(13),\
  36. bl_level:1,\
  37. pwr_pin:GPIOG(15),\
  38. pwr_level:1,\
  39. lane:4\
  40. }
  41. struct panel_timing
  42. {
  43. int pixel_clock_hz;
  44. int h_front_porch;
  45. int h_back_porch;
  46. int h_sync_len;
  47. int v_front_porch;
  48. int v_back_porch;
  49. int v_sync_len;
  50. int h_sync_active;
  51. int v_sync_active;
  52. int den_active;
  53. int clk_active;
  54. };
  55. typedef struct panel_timing *panel_timing_t;
  56. struct lcd_cfg_panel_info
  57. {
  58. rt_int8_t type[8];
  59. int width;
  60. int height;
  61. int bits_pixel;
  62. struct panel_timing timing;
  63. int swap_flag;
  64. int ctp_flag;
  65. int bl_mode;
  66. int bl_gpio_pin;
  67. int bl_gpio_level;
  68. rt_int8_t bl_pwm_name[8];
  69. int bl_pwm_hz;
  70. int bl_pwm_pol;
  71. int bl_pwm_val;
  72. int bl_pin;
  73. int bl_level;
  74. int pwr_pin;
  75. int pwr_level;
  76. int lane;
  77. };
  78. const struct lcd_cfg_panel_info* load_lcd_config_from_xml(void);
  79. #endif