Exemplo n.º 1
0
void lcm_test_exclusive(void)
{
    uint8 i;

    ui_set_disp_bound(0,11, 0,0);
    lcm_write_command   (ST7587_WRITE_DISPLAY_DATA_CMD);

    while(1)
    {      



        for (i=0; i<3; i++)
        {
            lcm_write_data(0xAA);

        }
    
//        ui_set_disp_bound(0,11, 119,119);
//        lcm_write_command   (ST7587_WRITE_DISPLAY_DATA_CMD);
//        for (i=0; i<3; i++)
//        {
//            lcm_write_data(0x48);
//            lcm_write_data(0xcf);
//        }
    
        //ui_disp_hello();
        
        //lcm_clear_screen();
         
        //USER_DelayDTms(1000);
    }
}
Exemplo n.º 2
0
ssize_t lcm_write(struct file *mfile, const char *gdata, size_t length, loff_t *f_pos)
{
    char c = 0;
    int i, j;

    DPRINT("LCM: device write: file(0x%x) gdata(0x%x) len(%d) offset(0x%x)\n",
            (int)mfile, (int)gdata, length, (int) *f_pos);

    if (((*f_pos) < 0) || ((*f_pos) >= LCD_SIZE))
	(*f_pos) = 0;

    /* Start processing bytes at current location
     */
    for (i = 0; i < length; i++)
    {
        /*Set real Address Counter to the current file position before write data */
        lcm_write_control(0x80 | offToDDr[*f_pos]);

        get_user(c, gdata+i);
        DPRINT("LCM: device write: get_user (%c)\n", c);

	switch (c) {
	case 0x1 /*CTRL-A*/:
		/* toggle cursor on/off */
		lcm_disp ^= 0x2;
    		lcm_write_control(lcm_disp);
		break;
	case 0x2 /*CTRL-B*/:
		/* toggle cursor blinking */
		lcm_disp ^= 0x1;
    		lcm_write_control(lcm_disp);
		break;
	case 0x3 /*CTRL-C*/:
		/* home cursors position, no screen clear */
		lcm_write_control(0x2);
		udelay(1600);
		(*f_pos) = 0;
		break;
	case 0x5 /*CTRL-E*/:
		/* clear to end of line */
		for (j = ((*f_pos) & LCD_COLMASK); (j < LCD_COLS); j++)
			lcm_write_data(' ');
		break;
	case 0x6 /*CTRL-F*/:
		/* advance cursor one position */
		(*f_pos)++;
		break;
	case '\b' /*CTRL-H*/:
		/* backspace one position */
		if ((*f_pos) & LCD_COLMASK)
			(*f_pos)--;
		break;
	case '\t' /*CTRL-I*/:
		/* tab forward to tabstop */
		do {
			lcm_write_data(' ');
			(*f_pos)++;
		} while ((*f_pos) % 8);
		break;
	case '\n' /*CTRL-J*/:
		/* new line */
		for (j = ((*f_pos) & LCD_COLMASK); (j < LCD_COLS); j++) {
			lcm_write_data(' ');
			(*f_pos)++;
		}
		break;	
	case '\v' /*CTRL-K*/:
		/* vertical tab (change lines!) */
		(*f_pos) ^= LCD_COLS;
		break;
	case '\f' /*CTRL-L*/:
		/* clear and home */
		lcm_write_control(0x1);
		udelay(1600);
		(*f_pos) = 0;
		break;
	case '\r' /*CTRL-M*/:
		/* return to start of current line */
		(*f_pos) &= ~LCD_COLMASK;
		break;
	default:
        	lcm_write_data(c);
        	(*f_pos)++;
		break;
	}

	/* keep position within boundary of LCD display */
	if (((*f_pos) < 0) || ((*f_pos) >= LCD_SIZE))
		(*f_pos) = 0;

    }

    DPRINT("LCM: device write: current file position (0x%x)\n", (int) *f_pos);
    DPRINT("LCM: device write: current file position address (0x%x)\n", (int) offToDDr[*f_pos]);
    return (length);        // return number of bytes written
}