spdc.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*
  2. * Copyright (c) 2010-2012, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without modification,
  6. * are permitted provided that the following conditions are met:
  7. *
  8. * o Redistributions of source code must retain the above copyright notice, this list
  9. * of conditions and the following disclaimer.
  10. *
  11. * o Redistributions in binary form must reproduce the above copyright notice, this
  12. * list of conditions and the following disclaimer in the documentation and/or
  13. * other materials provided with the distribution.
  14. *
  15. * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
  16. * contributors may be used to endorse or promote products derived from this
  17. * software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  23. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  26. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. */
  30. #ifndef _SPDC_H_
  31. #define _SPDC_H_
  32. #include "sdk_types.h"
  33. //! @addtogroup diag_spdc
  34. //! @{
  35. ////////////////////////////////////////////////////////////////////////////////
  36. // Definitions
  37. ////////////////////////////////////////////////////////////////////////////////
  38. #define TRUE 1
  39. #define FALSE 0
  40. #define MODE0 //Gray refresh mode with flashing
  41. #define MODE1 //Gray refresh mdoe without flashing
  42. #define MODE2 //Text mode
  43. #define MODE3 //hand writing mode
  44. /*
  45. * Enable this define to have a default panel
  46. * loaded during driver initialization
  47. */
  48. //#define DEFAULT_PANEL_HW_INIT
  49. #define SPDC_HSIZE 800
  50. #define SPDC_VSIZE 600
  51. /*SPDC memory map*/
  52. #if defined(CHIP_MX6SL)
  53. #define WV_DATA_ADDR 0x93000000
  54. #define SPDC_NEXT_BUF_ADDR 0x93100000
  55. #define SPDC_CUR_BUF_ADDR 0x93200000
  56. #define SPDC_PREV_BUF_ADDR 0x93300000
  57. #define SPDC_FRM_CNT_BUF_ADDR 0x93400000
  58. #define SPDC_LUT_BUF_ADDR 0x93500000
  59. #else
  60. #error SPDC is not supported on the platform
  61. #endif
  62. enum epd_operation {
  63. SW_TCON_RESET,
  64. DISP_RESET,
  65. DEEP_REFRESH,
  66. DISP_REFRESH,
  67. };
  68. extern unsigned int fsl_gray_600x230[];
  69. extern unsigned int auo_lut[];
  70. extern int auo_lut_size;
  71. extern void sipix_epd_clock_setting(int freq);
  72. extern void spdc_power_up(void);
  73. ////////////////////////////////////////////////////////////////////////////////
  74. // API
  75. ////////////////////////////////////////////////////////////////////////////////
  76. /*!
  77. * @brief Update the image to be shown
  78. *
  79. * @param pos_x x coordinate of update area
  80. * @param pos_y y coordinate of udpate area
  81. * @param width width of update area
  82. * @param height height of update area
  83. */
  84. void spdc_update_image(int pos_x, int pos_y, int width, int height);
  85. /*!
  86. * @brief Set EPD buffers
  87. */
  88. void spdc_set_buffers(void);
  89. /*!
  90. * @brief Load waveform lut to EPD controller
  91. *
  92. * @param lut waveform lut address
  93. * @param load_addr load address
  94. */
  95. void spdc_load_wv_lut(unsigned int *lut, unsigned int load_addr);
  96. /*!
  97. * @brief SPDC clock gate
  98. *
  99. * @param on 1 means clock enable while 0 means disable
  100. */
  101. void spdc_clock_gate(int on);
  102. /*!
  103. * @brief Initialize the Sipix EPD panel
  104. *
  105. * @param resolution index of resolution look-up table
  106. * @param hburst_len_en burst length enable
  107. * @param rgbw_mode_enable color mode or gray mode selection
  108. * @param pwr_ready power ready indication
  109. * @param data_filt_en enable or disable the data filter
  110. * @param rl right-left scan direction
  111. * @param ud up-down scan direction
  112. * @param dual_gete single or dual gate selection, this is for drive IC
  113. * @param yoe_pol polariry setting of YOE signal
  114. */
  115. void spdc_panel_init_set(int resolution, int hburst_len_en, int rgbw_mode_en, int pwr_ready,
  116. int data_filt_en, int rl, int ud, int dual_gate, int yoe_pol);
  117. /*!
  118. * @brief Set the temperature for controller
  119. *
  120. * @param degrade temperature in degree
  121. */
  122. void spdc_temperature_set(float degrade);
  123. /*!
  124. * @brief Start operation
  125. *
  126. * @param opt operation mode
  127. */
  128. void spdc_operation_start(int opt);
  129. /*!
  130. * @brief enable SPDC interrupt
  131. *
  132. * @param mask interrupt source mask
  133. */
  134. void spdc_enable_interrupts(unsigned int mask);
  135. /*!
  136. * @brief Check if LUT download finished
  137. */
  138. int spdc_check_lut_download_finish(void);
  139. /*!
  140. * @brief Check if TCON initialization finished
  141. */
  142. int spdc_check_tcon_init_finish(void);
  143. /*!
  144. * @brief Check if operation finished
  145. */
  146. int spdc_check_operation_finish(void);
  147. /*!
  148. * @brief Trigger the display
  149. *
  150. * @param mode Mode selection for display
  151. */
  152. void spdc_trigger_display(int mode);
  153. //! @}
  154. #endif /*_SPDC_H_*/
  155. ////////////////////////////////////////////////////////////////////////////////
  156. // EOF
  157. ////////////////////////////////////////////////////////////////////////////////