Topic: tech dcc pc src prev next

tech dcc pc src > lcd.h

#ifndef HERMES_LCD_H
#define HERMES_LCD_H

#define HERMES_LCD_CUSTOM_MODE_UNDEFINED 0
#define HERMES_LCD_CUSTOM_MODE_OPS 1
#define HERMES_LCD_CUSTOM_MODE_MENU 2

// Custom characters in operations mode.
#define HERMES_LCD_CHAR_BUTTON_TOP ((unsigned char)0)
#define HERMES_LCD_CHAR_BUTTON_BOTTOM ((unsigned char)1)
#define HERMES_LCD_CHAR_BUTTON_BOTH ((unsigned char)2)
#define HERMES_LCD_CHAR_HB ((unsigned char)3)

// Custom characters in menu mode.
#define HERMES_LCD_CHAR_UP ((unsigned char)0)
#define HERMES_LCD_CHAR_L ((unsigned char)1)
#define HERMES_LCD_CHAR_R ((unsigned char)2)
#define HERMES_LCD_CHAR_OK ((unsigned char)3)
#define HERMES_LCD_CHAR_ACW ((unsigned char)5)
#define HERMES_LCD_CHAR_CW ((unsigned char)6)

/*
 * Fully initialise the LCD, including time for it to power up.
 */
void LCD_Init();
/*
 * Reinitialise the LCD to coerce it into a known state.
 */
void LCD_ReInit();
/*
 * Clear the screen contents and move the cursor to (0, 0).
 */
void LCD_Clear();
/*
 * Write a single character at the current cursor location.
 */
void LCD_PutC(char c);
/*
 * Write a string at the current cursor location.
 */
void LCD_PutS(const char *s);
/*
 * Write an integer a the current cursor location.
 */
void LCD_PutI(int i);
/*
 * Move the cursor to a (column, row) location.
 */
void LCD_Move(unsigned char col, unsigned char row);
/*
 * Enable the cursor.
 */
void LCD_Cursor();
/*
 * Enable the cursor and move to a location.
 * Shorthand for LCD_Cursor followed by LCD_Move.
 */
void LCD_CursorMove(unsigned char col, unsigned char row);
/*
 * Hide the cursor.
 */
void LCD_CursorHide();

/*
 * Compute the number of characters printed by LCD_PutI for a given integer.
 */
unsigned char LCD_DigitCount(int n);

/*
 * Print the position in a list to the top right of the LCD.
 */
void LCD_PrintListIndex(int index, int length);

/*
 * Define a custom character.
 *
 * data must be an array of 8 bytes representing rows of the character.
 */
void LCD_DefineCustomChar(unsigned char index, const unsigned char *data);

/*
 * Define custom characters used by the controller.
 */
void LCD_DefineHermesChars(unsigned char mode);

#endif