lcd.h File Reference

Internal Interface: LCD control and constants. More...

#include <config.h>
#include <rom/lcd.h>
Include dependency graph for lcd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LCD_SHORT_CMD   0
 
#define LCD_LONG_CMD   3
 
#define LCD_DATA_OFFSET   5
 
#define LCD_DATA_SIZE   9
 
#define LCD_MODE_SET   0x40
 
#define LCD_ENABLE   0x08
 
#define LCD_DISABLE   0x00
 
#define LCD_DEV_ID   0x7c
 
#define I2C_WRITE   0
 
#define I2C_READ   1
 
#define SCL   5
 
#define SDA   6
 

Functions

void lcd_init (void)
 initialize LCD driver More...
 
void lcd_power_on (void)
 power on LCD display, also called from lcd_init() More...
 
void lcd_power_off (void)
 power off LCD display More...
 
void lcd_refresh (void)
 show LCD display contents to the world More...
 
void lcd_refresh_next_byte (void)
 show LCD display contents to the world More...
 

Variables

unsigned char display_memory []
 LCD display data buffer. More...
 

Detailed Description

Internal Interface: LCD control and constants.

Author
Eddie C. Dost ecd@s.nosp@m.kyne.nosp@m.t.be

Definition in file lcd.h.

Macro Definition Documentation

#define I2C_READ   1

Definition at line 61 of file lcd.h.

#define I2C_WRITE   0

Definition at line 60 of file lcd.h.

Referenced by lcd_init().

#define LCD_DATA_OFFSET   5

Definition at line 47 of file lcd.h.

Referenced by lcd_refresh(), and lcd_refresh_next_byte_core().

#define LCD_DATA_SIZE   9

Definition at line 48 of file lcd.h.

Referenced by lcd_refresh(), and lcd_refresh_next_byte_core().

#define LCD_DEV_ID   0x7c

Definition at line 58 of file lcd.h.

Referenced by lcd_init().

#define LCD_DISABLE   0x00

Definition at line 54 of file lcd.h.

Referenced by lcd_power_off().

#define LCD_ENABLE   0x08

Definition at line 53 of file lcd.h.

Referenced by lcd_power_on().

#define LCD_LONG_CMD   3

Definition at line 46 of file lcd.h.

Referenced by lcd_init(), and lcd_refresh().

#define LCD_MODE_SET   0x40

Definition at line 52 of file lcd.h.

Referenced by lcd_power_off(), and lcd_power_on().

#define LCD_SHORT_CMD   0

Definition at line 45 of file lcd.h.

Referenced by lcd_init(), lcd_power_off(), lcd_power_on(), and lcd_refresh_next_byte_core().

#define SCL   5

Definition at line 63 of file lcd.h.

Referenced by i2c_read_ack(), i2c_start(), i2c_stop(), i2c_write(), lcd_init(), and lcd_power_off().

#define SDA   6

Definition at line 64 of file lcd.h.

Referenced by i2c_read_ack(), i2c_start(), i2c_stop(), i2c_write(), lcd_init(), and lcd_power_off().

Function Documentation

void lcd_init ( void  )

initialize LCD driver

initialize LCD driver

output drivers are configured as outputs. the lcd_shadow buffer is cleared and initialized. the LCD controller is enabled.

Definition at line 295 of file lcd.c.

References clr, I2C_WRITE, lcd_byte_counter, LCD_DEV_ID, LCD_LONG_CMD, lcd_power_on(), lcd_refresh_counter, lcd_shadow, LCD_SHORT_CMD, memset(), PORT6_DDR, rom_port6_ddr, SCL, and SDA.

Referenced by kmain().

void lcd_power_off ( void  )

power off LCD display

power off LCD display

the LCD controller is put in low power mode and output drivers to the LCD controller are disabled.

Note: without disabling the output drivers the CPU will not save power in sleep mode.

Definition at line 279 of file lcd.c.

References clr, LCD_DISABLE, LCD_MODE_SET, lcd_refresh(), lcd_shadow, LCD_SHORT_CMD, lcd_write_data(), SCL, and SDA.

Referenced by kmain().

void lcd_power_on ( void  )

power on LCD display, also called from lcd_init()

power on LCD display, also called from lcd_init()

the LCD controller is enabled.

Definition at line 266 of file lcd.c.

References LCD_ENABLE, LCD_MODE_SET, lcd_shadow, LCD_SHORT_CMD, and lcd_write_data().

Referenced by lcd_init().

void lcd_refresh ( void  )

show LCD display contents to the world

display updates are realized exclusively by calling this function.

show LCD display contents to the world

the entire 9 bytes of display_memory are written to the LCD controller unconditionally. lcd_shadow is updated to the new values.

Definition at line 254 of file lcd.c.

References display_memory, LCD_DATA_OFFSET, LCD_DATA_SIZE, LCD_LONG_CMD, lcd_shadow, and lcd_write_data().

Referenced by delay(), kmain(), lcd_power_off(), show_off(), and show_on().

void lcd_refresh_next_byte ( void  )

show LCD display contents to the world

display updates are realized on a byte basis by calling this function: the complete display will be updated after 9 calls.

Referenced by lcd_write_data().

Variable Documentation

unsigned char display_memory[]

LCD display data buffer.

Referenced by lcd_refresh(), and lcd_refresh_next_byte_core().


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.8.11