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

Function rt_hw_dc_init

bsp/loongson/ls1bdev/drivers/display_controller.c:205–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205void rt_hw_dc_init(void)
206{
207 rt_device_t dc = rt_malloc(sizeof(struct rt_device));
208 if (dc == RT_NULL)
209 {
210 rt_kprintf("dc == RT_NULL\n");
211 return; /* no memory yet */
212 }
213
214 _dc_info.bits_per_pixel = 16;
215 _dc_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565P;
216 _dc_info.framebuffer = (rt_uint8_t*)HW_FB_ADDR;
217 _dc_info.width = FB_XSIZE;
218 _dc_info.height = FB_YSIZE;
219
220 /* init device structure */
221 dc->type = RT_Device_Class_Graphic;
222 dc->init = rt_dc_init;
223 dc->open = RT_NULL;
224 dc->close = RT_NULL;
225 dc->control = rt_dc_control;
226 dc->user_data = (void*)&_dc_info;
227
228 /* register Display Controller device to RT-Thread */
229 rt_device_register(dc, "dc", RT_DEVICE_FLAG_RDWR);
230}

Callers 1

rt_hw_board_initFunction · 0.70

Calls 3

rt_mallocFunction · 0.85
rt_kprintfFunction · 0.85
rt_device_registerFunction · 0.85

Tested by

no test coverage detected