inline size_t SpiLcd::write(uint8_t value) { send(value, HIGH); content[_currline][_currpos] = value; _currpos++; waitBusy(); return 1; }
// set user defined char void TextLCD::writeCGRAM(int address, int pattern[8]){ int i; address = address & 0x07; //max 8 char for(i=0;i<8;i++){ waitBusy(); // check if display is ready _rs = 0; writeByte(0x40 + address * 8 + i); writeData(pattern[i]); } }
void xpcc::Hd44780Minimal<E, RW, RS, DATA>::writeCommand(uint8_t command) { waitBusy(); DATA::setOutput(); RW::reset(); RS::reset(); writeNibble(command >> 4); writeNibble(command); }
void xpcc::Hd44780Minimal<E, RW, RS, DATA>::writeRaw(char c) { waitBusy(); DATA::setOutput(); RW::reset(); RS::set(); uint8_t data = c; writeNibble(data >> 4); writeNibble(data); }
int TextLCD::readData(){ int input; waitBusy(); _rw = 1; _rs = 1; __nop(); _d.input(); // switch Data port to input _e = 1; __nop(); input = _d.read() << 4; // high nibble _e = 0; __nop(); _e = 1; __nop(); input = input | _d.read(); // low nibble _e = 0; return (input); }
inline size_t OLEDFourBit::write(uint8_t value) { send(value, HIGH); waitBusy(); }
inline void OLEDFourBit::command(uint8_t value) { send(value, LOW); waitBusy(); }
void TextLCD::writeData(int data) { waitBusy(); _rs = 1; writeByte(data); }
void TextLCD::writeCommand(int command) { waitBusy(); // check if display is ready _rs = 0; writeByte(command); }
inline void SpiLcd::command(uint8_t value) { send(value, LOW); waitBusy(); }