@@ -80,30 +80,14 @@ void ili9341_init(void)
8080 {0 , {0 }, 0xff },
8181 };
8282
83- #if ILI9341_BCKL == 15
84- gpio_config_t io_conf ;
85- io_conf .intr_type = GPIO_PIN_INTR_DISABLE ;
86- io_conf .mode = GPIO_MODE_OUTPUT ;
87- io_conf .pin_bit_mask = GPIO_SEL_15 ;
88- io_conf .pull_down_en = GPIO_PULLDOWN_DISABLE ;
89- io_conf .pull_up_en = GPIO_PULLUP_DISABLE ;
90- gpio_config (& io_conf );
91- #endif
92-
9383 //Initialize non-SPI GPIOs
94- gpio_pad_select_gpio (ILI9341_DC );
84+ gpio_pad_select_gpio (ILI9341_DC );
9585 gpio_set_direction (ILI9341_DC , GPIO_MODE_OUTPUT );
86+
9687#if ILI9341_USE_RST
97- gpio_pad_select_gpio (ILI9341_RST );
88+ gpio_pad_select_gpio (ILI9341_RST );
9889 gpio_set_direction (ILI9341_RST , GPIO_MODE_OUTPUT );
99- #endif
100-
101- #if ILI9341_ENABLE_BACKLIGHT_CONTROL
102- gpio_pad_select_gpio (ILI9341_BCKL );
103- gpio_set_direction (ILI9341_BCKL , GPIO_MODE_OUTPUT );
104- #endif
10590
106- #if ILI9341_USE_RST
10791 //Reset the display
10892 gpio_set_level (ILI9341_RST , 0 );
10993 vTaskDelay (100 / portTICK_RATE_MS );
@@ -124,9 +108,7 @@ void ili9341_init(void)
124108 cmd ++ ;
125109 }
126110
127- ili9341_enable_backlight (true);
128-
129- ili9341_set_orientation (CONFIG_LV_DISPLAY_ORIENTATION );
111+ ili9341_set_orientation (CONFIG_LV_DISPLAY_ORIENTATION );
130112
131113#if ILI9341_INVERT_COLORS == 1
132114 ili9341_send_cmd (0x21 );
@@ -158,29 +140,10 @@ void ili9341_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
158140
159141 /*Memory write*/
160142 ili9341_send_cmd (0x2C );
161-
162-
163143 uint32_t size = lv_area_get_width (area ) * lv_area_get_height (area );
164-
165144 ili9341_send_color ((void * )color_map , size * 2 );
166145}
167146
168- void ili9341_enable_backlight (bool backlight )
169- {
170- #if ILI9341_ENABLE_BACKLIGHT_CONTROL
171- ESP_LOGI (TAG , "%s backlight." , backlight ? "Enabling" : "Disabling" );
172- uint32_t tmp = 0 ;
173-
174- #if (ILI9341_BCKL_ACTIVE_LVL == 1 )
175- tmp = backlight ? 1 : 0 ;
176- #else
177- tmp = backlight ? 0 : 1 ;
178- #endif
179-
180- gpio_set_level (ILI9341_BCKL , tmp );
181- #endif
182- }
183-
184147void ili9341_sleep_in ()
185148{
186149 uint8_t data [] = {0x08 };
0 commit comments