boot_lcd.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _BOOT_LCD_H_
  13. #define _BOOT_LCD_H_
  14. #include "drv_lcd_defs.h"
  15. OSI_EXTERN_C_BEGIN
  16. /**
  17. * \brief opaque data struct for LCD
  18. */
  19. typedef struct bootLcd bootLcd_t;
  20. /**
  21. * \brief get LCD driver instance by name
  22. *
  23. * \param name LCD driver name
  24. * \return
  25. * - LCD instance
  26. * - NULL on invalid parameter
  27. */
  28. bootLcd_t *bootLcdGetByname(unsigned name);
  29. /**
  30. * \brief open LCD instance
  31. *
  32. * When it is the first time to open the LCD, it will probe the panel.
  33. *
  34. * After open, pixel data can be send to panel. However, unless back light
  35. * id enabled, picture can't be seen on panel.
  36. *
  37. * \param d LCD driver instance
  38. * \return
  39. * - true on success
  40. * - false on invalid parameter, or invalid panel
  41. */
  42. bool bootLcdOpen(bootLcd_t *d);
  43. /**
  44. * \brief close LCD instance
  45. *
  46. * \param d LCD driver instance
  47. */
  48. void bootLcdClose(bootLcd_t *d);
  49. /**
  50. * \brief turn on or off back light of LCD
  51. *
  52. * \param d LCD instance
  53. * \param enabled true to turn on back light, false to turn off
  54. */
  55. void bootLcdSetBackLightEnable(bootLcd_t *d, bool enabled);
  56. /**
  57. * \brief get panel information
  58. *
  59. * When the panel is invalid, it will return false.
  60. *
  61. * After direction transform is changed, the width and height of panel
  62. * may be swapped.
  63. *
  64. * \param d LCD driver instance
  65. * \param info output panel information
  66. * \return
  67. * - true on success
  68. * - false on invalid parameter or panel invalid
  69. */
  70. bool bootLcdGetPanelInfo(bootLcd_t *d, drvLcdPanelInfo_t *info);
  71. /**
  72. * \brief set screen direction
  73. *
  74. * \param d LCD driver instance
  75. * \param dir direction
  76. */
  77. void bootLcdSetDirection(bootLcd_t *d, drvLcdDirection_t dir);
  78. /**
  79. * \brief flush LCD display
  80. *
  81. * When \p sync is false, this will return immediate after data transfer is
  82. * started. Otherwise, this will wait data transfer is finished.
  83. *
  84. * When previous data transfer is on-going, it will wait previous data
  85. * transfer finish anyway.
  86. *
  87. * Dcache clean will be performed inside.
  88. *
  89. * \param d LCD driver instance
  90. * \param layers layers definition
  91. * \param sync true to wait data transfer done
  92. * \return
  93. * - true on success
  94. * - false on invalid parameter
  95. */
  96. bool bootLcdFlush(bootLcd_t *d, const drvLcdLayers_t *layers, bool sync);
  97. /**
  98. * \brief fill solid color in screen ROI
  99. *
  100. * When \p screen_roi is NULL, fill full screen.
  101. *
  102. * \param d LCD driver instance
  103. * \param color color in RGB565
  104. * \param screen_roi screen ROI, NULL for full screen
  105. * \param sync true to wait data transfer done
  106. * \return
  107. * - true on success
  108. * - false on invalid parameter
  109. */
  110. bool bootLcdFill(bootLcd_t *d, uint16_t color, const drvLcdArea_t *screen_roi, bool sync);
  111. /**
  112. * \brief wait on-going data transfer done
  113. */
  114. void bootLcdWaitTransferDone(void);
  115. OSI_EXTERN_C_END
  116. #endif