1+ /* *
2+ ******************************************************************************
3+ * @file st7701.cpp
4+ * @author
5+ * @version
6+ * @date
7+ * @brief
8+ ******************************************************************************
9+ */
10+
11+ /* Includes ------------------------------------------------------------------*/
112#include " Arduino.h"
213#include " st7701.h"
314#include " dsi.h"
415#include " video_modes.h"
516
17+ /* Private define ------------------------------------------------------------*/
618/* Command2 BKx selection command */
719#define DSI_CMD2BKX_SEL 0xFF
820#define DSI_CMD2BK1_SEL 0x11
3143#define MIPI_DCS_SOFT_RESET 0x01
3244#define MIPI_DCS_EXIT_SLEEP_MODE 0x11
3345
46+ #define hdsi_eval dsi
47+
48+ #define LCD_ST7701_ID 0x00 // VC (Virtual channel, for using muliple displays)
49+
50+ #define Delay (x ) delay(x)
51+
52+ /* Private macro -------------------------------------------------------------*/
3453#define SSD_MODE (a,b )
3554#define Set_POWER (a,b,c,d )
3655#define Set_STANDBY ()
3756#define Set_BOOST (a,b,c,d )
3857#define Set_RESET (a,b )
3958#define SSD_LANE (a,b )
4059
41- #define hdsi_eval dsi
42-
43- #define LCD_ST7701_ID 0x00 // VC (Virtual channel, for using muliple displays)
44-
45- #define Delay (x ) delay(x)
46-
60+ /* Private variables ---------------------------------------------------------*/
4761const uint16_t _E5[17 ] = {0xE5 ,0x0E ,0x2D ,0xA0 ,0xa0 ,0x10 ,0x2D ,0xA0 ,0xA0 ,0x0A ,0x2D ,0xA0 ,0xA0 ,0x0C ,0x2D ,0xA0 ,0xA0 };
4862const uint16_t _E8[17 ] = {0xE8 ,0x0D ,0x2D ,0xA0 ,0xA0 ,0x0F ,0x2D ,0xA0 ,0xA0 ,0x09 ,0x2D ,0xA0 ,0xA0 ,0x0B ,0x2D ,0xA0 ,0xA0 };
4963const uint16_t _ED[17 ] = {0xED ,0xAB ,0x89 ,0x76 ,0x54 ,0x01 ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0x10 ,0x45 ,0x67 ,0x98 ,0xBA };
5064
65+ /* Private function prototypes -----------------------------------------------*/
5166static void Generic_Long_Write (uint8_t * pdata, int length);
5267static void DCS_Short_Write_NP (uint8_t data0);
5368static void Generic_Short_Write_1P (uint8_t data0, uint8_t data1);
5469static void DCS_Short_Read_NP (uint8_t data0, int length, uint8_t * p_data);
5570
71+ /* Functions -----------------------------------------------------------------*/
72+
5673void st7701_init (enum edid_modes mode) {
5774 struct edid _edid;
5875 struct display_timing dt;
@@ -241,4 +258,6 @@ void Generic_Long_Write(uint8_t* pdata, int length) {
241258
242259void DCS_Short_Read_NP (uint8_t data0, int length, uint8_t * p_data) {
243260 HAL_DSI_Read (&hdsi_eval, LCD_ST7701_ID, p_data, length, DSI_DCS_SHORT_PKT_READ, data0, NULL );
244- }
261+ }
262+
263+ /* *** END OF FILE ****/
0 commit comments