⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p18_lcd.html

📁 PKE(被动无钥门禁系统
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by AsmDoc -->
<TITLE>
HTMLWriter
</TITLE>

<META NAME="keywords" CONTENT="HTMLWriter class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="P18_LCD";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ======== START OF CLASS DATA ======== -->
<H2>
Module P18_LCD</H2>
<HR>

<P>
	This modules implements the needed functions to interface with an LC-Display.	The Display needs to support 4-bit communication.	The Four data bits has to be connected to the upper nibble of any port.	The command lines may be distributed over all pins on all ports.
<P>

<P>
<HR>

<P>
<!-- =========== CONSTANT SUMMARY =========== -->

<A NAME="constant_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constant Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;PORTA</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.RS.Port">LCD.RS.Port</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.RS.Pin">LCD.RS.Pin</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;PORTA</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.RW.Port">LCD.RW.Port</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;1</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.RW.Pin">LCD.RW.Pin</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;PORTA</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.E.Port">LCD.E.Port</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;2</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.E.Pin">LCD.E.Pin</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;PORTD</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.DATA">LCD.DATA</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;.20000</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.T_PowerUp">LCD.T_PowerUp</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;.5000</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.T_Instruction">LCD.T_Instruction</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x01</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Clear_CMD">LCD.Clear_CMD</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x04</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.EntryMode_CMD">LCD.EntryMode_CMD</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x02</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.IncreaseCursor_BIT">LCD.IncreaseCursor_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x01</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.ShiftDisplay_BIT">LCD.ShiftDisplay_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x08</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Mode_CMD">LCD.Mode_CMD</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x04</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.DisplayOn_BIT">LCD.DisplayOn_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x02</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.CursorOn_BIT">LCD.CursorOn_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x01</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.BlinkingOn_BIT">LCD.BlinkingOn_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x10</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Shift_CMD">LCD.Shift_CMD</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x08</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.DisplayShift_BIT">LCD.DisplayShift_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x04</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.ShiftRight_BIT">LCD.ShiftRight_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x20</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Function_CMD">LCD.Function_CMD</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x10</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.EightBit_BIT">LCD.EightBit_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x08</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.TwoLines_BIT">LCD.TwoLines_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x04</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.X5Y10_BIT">LCD.X5Y10_BIT</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x80</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.SetCursor_CMD">LCD.SetCursor_CMD</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x00</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Line0_ADR">LCD.Line0_ADR</A></B></CODE>

<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;0x40</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Line1_ADR">LCD.Line1_ADR</A></B></CODE>

<BR>
</TD>
</TR>
</TABLE>
<P>
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Buffer.Line0">LCD.Buffer.Line0</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This is the off screen buffer for the first line of the LCD, it is 17 bytes long.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Buffer.Line1">LCD.Buffer.Line1</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This is the off screen buffer for the second line of the LCD, it is 17 bytes long.</TD>
</TR>
</TABLE>
<P>
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Function Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Init">LCD.Init</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function initializes the LCD.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.SendCMDNoBusy">LCD.SendCMDNoBusy</A></B>(&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function sends a command (4-bit mode) to the LCD without checking the LCDs BusyFlag.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.SendCMD">LCD.SendCMD</A></B>(&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function sends a command to the LCD.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.DrawChar">LCD.DrawChar</A></B>(&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function sends a char to the LCD at the current cursor position.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.DrawString">LCD.DrawString</A></B>(&nbsp;FSR2&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function sends a string to the LCD beginning at the current cursor position.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.DrawBuffer">LCD.DrawBuffer</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function draws the LCD.Buffer on the LCD.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.BUSY_CHECK">LCD.BUSY_CHECK</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function waits for the LCD module accepting further instructions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.SetLine0">LCD.SetLine0</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function set the cursor to the first line.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.SetLine1">LCD.SetLine1</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function set the cursor to the second line.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="P18_LCD.html#LCD.Clear">LCD.Clear</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function clears the LCD.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ CONSTANT DETAIL =========== -->

<A NAME="constant_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constant Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="LCD.RS.Port"></A><H3>
LCD.RS.Port</H3>
<DL>
<DD>	The port the RS-pin is connected to.	The RS-pin selects whether to write to the data memory or to execute an	instruction.<BR><BR>	You may override the default value by either defining the same constant	in your Project.inc file or by changing the default value in the module's	source.<BR><BR>Default value = PORTA
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="LCD.RS.Pin"></A><H3>
LCD.RS.Pin</H3>
<DL>
<DD>	The number of the pin, the RS-pin is connected to.	The RS-pin selects whether to write to the data memory or to execute an	instruction.<BR><BR>	You may override the default value by either defining the same constant	in your Project.inc file or by changing the default value in the module's	source.<BR><BR>Default value = 0
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="LCD.RW.Port"></A><H3>
LCD.RW.Port</H3>
<DL>
<DD>	The port the RW-pin is connected to.	The RS-pin selects whether to write or to read from the LCD.<BR><BR>	You may override the default value by either defining the same constant	in your Project.inc file or by changing the default value in the module's	source.<BR><BR>Default value = PORTA
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="LCD.RW.Pin"></A><H3>
LCD.RW.Pin</H3>
<DL>
<DD>	The port the RW-pin is connected to.	The RS-pin selects whether to write or to read from the LCD.<BR><BR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -