/*********************************************************************************** * @fn halLcdClear * * @brief Clear all lines on display * * @param none * * @return none */ void halLcdClear(void) { uint8 n; SET_DDRAM_ADDR(0x00); for (n = 0; n < (LCD_LINE_COUNT * LCD_LINE_LENGTH); n++) { lcdWrite(' '); } }
/************************************************************************************************** * @fn HalLcd_HW_Clear * * @brief Clear the HW LCD * * @param None * * @return None **************************************************************************************************/ void HalLcd_HW_Clear(void) { uint8 n; SET_DDRAM_ADDR(0x00); for (n = 0; n < (LCD_MAX_LINE_COUNT * LCD_MAX_LINE_LENGTH); n++) { HalLcd_HW_Write(' '); } }
/************************************************************************************************** * @fn HalLcd_HW_WriteChar * * @brief Write one char to the display * * @param uint8 line - line number that the char will be displayed * uint8 col - colum where the char will be displayed * * @return None **************************************************************************************************/ void HalLcd_HW_WriteChar(uint8 line, uint8 col, char text) { if (col < LCD_MAX_LINE_LENGTH) { SET_DDRAM_ADDR((line - 1) * LCD_MAX_LINE_LENGTH + col); HalLcd_HW_Write(text); } else { return; } }
/************************************************************************************************** * @fn HalLcd_HW_WriteChar * * @brief Write one char to the display * * @param uint8 line - line number that the char will be displayed * uint8 col - colum where the char will be displayed * * @return None **************************************************************************************************/ void HalLcd_HW_WriteChar(uint8 line, uint8 col, char text) { if (col < HAL_LCD_MAX_CHARS) { SET_DDRAM_ADDR((line - 1) * HAL_LCD_MAX_CHARS + col); HalLcd_HW_Write(text); } else { return; } }
/************************************************************************************************** * @fn HalLcd_HW_Clear * * @brief Clear the HW LCD * * @param None * * @return None **************************************************************************************************/ void HalLcd_HW_Clear(void) { uint8 i,j; for (i = 0; i < 8; i++) { for (j = 0; j < 132; j++) { SET_DDRAM_ADDR(j,i); HalLcd_HW_Write(0); } } }
/************************************************************************************************** * @fn HalLcd_HW_WriteChar * * @brief Write one char to the display * * @param uint8 line - line number that the char will be displayed * uint8 col - colum where the char will be displayed * * @return None **************************************************************************************************/ void HalLcd_HW_WriteChar(uint8 line, uint8 col, char text) { uint8 j; uint16 addr; uint8 cvt_result; if (col < LCD_MAX_LINE_LENGTH && line <= HAL_LCD_LINE_4) { //write first line SET_DDRAM_ADDR(col * 8, (line - 1) * 2); addr = (text - 0x20)*12; for (j = 0; j < 8; j++) { cvt_result = HalLcd_Convert_DZK(j,addr); cvt_result = cvt_result << 2; HalLcd_HW_Write(cvt_result); } //write second line SET_DDRAM_ADDR(col * 8, (line - 1) * 2 + 1); addr = addr + 6; for (j = 0; j < 8; j++) { cvt_result = HalLcd_Convert_DZK(j,addr); HalLcd_HW_Write(cvt_result); } } else { return; } }
/*********************************************************************************** * @fn halLcdWriteChar * * @brief Write single character * * @param uint8 line - display line * uint8 col - column * char text - character to display * * @return none */ void halLcdWriteChar(uint8 line, uint8 col, char text) { SET_DDRAM_ADDR((line - 1) * LCD_LINE_LENGTH + col); lcdWrite(text); }
/*********************************************************************************** * @fn lcdWriteLine * * @brief Write line on display * * @param uint8 line - display line * char *pText - text buffer to write * * @return none */ static void lcdWriteLine(uint8 line, const char XDATA *pText) { SET_DDRAM_ADDR((line - 1) * LCD_LINE_LENGTH); lcdWriteMany(pText, LCD_LINE_LENGTH); }
/*********************************************************************************** * @fn halLcdWriteSpecChar * * @brief Write special character * * @param uint8 line - display line * uint8 col - column * uint8 index - index of spec character * * @return none */ void halLcdWriteSpecChar(uint8 line, uint8 col, uint8 index) { SET_DDRAM_ADDR((line - 1) * LCD_LINE_LENGTH + col); lcdWrite(index); }