#include <avr/pgmspace.h>
#include <stdbool.h>
#include <stdint.h>
#include "main.h"
#include <util/delay.h>
#include "i2clcd.h"
#include "i2cmaster.h"
static uint8_t lightOn=0;
_delay_ms(15);
_delay_ms(5);
_delay_ms(1);
_delay_ms(50);
_delay_ms(50);
_delay_ms(50);
_delay_ms(50);
_delay_ms(50);
}
uint8_t data_out=0;
if (value & CMD_D0) data_out |=
LCD_D4;
if (value & CMD_D1) data_out |=
LCD_D5;
if (value & CMD_D2) data_out |=
LCD_D6;
if (value & CMD_D3) data_out |=
LCD_D7;
if (value & CMD_RS) data_out |=
LCD_RS;
if (value & CMD_RW) data_out |=
LCD_RW;
i2c_write(data_out);
i2c_write(data_out |
LCD_E);
i2c_write(data_out);
i2c_stop();
}
uint8_t lcddata_w, lcddata_r, data;
if(mode) {
} else {
}
i2c_write(lcddata_w);
i2c_write(lcddata_w |
LCD_E );
i2c_stop();
lcddata_r = i2c_readNak();
i2c_stop();
i2c_write(lcddata_w);
i2c_stop();
data=0;
if (lcddata_r &
LCD_D4) data |= CMD_D0;
if (lcddata_r &
LCD_D5) data |= CMD_D1;
if (lcddata_r &
LCD_D6) data |= CMD_D2;
if (lcddata_r &
LCD_D7) data |= CMD_D3;
return data;
}
uint8_t hi, lo;
return (hi << 4) + (lo & 0x0F);
}
}
while(*string) {
}
}
uint8_t c;
while((c=pgm_read_byte(string++))) {
}
}
}
return true;
}
bool lcd_printlc(uint8_t line, uint8_t col,
char *
string) {
while(*string) {
col++;
col = 1;
}
}
return true;
}
char c;
while((c=pgm_read_byte(string++))) {
col++;
col = 1;
}
}
return true;
}
bool lcd_printlcc(uint8_t line, uint8_t col,
char *
string) {
while(*string) {
col++;
line++;
col = 1;
line = 1;
}
}
}
return true;
}
char c;
while((c=pgm_read_byte(string++))) {
col++;
line++;
col = 1;
line = 1;
}
}
}
return true;
}
uint8_t lcddata=0;
((line == 0) || (col == 0)) ) return false;
switch (line) {
}
lcddata |= 0x80;
lcddata += (col-1);
return true;
}
uint8_t line, col;
return false;
} else {
return true;
}
}
bool lcd_getlc(uint8_t *line, uint8_t *col) {
uint8_t lcddata;
if (lcddata & (1 << 7)) return false;
*line = 1;
return true;
*line = 2;
return true;
*line = 3;
return true;
*line = 4;
return true;
}
return false;
}
uint8_t data;
if (light) {
lightOn = 1;
data = LCD_LIGHT_ON;
} else {
lightOn = 0;
data = LCD_LIGHT_OFF;
}
i2c_write(data);
i2c_stop();
}
uint8_t state;
if (state & (1 << 7)) {
return true;
} else {
return false;
}
}
uint8_t i, line, col;
number &= 0x7;
for (i=0; i<8; i++) {
}
}