void display_init() { _delay_us(15); start_sending_command(); PORTA = 0b00110000; end_sending(); _delay_ms(5); start_sending_command(); PORTA = 0b00110000; end_sending(); _delay_us(100); start_sending_command(); PORTA = 0b00110000; end_sending(); start_sending_command(); PORTA = 0b00110000;//2 lines,5x10dots end_sending(); start_sending_command(); PORTA = 0b00001000;//display off end_sending(); start_sending_command(); PORTA = 0b00000001;//display clear end_sending(); start_sending_command(); PORTA = 0b00000111;//increment adress counter, zero shift end_sending(); }
int main() { /*static uint8_t cycles_counter = 0; setup_io(); while(true) { sleep_cpu(); if (cycles_counter == 3) { } else { cycles_counter++; } }*/ setup_io(); //setup_timers; display_init(); display_visibility_on(); start_sending_command(); PORTA = 0b10000000;//DDRAM adress 00 end_sending(); start_sending_command(); PORTA = 0b00010100;//cursor shift; end_sending(); start_sending_data();//write data PORTA = 0b01000101;//'E' end_sending(); while(true) { sleep_cpu(); } }
void display_visibility_on() { start_sending_command(); PORTA = 0b00001111; end_sending(); }
static void transfer_ended(void *unused) { end_sending(); }
static void abort_sending() { end_sending(); }