static uint8_t twi_write_read(uint8_t *byte)
{
	uint8_t twierror;

	if((twierror = twi_master_send(0x39, 1, byte)) != tme_ok)
		return(0);

	if((twierror = twi_master_receive(0x39, 1, byte)) != tme_ok)
		return(0);

	return(1);
}
Beispiel #2
0
static TWRESULT send_command(SSD_COMMAND command)
{
    uint8_t buf[] = { 0x00, command };
    return twi_master_send(SSD1306_I2C_ADDRESS, buf, 2, CLOSE);
}