打印
[微控制器/MCU]

lpc1850 LCD 调试

[复制链接]
1397|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
colinzou|  楼主 | 2014-8-5 10:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
MCU 菜鸟一名。最近调试 lpc1850 LCD 。lcd 主函数如下。lcd 的结构体 const LCD_CONFIG_T EA800x480 已经按照 lcd 的 datasheet 修改了,目前 lcd 屏只有一个光标。 而 看代码,可以发现 for 循环是要在 lcd 上显示 nxp 的 ** 的,但是现在 lcd 屏上没有显示。 谁调试过 1850 的 lcd 屏,请给点提示吧?


int main(void)
{
        uint32_t i, j;
        int cursor_x = 100, cursor_y = 150;
        int16_t tmp_x = -1, tmp_y = -1;



        SystemCoreClockUpdate();
        Board_Init();
        Chip_LCD_Init(LPC_LCD, (LCD_CONFIG_T *) &BOARD_LCD);
        //Board_LCD_Init(); // 用 sspi 通信 的小的 lcd 屏
       

        SysTick_Config(SystemCoreClock / 1000);
        msec = 5;
        while (msec) {}


//        delayMs(10000);
        /* Fill Colorbar only*/
        for (i = 0; i < LCD_WIDTH * LCD_HEIGHT / 4; i++)
                framebuffer[i] = 0x1F;
        for (i = LCD_WIDTH * LCD_HEIGHT / 4; i < LCD_WIDTH * LCD_HEIGHT * 2 / 4; i++)
                framebuffer[i] = 0x3F << 5;
        for (i = LCD_WIDTH * LCD_HEIGHT * 2 / 4; i < LCD_WIDTH * LCD_HEIGHT * 3 / 4; i++)
                framebuffer[i] = 0x1F << 11;
        for (i = LCD_WIDTH * LCD_HEIGHT * 3 / 4; i < LCD_WIDTH * LCD_HEIGHT; i++)
                framebuffer[i] = 0xFFFF;
        /* Fill NXP ** */
        for (j = 0; j < **_HEIGHT; j++)
                for (i = 0; i < **_WIDTH; i++)
                        putpixel(i, j, image[(i + j * **_WIDTH)]);

        Chip_LCD_Init(LPC_LCD, (LCD_CONFIG_T *) &BOARD_LCD);
        //Board_InitTouchController();
        Chip_LCD_SetUPFrameBuffer(LPC_LCD,  (void *) framebuffer);
        Chip_LCD_PowerOn(LPC_LCD);
        delayMs(100);
        //msec = 100;
        //while (msec) {}

        Chip_LCD_Cursor_Disable(LPC_LCD, 0);
        Chip_LCD_Cursor_Config(LPC_LCD, LCD_CURSOR_32x32, true);
        Chip_LCD_Cursor_WriteImage(LPC_LCD, 0, (void *) Cursor);
        Chip_LCD_Cursor_SetClip(LPC_LCD, CURSOR_H_OFS, CURSOR_V_OFS);
        Chip_LCD_Cursor_SetPos(LPC_LCD, cursor_x, cursor_y);
        Chip_LCD_Cursor_Enable(LPC_LCD, 0);

        /* Turn on backlight */
        Board_SetLCDBacklight(1);
        delayMs(20);
        //msec = 20;
        //while (msec) {}
/*
        while (1) {
                Board_GetTouchPos((int16_t *) &tmp_x, (int16_t *) &tmp_y);
                if ((tmp_x >= 0) && (tmp_y >= 0)) {
                        cursor_x = tmp_x;
                        cursor_y = tmp_y;
                }

                if (LCD_WIDTH < cursor_x) {
                        cursor_x = LCD_WIDTH - CURSOR_H_OFS;
                }

                if (LCD_HEIGHT < cursor_y) {
                        cursor_y = (LCD_HEIGHT - CURSOR_V_OFS);
                }
                Chip_LCD_Cursor_SetPos(LPC_LCD, cursor_x, cursor_y);
        }
*/       

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

4

主题

8

帖子

0

粉丝