コード例 #1
0
ファイル: alcd.c プロジェクト: arene1004/networkcpe
char lcd_getc() {
   char value;

    //lcd_gotoxy(x,y);
    while ( bit_test(lcd_read_byte(),7) ); // wait until busy flag is low
    lcd_rs=1;
    value = lcd_read_byte();
    lcd_rs=0;
    return(value);
}
コード例 #2
0
ファイル: lcd4x20_lib.c プロジェクト: trangthancb/Cyclotron
char lcd_getc(BYTE x, BYTE y)
{
   char value;

   lcd_gotoxy(x,y);
   while ( bit_test(lcd_read_byte(),7) ); // wait until busy flag is low
   lcd_output_rs(1);
   value = lcd_read_byte();
   lcd_output_rs(0);
   
   return(value);
}
コード例 #3
0
ファイル: unmc_lcd_216.c プロジェクト: garispe/Unimic
int8 lcd_getc(int8 x, int8 y){
	int8 value;

	lcd_gotoxy(x,y);

	while((lcd_read_byte()&0x80)==0x80);

	RSPIN=1;
	value = lcd_read_byte();
	RSPIN=0;

	return(value);
}
コード例 #4
0
ファイル: flex_lcd.c プロジェクト: vipuldivyanshu92/Projects
char lcd_getc(char x, char y) 
{ 
	char value; 
	
	lcd_gotoxy(x,y); 
	
	// Wait until busy flag is low. 
	while(bit_test(lcd_read_byte(),7));  
	
	output_high(LCD_RS); 
	value = lcd_read_byte(); 
	output_low(lcd_RS); 
	
	return(value); 
} 
コード例 #5
0
ファイル: flex_lcd.c プロジェクト: vipuldivyanshu92/Projects
//---------------------------------------- 
// Send a byte to the LCD. 
void lcd_send_byte(char address, char n) 
{ 
	output_low(LCD_RS); 
	
	#ifdef USE_LCD_RW 
	while(bit_test(lcd_read_byte(),7)) ; 
	#else 
	delay_us(60);  
	#endif 
	
	if(address) 
	   output_high(LCD_RS); 
	else 
	   output_low(LCD_RS); 
	      
	 delay_cycles(1); 
	
	#ifdef USE_LCD_RW 
	output_low(LCD_RW); 
	delay_cycles(1); 
	#endif 
	
	output_low(LCD_E); 
	
	lcd_send_nibble(n >> 4); 
	lcd_send_nibble(n & 0xf); 
} 
コード例 #6
0
ファイル: lcd-ks0713.c プロジェクト: ChakaZulu/tuxbox_driver
int lcd_set_pixel( struct lcd_pixel * pix )
{
	int y=0;
	int val;
	int bit=0;
	int v;

	if ( pix->y >= (LCD_ROWS*8) ) {
		return -EINVAL;
	}

	if ( pix->x >= LCD_COLS ) {
		return -EINVAL;
	}

	if (pix->y) {
		y = (pix->y/8);
	}

	bit = pix->y - (y*8);

	// set dram pointer
	lcd_set_pos( y, pix->x );
	lcd_read_dummy();

	val = lcd_read_byte();

	v = pix->v;

	// invertieren
	if ( v == 2 ) {
		v = (((~val)>>bit)&1);
	}
コード例 #7
0
ファイル: lcd.c プロジェクト: DawidPi/AVR_lcd_hd44780
static inline int check_busy_flag()
{
	CLR_RS;
	SET_RW;
	DATA_IN;
	return lcd_read_byte() & (1<<7);
}
コード例 #8
0
ファイル: unmc_lcd_216.c プロジェクト: garispe/Unimic
void lcd_send_byte(int8 address, int8 n){

	RSPIN=0;

#ifdef USE_RW
	while((lcd_read_byte()&0x80)==0x80);
#else
	_delay_100us();
#endif

	TRIS_DATA_PIN_4=0;
	TRIS_DATA_PIN_5=0;
	TRIS_DATA_PIN_6=0;
	TRIS_DATA_PIN_7=0;

	if(address)
		RSPIN=1;
	else
		RSPIN=0;

	Nop();

#ifdef USE_RW
	RWPIN=0;
	Nop();
#endif

	lcd_send_nibble(n >> 4);
	lcd_send_nibble(n & 0xf);
}
コード例 #9
0
ファイル: wlcd.c プロジェクト: mfilipiak/LCD_USART
char lcd_getc( byte x, byte y) {
   char value;

    lcd_gotoxy(x,y);
    lcd.rs=1;
    value = lcd_read_byte();
    lcd.rs=0;
    return(value);
}
コード例 #10
0
ファイル: lcd_text.c プロジェクト: sergforce/AVReplicator
static void lcd_wait_busy(void)
{
	uint8_t bt;
	LCD_CTRL_PORT &= ~(1 << LCD_CTRL_RS);
	_delay_us(10);
	do {
		bt = lcd_read_byte();
	} while (bt & 0x80 == 0x80);
}
コード例 #11
0
ファイル: lcd4x20_lib.c プロジェクト: trangthancb/Cyclotron
void lcd_send_byte(BYTE address, BYTE n)
{
   lcd_output_rs(0);
   while ( bit_test(lcd_read_byte(),7) ) ;
   lcd_output_rs(address);
   delay_cycles(1);
   lcd_output_rw(0);
   delay_cycles(1);
   lcd_output_enable(0);
   lcd_send_nibble(n >> 4);
   lcd_send_nibble(n & 0xf);
}
コード例 #12
0
void lcd_send_byte( BYTE address, BYTE n ) {

      lcd.rs = 0;
      while ( bit_test(lcd_read_byte(),7) ) ;
      lcd.rs = address;
      delay_cycles(1);
      lcd.rw = 0;
      delay_cycles(1);
      lcd.enable = 0;
      lcd_send_nibble(n >> 4);
      lcd_send_nibble(n & 0xf);
}
コード例 #13
0
ファイル: display.c プロジェクト: anorimaki/pi-metal-detector
void dsp_strength_bar( int8 end_signal_char_index,
						int8 width, int8 value ) 
{
	int8 mark_pos = value/STRENGTH_VALUES_PER_CHAR;
	int8 mark_glyph = value-(mark_pos*STRENGTH_VALUES_PER_CHAR);
	
	lcd_output_rs(0);
	int8 current_address = lcd_read_byte() & 0x7F;
	
	dsp_create_signal_character( end_signal_char_index, mark_glyph );
	
	lcd_send_byte( 0, 0x80|current_address );	//Restore DDRAM address
	
	int8 i;
	for( i=0; i<mark_pos; ++i ) {
		lcd_putc(CHAR_FULL_STRENGTH);
	}
	if ( mark_pos != width ) {
		lcd_putc(end_signal_char_index);
	}
	for( i=mark_pos+1; i<width; ++i ) {
		lcd_putc(' ');
	}
}
コード例 #14
0
ファイル: display.c プロジェクト: anorimaki/pi-metal-detector
/*
 * Display a range bar with:
 *	- 3 possibles values per position in mid characters
 *	- 2 possibles values per position in start and end characters
 * Note: Only one range line is allowed.
 */
void dsp_range_line( int8 start_char_index, 
					int8 mid_char_index, 
					int8 end_char_index, 
					int8 width, int16 value, 
					int16 max_value ) 
{
	int8 range_positions = (3*(width-2)) + 2 + 2;
	int8 mark = math_change_range(value, max_value, range_positions);
	
	int8 start_glyph;
	int8 end_glyph;
	int8 mark_glyph;
	int8 mark_pos;
	if ( mark < 2 ) {							//Mark at start range
		mark_pos = 0;
		mark_glyph = 0xFF;
		start_glyph = mark;
		end_glyph = 2;
	}
	else if ( mark > (range_positions-2) ) {	//Mark at end range
		mark_pos = 0;
		mark_glyph = 0xFF;
		start_glyph = 2;
		end_glyph = (range_positions-mark);
	}
	else if ( mark == (range_positions-2) ) {	//Mark just before end range
		mark_pos = 0;
		mark_glyph = 0xFF;
		start_glyph = 2;
		end_glyph = 1;
	}
	else {										//Mark at mid range
		mark -= 2;
		mark_pos = mark/3;
		mark_glyph = mark-(mark_pos*3);
		start_glyph = 2;
		end_glyph = 2;
	}
	
	lcd_output_rs(0);
	int8 current_address = lcd_read_byte() & 0x7F;
	
				// Set glyphs
	dsp_write_mid_glyph( start_char_index, 
								CHAR_START_RANGE_MID_GLYPH[start_glyph] );
	dsp_write_mid_glyph( end_char_index, 
								CHAR_END_RANGE_MID_GLYPH[end_glyph] );
	if ( mark_glyph != 0xFF ) {
		dsp_write_mid_glyph( mid_char_index, 
									CHAR_RANGE_POSITION_GLYPH[mark_glyph] );
	}
	
	lcd_send_byte( 0, 0x80|current_address );	//Restore DDRAM address
	
				// Write range line
	int8 i;
	lcd_putc(start_char_index);
	for( i=0; i<mark_pos; ++i ) {
		lcd_putc('-');
	}
	lcd_putc( (mark_glyph==0xFF) ? '-' : mid_char_index);
	for( i=mark_pos+1; i<(width-2); ++i ) {
		lcd_putc('-');
	}
	lcd_putc(end_char_index);
}