MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_lcd_init

Function rt_hw_lcd_init

bsp/allwinner/libraries/drivers/drv_lcd.c:721–752  ·  view source on GitHub ↗

set up the 'lcd_device' and register it */

Source from the content-addressed store, hash-verified

719
720/* set up the 'lcd_device' and register it */
721int rt_hw_lcd_init(void)
722{
723 struct lcd_device *lcd_drv = &_lcd_device;
724
725 g_lcd = lcd_drv;
726 /* the content of tcon control registers can be loaded from a xml file ? */
727 // _panel = load_config_from_xml();
728 memset(lcd_drv, 0, sizeof(struct lcd_device));
729
730 lcd_drv->use_screen = DEFAULT_SCREEN;
731
732 /* initialize device structure, the type of 'lcd' is 'rt_device' */
733 lcd_drv->lcd.type = RT_Device_Class_Graphic;
734 lcd_drv->lcd.init = rt_lcd_init;
735 lcd_drv->lcd.open = RT_NULL;
736 lcd_drv->lcd.close = RT_NULL;
737 lcd_drv->lcd.control = rt_lcd_control;
738 lcd_drv->lcd.user_data = (void *)&lcd_drv->lcd_info;
739
740 /* register lcd device to RT-Thread */
741 rt_device_register(&lcd_drv->lcd, "lcd", RT_DEVICE_FLAG_RDWR);
742
743 rt_lcd_init((rt_device_t)lcd_drv);
744
745 if (fb_init(&(lcd_drv->fb)) != RT_EOK)
746 {
747 rt_kprintf("fb device init failure\n");
748 return -RT_ERROR;
749 }
750
751 return RT_EOK;
752}
753// INIT_DEVICE_EXPORT(rt_hw_lcd_init);
754
755static int lcd_draw_point(int args, char *argv[])

Callers 1

mainFunction · 0.50

Calls 4

rt_device_registerFunction · 0.85
rt_kprintfFunction · 0.85
rt_lcd_initFunction · 0.70
fb_initFunction · 0.70

Tested by

no test coverage detected