1 /** 2 * @file lv_st7796.h 3 * 4 * This driver is just a wrapper around the generic MIPI compatible LCD controller driver 5 * 6 */ 7 8 #ifndef LV_ST7796_H 9 #define LV_ST7796_H 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /********************* 16 * INCLUDES 17 *********************/ 18 19 #include "../lcd/lv_lcd_generic_mipi.h" 20 21 #if LV_USE_ST7796 22 23 /********************* 24 * DEFINES 25 *********************/ 26 27 /********************** 28 * TYPEDEFS 29 **********************/ 30 31 typedef lv_lcd_send_cmd_cb_t lv_st7796_send_cmd_cb_t; 32 typedef lv_lcd_send_color_cb_t lv_st7796_send_color_cb_t; 33 34 /********************** 35 * GLOBAL PROTOTYPES 36 **********************/ 37 38 /** 39 * Create an LCD display with ST7796 driver 40 * @param hor_res horizontal resolution 41 * @param ver_res vertical resolution 42 * @param flags default configuration settings (mirror, RGB ordering, etc.) 43 * @param send_cmd platform-dependent function to send a command to the LCD controller (usually uses polling transfer) 44 * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer: must implement a 'ready' callback) 45 * @return pointer to the created display 46 */ 47 lv_display_t * lv_st7796_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags, 48 lv_st7796_send_cmd_cb_t send_cmd_cb, lv_st7796_send_color_cb_t send_color_cb); 49 50 /** 51 * Set gap, i.e., the offset of the (0,0) pixel in the VRAM 52 * @param disp display object 53 * @param x x offset 54 * @param y y offset 55 */ 56 void lv_st7796_set_gap(lv_display_t * disp, uint16_t x, uint16_t y); 57 58 /** 59 * Set color inversion 60 * @param disp display object 61 * @param invert false: normal, true: invert 62 */ 63 void lv_st7796_set_invert(lv_display_t * disp, bool invert); 64 65 /** 66 * Set gamma curve 67 * @param disp display object 68 * @param gamma gamma curve 69 */ 70 void lv_st7796_set_gamma_curve(lv_display_t * disp, uint8_t gamma); 71 72 /** 73 * Send list of commands. 74 * @param disp display object 75 * @param cmd_list controller and panel-specific commands 76 */ 77 void lv_st7796_send_cmd_list(lv_display_t * disp, const uint8_t * cmd_list); 78 79 /********************** 80 * OTHERS 81 **********************/ 82 83 /********************** 84 * MACROS 85 **********************/ 86 87 #endif /*LV_USE_ST7796*/ 88 89 #ifdef __cplusplus 90 } /*extern "C"*/ 91 #endif 92 93 #endif /*LV_ST7796_H*/ 94