#include <inttypes.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "lcd.h"
Defines | |
#define | DDR(x) (*(&x - 1)) |
#define | PIN(x) (*(&x - 2)) |
#define | lcd_e_delay() __asm__ __volatile__( "rjmp 1f\n 1:" ); |
#define | lcd_e_high() LCD_E_PORT |= _BV(LCD_E_PIN); |
#define | lcd_e_low() LCD_E_PORT &= ~_BV(LCD_E_PIN); |
#define | lcd_e_toggle() toggle_e() |
#define | lcd_rw_high() LCD_RW_PORT |= _BV(LCD_RW_PIN) |
#define | lcd_rw_low() LCD_RW_PORT &= ~_BV(LCD_RW_PIN) |
#define | lcd_rs_high() LCD_RS_PORT |= _BV(LCD_RS_PIN) |
#define | lcd_rs_low() LCD_RS_PORT &= ~_BV(LCD_RS_PIN) |
#define | LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_2LINES |
#define | delay(us) _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 ) |
Functions | |
static void | toggle_e (void) |
static void | _delayFourCycles (unsigned int __count) |
static void | lcd_write (uint8_t data, uint8_t rs) |
static uint8_t | lcd_read (uint8_t rs) |
static uint8_t | lcd_waitbusy (void) |
static void | lcd_newline (uint8_t pos) |
void | lcd_command (uint8_t cmd) |
Send LCD controller instruction command. | |
void | lcd_data (uint8_t data) |
Send data byte to LCD controller. | |
void | lcd_gotoxy (uint8_t x, uint8_t y) |
Set cursor to specified position. | |
int | lcd_getxy (void) |
void | lcd_clrscr (void) |
Clear display and set cursor to home position. | |
void | lcd_home (void) |
Set cursor to home position. | |
void | lcd_putc (char c) |
Display character at current cursor position. | |
void | lcd_puts (const char *s) |
Display string without auto linefeed. | |
void | lcd_puts_p (const char *progmem_s) |
Display string from program memory without auto linefeed. | |
void | lcd_init (uint8_t dispAttr) |
Initialize display and select type of cursor. |
#define DDR | ( | x | ) | (*(&x - 1)) |
#define delay | ( | us | ) | _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 ) |
#define lcd_e_delay | ( | ) | __asm__ __volatile__( "rjmp 1f\n 1:" ); |
#define lcd_e_high | ( | ) | LCD_E_PORT |= _BV(LCD_E_PIN); |
#define lcd_e_low | ( | ) | LCD_E_PORT &= ~_BV(LCD_E_PIN); |
#define lcd_e_toggle | ( | ) | toggle_e() |
#define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_2LINES |
#define lcd_rs_high | ( | ) | LCD_RS_PORT |= _BV(LCD_RS_PIN) |
#define lcd_rs_low | ( | ) | LCD_RS_PORT &= ~_BV(LCD_RS_PIN) |
#define lcd_rw_high | ( | ) | LCD_RW_PORT |= _BV(LCD_RW_PIN) |
#define lcd_rw_low | ( | ) | LCD_RW_PORT &= ~_BV(LCD_RW_PIN) |
#define PIN | ( | x | ) | (*(&x - 2)) |
static void _delayFourCycles | ( | unsigned int | __count | ) | [inline, static] |
int lcd_getxy | ( | void | ) |
static void lcd_newline | ( | uint8_t | pos | ) | [inline, static] |
static uint8_t lcd_read | ( | uint8_t | rs | ) | [static] |
static uint8_t lcd_waitbusy | ( | void | ) | [static] |
static void lcd_write | ( | uint8_t | data, | |
uint8_t | rs | |||
) | [static] |
static void toggle_e | ( | void | ) | [static] |