- 设计思路:
LCD的显示分为有按键触发的信息区显示和无需按键触发固定栏显示。利用静态链表数据结构,制作成一张数组形式的表,配置好所有的菜单。LCD软件层次图如下所示:
LCD层次图
- 数据结构
LCD显示结构体:
typedef struct
{
uint8 aContent[CONTENT_LEN]; /* display content */
uint8 nLen; /* content length */
uint8 columST; /* the start address in column direction (0--154) */
uint8 lineST; /* the start address in line direction (0--152) */
uint8 size; /* the size of word (16 or 12) */
uint8 type; /* the display type (0: in new screen other:in old screen) */
} lcd_word_t;
typedef struct
{
uint8 aItem[MAX_MENU_ITEMS][MAX_SHOW_LEN + 1];
uint8 nItemNum;
uint8 nCurrAddr;
uint8 nLastAddr;
uint8 nInvertAddr; /* means in one screen (1 -- MAX_ITEMS_SCRN) */
uint8 nMoveFlag; /* whether the Item has moved */
uint8 nSiz