Esempio n. 1
0
/*
Prints the entire RFID tag on the display.
*/
void printOnLCD(_Bool shipment){ //Eventuellt göra generisk om vi vill skicka in andra värden än cargo
	hd44780_l_clear_disp(&low_conf);
	
	if (shipment == 1)
	{
		hd44780_l_write(&low_conf, 0x52);	//R
		hd44780_l_write(&low_conf, 0x46);	//F
		hd44780_l_write(&low_conf, 0x49);	//I
		hd44780_l_write(&low_conf, 0x44);	//D
		hd44780_l_write(&low_conf, 0x3A);	//:

		
		for(int i = 1; i<11; i++)	//Prints the tag's ID bytes.
		{
			hd44780_l_write(&low_conf, cargo[i]);
		}
	}
	else
	{
		hd44780_l_write(&low_conf, 0x4E);	//N
		hd44780_l_write(&low_conf, 0x4F);	//O
		hd44780_l_write(&low_conf, 0x20);	//_
		hd44780_l_write(&low_conf, 0x43);	//C
		hd44780_l_write(&low_conf, 0x41);	//A
		hd44780_l_write(&low_conf, 0x52);	//R
		hd44780_l_write(&low_conf, 0x47);	//G
		hd44780_l_write(&low_conf, 0x4F);	//O

	}
	

}
Esempio n. 2
0
void hd44780_l_init(const struct hd44780_l_conf* conf, uint8_t n, uint8_t f, uint8_t id, uint8_t s) {
	/* Wait after Vcc rises: */
	_delay_ms(15.0);
	
	/* Clear all pins: */
	_hd44780_l_ca(conf);
	
	/* Special function set (for data length): */
	*(conf->db5_port) |= _BV(conf->db5_i);
	*(conf->db4_port) |= _BV(conf->db4_i);
	_hd44780_l_ec(conf);
	
	/* Wait again: */
	_delay_ms(4.1);
	
	/* Special function set (for data length): */
	_hd44780_l_ec(conf);
	
	/* Wait again: */
	_delay_us(100.0);
	
	/* Special function set (for data length): */
	_hd44780_l_ec(conf);
	
	/* 4-bit specific: */
	if (conf->dl == HD44780_L_FS_DL_4BIT) {
		*(conf->db4_port) &= ~_BV(conf->db4_i);
		_hd44780_l_ec(conf);
	}
	
	/* Remaining process: */
	hd44780_l_fs(conf, conf->dl, n, f);
	hd44780_l_disp(conf, HD44780_L_DISP_D_OFF, HD44780_L_DISP_C_OFF, HD44780_L_DISP_B_OFF);
	hd44780_l_clear_disp(conf);
	hd44780_l_ems(conf, id, s);
}
Esempio n. 3
0
void hd44780fw_clear(struct hd44780fw_conf* conf) {
	hd44780_l_clear_disp(conf->low_conf); /* Device clear function */
	conf->last_index = 0; /* Reinitialize v. cursor */
	hd44780fw_set_bc_index(conf, 0);
}