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

Function fb_init

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

register framebuffer device */

Source from the content-addressed store, hash-verified

687
688/* register framebuffer device */
689static int fb_init(rt_device_t fb)
690{
691 static rt_bool_t fb_init_ok = RT_FALSE;
692
693 if (fb_init_ok)
694 {
695 return 0;
696 }
697 RT_ASSERT(!rt_device_find("fb0"));
698 fb->type = RT_Device_Class_Miscellaneous;
699
700#ifdef RT_USING_DEVICE_OPS
701 fb->ops = &fb_ops;
702#else
703
704 fb->init = RT_NULL;
705 fb->open = fb_open;
706 fb->close = fb_close;
707 fb->read = RT_NULL;
708 fb->write = RT_NULL;
709 fb->control = fb_control;
710 fb->user_data = RT_NULL;
711#endif
712
713 rt_device_register(fb,"fb0",RT_DEVICE_FLAG_RDWR);
714
715 fb_init_ok = RT_TRUE;
716
717 return RT_EOK;
718}
719
720/* set up the 'lcd_device' and register it */
721int rt_hw_lcd_init(void)

Callers 1

rt_hw_lcd_initFunction · 0.70

Calls 2

rt_device_findFunction · 0.85
rt_device_registerFunction · 0.85

Tested by

no test coverage detected