// send data inline size_t rgb_lcd::write(uint8_t value) { unsigned char dta[2] = {0x40, value}; i2c_send_byteS(dta, 2); return 1; // assume sucess }
void rgb_lcd::setCursor(uint8_t col, uint8_t row) { col = (row == 0 ? col|0x80 : col|0xc0); unsigned char dta[2] = {0x80, col}; i2c_send_byteS(dta, 2); }
/*ARD US*/ void rgb_lcd::setCursor(uint8_t col, uint8_t row){ //----- Mémorisation if(row!=m_curentRow){m_curentRow=row;} if(col!=m_curentCol){m_curentCol=col;} //-- Actualisation I2C col = (row == 0 ? col|0x80 : col|0xc0); unsigned char dta[2] = {0x80, col}; i2c_send_byteS(dta, 2); }
// Allows us to fill the first 8 CGRAM locations // with custom characters void rgb_lcd::createChar(uint8_t location, uint8_t charmap[]){ location &= 0x7; // we only have 8 locations 0-7 command(LCD_SETCGRAMADDR | (location << 3)); unsigned char dta[9]; dta[0] = 0x40; for(int i=0; i<8; i++) { dta[i+1] = charmap[i]; } i2c_send_byteS(dta, 9); }
// Allows us to fill the first 8 CGRAM locations // with custom characters void GROVE_LCDRGB_CreateChar(uint8_t location, uint8_t charmap[]) { location &= 0x7; // we only have 8 locations 0-7 GROVE_LCDRGB_Command(GROVE_LCDRGB_LCD_SETCGRAMADDR | (location << 3)); uint8_t dta[9]; dta[0] = 0x40; int i; for(i=0; i<8; i++) { dta[i+1] = charmap[i]; } i2c_send_byteS(dta, 9); }
void GROVE_LCDRGB_SetCursor(uint8_t col, uint8_t row) { col = (row == 0 ? col|0x80 : col|0xc0); uint8_t dta[2] = {0x80, col}; i2c_send_byteS(dta, 2); }
// send data void GROVE_LCDRGB_Write(uint8_t value) { uint8_t dta[2] = {0x40, value}; i2c_send_byteS(dta, 2); }
// send rgb_lcd_command void GROVE_LCDRGB_Command(uint8_t value) { uint8_t dta[2] = {0x80, value}; i2c_send_byteS(dta, 2); }
// send command inline void rgb_lcd::command(uint8_t value){ unsigned char dta[2] = {0x80, value}; i2c_send_byteS(dta, 2); }