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

📄 transponder_afe.html

📁 PKE(被动无钥门禁系统
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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="Transponder_AFE";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

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


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

<P>
	This class provides access to the Analog Front End.
<P>

<P>
<HR>

<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="Transponder_AFE.html#AFE.LoadCfg">AFE.LoadCfg</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function loads the default configuration from the EEPROM and stores it in the RAM.</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="Transponder_AFE.html#AFE.SafeCfg">AFE.SafeCfg</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function saves the configuration from the RAM into the EEPROM.</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="Transponder_AFE.html#AFE.WriteRegister">AFE.WriteRegister</A></B>(&nbsp;w&nbsp;&nbsp;AFE.ConfMap[x]&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function writes to one register file in the AFE.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;w&nbsp;&nbsp;AFE.ConfMap[x]&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Transponder_AFE.html#AFE.ReadRegister">AFE.ReadRegister</A></B>(&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function reads one register file in the AFE.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;w&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Transponder_AFE.html#AFE.WriteNVerifyRegister">AFE.WriteNVerifyRegister</A></B>(&nbsp;w&nbsp;&nbsp;AFE.ConfMap[x]&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function writes and verifies one register file in the AFE.</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="Transponder_AFE.html#AFE.WriteCfg">AFE.WriteCfg</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function writes and verifies the whole register map in the RAM to the AFE.</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="Transponder_AFE.html#AFE.ReadCfg">AFE.ReadCfg</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This function reads the whole register map from the AFE to the RAM.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;w&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Transponder_AFE.html#AFE.CalcParity">AFE.CalcParity</A></B>(&nbsp;w&nbsp;)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This calculates the odd parity of a Byte.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;w&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Transponder_AFE.html#AFE.CalcColumnParity">AFE.CalcColumnParity</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	This calculates the odd column parity of the configuration register.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_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>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="AFE.LoadCfg"></A><H3>
AFE.LoadCfg</H3>
<PRE>
&nbsp;<B>AFE.LoadCfg</B>()</PRE>
<P>
<DL>
<DD>	This function loads the default configuration from the EEPROM and stores it in the RAM.
<P>
<P>
<DD><DL>
<DT><B>Used SFRs:</B><DD>FSR     , EEADR, EEDATA, EECON1 </DD></DL>
</DD>
<DD><DL>
<DT><B>Calls subroutines:</B><PRE>	EEPROM.ReadBytes
</PRE>
</DD></DL>
<DD><DL>
<DT><B>Stacklevel:</B><DD>1</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Tested</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">AFE.LoadCfg&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD> Now the configuration(RAM) has been reatored from the Backup in your data EEPROM</DD></DL>
</DD>
</DL>
<HR>
<A NAME="AFE.SafeCfg"></A><H3>
AFE.SafeCfg</H3>
<PRE>
&nbsp;<B>AFE.SafeCfg</B>()</PRE>
<P>
<DL>
<DD>	This function saves the configuration from the RAM into the EEPROM.
<P>
<P>
<DD><DL>
<DT><B>Used SFRs:</B><DD>EECON1 FSR     , EEDATA, EEADR, ,  </DD></DL>
</DD>
<DD><DL>
<DT><B>Calls subroutines:</B><PRE>	EEPROM.WriteBytes
</PRE>
</DD></DL>
<DD><DL>
<DT><B>Stacklevel:</B><DD>2</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Written</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">AFE.SafeCfg&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD> Now you have a copy of the configuration(RAM) in the data EEPROM of your device</DD></DL>
</DD>
</DL>
<HR>
<A NAME="AFE.WriteRegister"></A><H3>
AFE.WriteRegister</H3>
<PRE>
&nbsp;<B>AFE.WriteRegister</B>(&nbsp;w&nbsp;&nbsp;AFE.ConfMap[x]&nbsp;)</PRE>
<P>
<DL>
<DD>	This function writes to one register file in the AFE.	The row parity will be calculated internally.	The column parity will be written to the configuration map in RAM.	NOT to the device.
<P>
<DD><DL>
<DT><B>Parameters:</B>
<DD><CODE>w</CODE> - The AFE-Register to write </DD>
<DD><CODE>AFE.ConfMap[x]</CODE> - The value that should be written to the AFE-Register </DD>
</DL></DD>
<P>
<DD><DL>
<DT><B>Used SFRs:</B><DD>	FSR      </DD></DL>
</DD>
<DD><DL>
<DT><B>Calls subroutines:</B><PRE>	AFE.CalcParity	SPI.Write
</PRE>
</DD></DL>
<DD><DL>
<DT><B>Stacklevel:</B><DD>2</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Tested</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">0xff&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#22AAAA">;move value to AFE.Buffer&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF">banksel&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">AFE.ConfMap&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movwf&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">AFE.ConfMap+4&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">0x04&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#22AAAA">;move register address to w&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">AFE.WriteRegister&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#22AAAA">;writes the register&nbsp;</FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD>	This example sets the Sensitivity Conrol Bits of Channel X and Channel Y (Register 4)to the maximum.</DD></DL>
</DD>
</DL>
<HR>
<A NAME="AFE.ReadRegister"></A><H3>
AFE.ReadRegister</H3>
<PRE>
&nbsp;w&nbsp;&nbsp;AFE.ConfMap[x]&nbsp;&nbsp;<B>AFE.ReadRegister</B>(&nbsp;w&nbsp;)</PRE>
<P>
<DL>
<DD>	This function reads one register file in the AFE.
<P>
<DD><DL>
<DT><B>Parameters:</B>
<DD><CODE>w</CODE> - The address of the register to be read </DD>
</DL></DD>
<DD><DL>
<DT><B>Returns:</B>
<DD><CODE>w</CODE> - The value in the register (without parity) </DD>
<DD><CODE>	AFE.ConfMap[x]	Writes</CODE> - the value to the configuration map in RAM </DD>
</DL></DD>
<P>
<DD><DL>
<DT><B>Used SFRs:</B><DD>	FSR   </DD></DL>
</DD>
<DD><DL>
<DT><B>Calls subroutines:</B><PRE>	SPI.Read
</PRE>
</DD></DL>
<DD><DL>
<DT><B>Stacklevel:</B><DD>2</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Tested</DD></DL>
</DD>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>movlw&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">0x04&nbsp;</FONT></CODE></TD>	<TD><CODE><FONT COLOR="#22AAAA">;load address of AFE register to w&nbsp;</FONT></CODE></TD></TR><TR>	<TD><CODE>&nbsp;</CODE></TD>	<TD><CODE><FONT COLOR="#0000FF"><B>call&nbsp;</B></FONT></CODE></TD>	<TD><CODE><FONT COLOR="#AA22AA">AFE.ReadRegister&nbsp;</FONT></CODE></TD>

⌨️ 快捷键说明

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