示例#1
0
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();
}
示例#2
0
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();
	}

}
示例#3
0
void display_visibility_on()
{
	start_sending_command();
	PORTA = 0b00001111;
	end_sending();
}
示例#4
0
static void transfer_ended(void *unused)
{
    end_sending();
}
示例#5
0
static void abort_sending()
{
    end_sending();
}