set up the 'lcd_device' and register it */
| 719 | |
| 720 | /* set up the 'lcd_device' and register it */ |
| 721 | int 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 | |
| 755 | static int lcd_draw_point(int args, char *argv[]) |
no test coverage detected