Functions

serial_lcd.h File Reference

#include <config.h>
#include <avr/io.h>
#include <util/delay_basic.h>
#include <util/delay.h>

Go to the source code of this file.

Functions

void send_byte_to_lcd (uint8_t rs, uint8_t lcd_data)
 Internal command used within the library to sens a byte over the two wire system.
void home_lcd (void)
 Move the LCD cursor to the home position without otherwise changing the display.
void clear_lcd (void)
 clear the display, and home the cursor.
void scroll_lcd_left (void)
 Scroll the display left by 1 character, without otherwise changing the display.
void scroll_lcd_right (void)
 Scroll the display right by 1 character, without otherwise changing the display.
void row2_lcd (void)
 Move the LCD cursor to the second line of the display.
void setaddress_lcd (uint8_t row, uint8_t column)
 Move the address pointer to the memory address corresponding to the row and column specified.
void LCD_display_char (char character)
 Display the specified character at the cursor position and move the cursor on 1 position.
void LCD_display_string (char *string)
 Display the specified string at the cursor position and move the cursor on.
void LCD_display_uint8 (uint8_t val)
 Display an 8 bit unsigned value as up to three characters.
void LCD_display_int8 (int8_t val)
 Display a signed 8 bit value as an optional minus sign followed by up to three characters.
void LCD_display_uint16 (uint16_t val)
 Display a 16 bit unsigned value as up to three characters.
void LCD_display_int16 (int16_t val)
 Display a signed 16 bit value as an optional minus sign followed by up to three characters.
void LCD_display_bin (uint8_t val)
 Display an 8 bit unsigned value as exactly eight characters of 0 or 1.
void LCD_display_nibble (uint8_t nibble)
 Display the lowest 4 bits of an 8 bit unsigned value as one ASCII character 0-9,A-F.
void LCD_display_hex (uint8_t val)
 Display an 8 bit unsigned value as two ASCII characters 0-9,A-F.

Function Documentation

void clear_lcd ( void   ) 

clear the display, and home the cursor.

Convenience function to issue the command 0x01 This function will return as soon as the command is issued, the display may internally take an unspecified time to execute the command.

void home_lcd ( void   ) 

Move the LCD cursor to the home position without otherwise changing the display.

Convenience function to issue the command 0x02 This function will return as soon as the command is issued, the display may internally take an unspecified time to execute the command.

void LCD_display_bin ( uint8_t  val  ) 

Display an 8 bit unsigned value as exactly eight characters of 0 or 1.

Parameters:
val The 8 bit value to be displayed

Display an 8 bit unsigned value as exactly eight characters of 0 or 1.

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void LCD_display_char ( char  character  ) 

Display the specified character at the cursor position and move the cursor on 1 position.

Parameters:
character The 8 bit character to be displayed

The display has 40 characters of memory for each line, irrespective of the number of characters displayed, so it is perfectly possible to write 'off the right' of a display. The characters there would be seen in a subsequent scroll left.

This function will return as soon as the command is issued, the display may internally take an unspecified time to execute the command.

void LCD_display_hex ( uint8_t  val  ) 

Display an 8 bit unsigned value as two ASCII characters 0-9,A-F.

Parameters:
val The 8 bit value to be displayed

Display an 8 bit unsigned value as two ASCII characters 0-9,A-F, top 4 bits to ASCII first, then low 4 bits

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void LCD_display_int16 ( int16_t  val  ) 

Display a signed 16 bit value as an optional minus sign followed by up to three characters.

Parameters:
val The 16 bit value to be displayed

Display an 16 bit signed integer on the LCD, as an optional minus sign followed by a series of up to five decimal characters. Doesn't output leading zeroes, so number of characters transmitted may vary.

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void LCD_display_int8 ( int8_t  val  ) 

Display a signed 8 bit value as an optional minus sign followed by up to three characters.

Parameters:
val The 8 bit value to be displayed

Display an 8 bit signed integer on the LCD, as an optional minus sign followed by a series of up to three decimal characters. Doesn't output leading zeroes, so number of characters transmitted may vary.

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void LCD_display_nibble ( uint8_t  nibble  ) 

Display the lowest 4 bits of an 8 bit unsigned value as one ASCII character 0-9,A-F.

Parameters:
nibble The 8 bit value to be displayed

Display the lowest 4 bits of an 8 bit unsigned value as one ASCII character 0-9,A-F The upper bits of the value are ignored.

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void LCD_display_string ( char *  string  ) 

Display the specified string at the cursor position and move the cursor on.

Parameters:
string pointer to the start of the string

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void LCD_display_uint16 ( uint16_t  val  ) 

Display a 16 bit unsigned value as up to three characters.

Parameters:
val The 16 bit value to be displayed

Display a 16 bit unsigned integer on the LCD, as a series of up to five decimal characters. Doesn't output leading zeroes, so number of characters transmitted may vary.

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void LCD_display_uint8 ( uint8_t  val  ) 

Display an 8 bit unsigned value as up to three characters.

Parameters:
val The 8 bit value to be displayed

Display an 8 bit unsigned integer on the LCD, as a series of up to three decimal characters. Doesn't output leading zeroes, so number of characters transmitted may vary.

See the documentation for LCD_display_char for more detail and limitations of these LCD devices,

void row2_lcd ( void   ) 

Move the LCD cursor to the second line of the display.

This function will return as soon as the command is issued, the display may internally take an unspecified time to execute the command.

void scroll_lcd_left ( void   ) 

Scroll the display left by 1 character, without otherwise changing the display.

Note that both lines scroll left on a multi line display. The display has 40 characters of memory for each line, irrespective of the number of characters displayed. This function will return as soon as the command is issued, the display may internally take an unspecified time to execute the command.

void scroll_lcd_right ( void   ) 

Scroll the display right by 1 character, without otherwise changing the display.

Note that both lines scroll right on a multi line display, either wrapping or inserting blank chacters at the beginning of the line depending on the specific model of LCD. The display has 40 characters of memory for each line, irrespective of the number of characters displayed. This function will return as soon as the command is issued, the display may internally take an unspecified time to execute the command.

void send_byte_to_lcd ( uint8_t  rs,
uint8_t  lcd_data 
)

Internal command used within the library to sens a byte over the two wire system.

Parameters:
rs 1=data, 0=control
lcd_data 8 bit value to be sent to the LCD
void setaddress_lcd ( uint8_t  row,
uint8_t  column 
)

Move the address pointer to the memory address corresponding to the row and column specified.

Parameters:
row Row number counting from 0
column Column number counting from 0

Moves the address pointer to the address specified, so new text will be inserted at this new address. The blinking cursor will not be moved.

The display has 40 characters of memory for each line, irrespective of the number of characters displayed.

This function will return as soon as the command is issued, the display may internally take an unspecified time to execute the command.