1
+ /* *
2
+ ******************************************************************************
3
+ * @file st7701.cpp
4
+ * @author
5
+ * @version
6
+ * @date
7
+ * @brief
8
+ ******************************************************************************
9
+ */
10
+
11
+ /* Includes ------------------------------------------------------------------*/
1
12
#include " Arduino.h"
2
13
#include " st7701.h"
3
14
#include " dsi.h"
4
15
#include " video_modes.h"
5
16
17
+ /* Private define ------------------------------------------------------------*/
6
18
/* Command2 BKx selection command */
7
19
#define DSI_CMD2BKX_SEL 0xFF
8
20
#define DSI_CMD2BK1_SEL 0x11
31
43
#define MIPI_DCS_SOFT_RESET 0x01
32
44
#define MIPI_DCS_EXIT_SLEEP_MODE 0x11
33
45
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 -------------------------------------------------------------*/
34
53
#define SSD_MODE (a,b )
35
54
#define Set_POWER (a,b,c,d )
36
55
#define Set_STANDBY ()
37
56
#define Set_BOOST (a,b,c,d )
38
57
#define Set_RESET (a,b )
39
58
#define SSD_LANE (a,b )
40
59
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 ---------------------------------------------------------*/
47
61
const uint16_t _E5[17 ] = {0xE5 ,0x0E ,0x2D ,0xA0 ,0xa0 ,0x10 ,0x2D ,0xA0 ,0xA0 ,0x0A ,0x2D ,0xA0 ,0xA0 ,0x0C ,0x2D ,0xA0 ,0xA0 };
48
62
const uint16_t _E8[17 ] = {0xE8 ,0x0D ,0x2D ,0xA0 ,0xA0 ,0x0F ,0x2D ,0xA0 ,0xA0 ,0x09 ,0x2D ,0xA0 ,0xA0 ,0x0B ,0x2D ,0xA0 ,0xA0 };
49
63
const uint16_t _ED[17 ] = {0xED ,0xAB ,0x89 ,0x76 ,0x54 ,0x01 ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0x10 ,0x45 ,0x67 ,0x98 ,0xBA };
50
64
65
+ /* Private function prototypes -----------------------------------------------*/
51
66
static void Generic_Long_Write (uint8_t * pdata, int length);
52
67
static void DCS_Short_Write_NP (uint8_t data0);
53
68
static void Generic_Short_Write_1P (uint8_t data0, uint8_t data1);
54
69
static void DCS_Short_Read_NP (uint8_t data0, int length, uint8_t * p_data);
55
70
71
+ /* Functions -----------------------------------------------------------------*/
72
+
56
73
void st7701_init (enum edid_modes mode) {
57
74
struct edid _edid;
58
75
struct display_timing dt;
@@ -241,4 +258,6 @@ void Generic_Long_Write(uint8_t* pdata, int length) {
241
258
242
259
void DCS_Short_Read_NP (uint8_t data0, int length, uint8_t * p_data) {
243
260
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