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

Function rt_hw_dc_init

bsp/loongson/ls1cdev/drivers/display_controller.c:213–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void rt_hw_dc_init(void)
214{
215 rt_device_t dc = rt_malloc(sizeof(struct rt_device));
216 if (dc == RT_NULL)
217 {
218 rt_kprintf("dc == RT_NULL\n");
219 return; /* no memory yet */
220 }
221
222 _dc_info.bits_per_pixel = 16;
223 _dc_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565;
224 _dc_info.framebuffer = (rt_uint8_t*)HW_FB_ADDR;
225 _dc_info.width = FB_XSIZE;
226 _dc_info.height = FB_YSIZE;
227
228 /* init device structure */
229 dc->type = RT_Device_Class_Graphic;
230 dc->init = rt_dc_init;
231 dc->open = RT_NULL;
232 dc->close = RT_NULL;
233 dc->control = rt_dc_control;
234 dc->user_data = (void*)&_dc_info;
235
236 /* register Display Controller device to RT-Thread */
237 rt_device_register(dc, "dc", RT_DEVICE_FLAG_RDWR);
238
239 rt_device_init(dc);
240}
241
242#include <rtgui/driver.h>
243#include "display_controller.h"

Callers 1

rtgui_lcd_initFunction · 0.70

Calls 4

rt_mallocFunction · 0.85
rt_kprintfFunction · 0.85
rt_device_registerFunction · 0.85
rt_device_initFunction · 0.85

Tested by

no test coverage detected