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

📄 cpcore_h.html

📁 Controller Area Network Programming Interface Environment Ver0.8。 CanPie版本0.8. CAN总线通讯编程接口源代码。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ubChannelV</em>&nbsp;</td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>id</em>&nbsp;</td><td>value of the identifier </td></tr><tr><td valign=top><em>enable</em>&nbsp;</td><td>TRUE for accepting an identifier, FALSE for rejecting an identifier<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. Possible return values are: <ul> <li>CpErr_NOT_SUPPORTED - Function is not supported by the driver <li>CpErr_OK - Function returned without error condition </ul><p></dl>This function sets a filter for CAN messages. If the flag <b>enable</b> is set to TRUE, the CAN identifier <b>id</b> is accepted. If the flag <b>enable</b> is set to FALSE, the reception of messages with the identifier <b>id</b> is not possible. Please notice that this function only works for standard messages (2.0A, 11 bit identifier).     </td>  </tr></table><a name="a11" doxytag="cpcore.h::CpCoreHDI"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td nowrap valign="top"><b> Cp_EXPORT _U08 Cp_PREFIX CpCoreHDI (          </b></td>          <td valign="bottom"><b>_U08 <em>ubChannelV</em>,           </b></td>        </tr>        <tr>          <td></td>          <td><b><a class="el" href="struct_CpStruct_HDI.html">CpStruct_HDI</a> * <em>hdi</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get hardware description information.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ubChannelV</em>&nbsp;</td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>hdi</em>&nbsp;</td><td>Pointer to the Hardware Description Interface structure (<a class="el" href="struct_CpStruct_HDI.html">CpStruct_HDI</a>)<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>This function retrieves information about the used hardware.     </td>  </tr></table><a name="a12" doxytag="cpcore.h::CpCoreInitDriver"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td nowrap valign="top"><b> Cp_EXPORT _U08 Cp_PREFIX CpCoreInitDriver (          </b></td>          <td valign="bottom"><b>_U08 <em>ubChannelV</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Initialize the CAN driver.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ubChannelV</em>&nbsp;</td><td>CAN channel of the hardware<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. Possible return values are: <ul> <li>CpErr_HARDWARE - Hardware failure occured, initialisation is not possible <li>CpErr_INIT_FAIL - Software failure occured, initialisation is not possible <li>CpErr_OK - Function returned without error condition </ul><p></dl>The implementation of this function is dependant on the operating system. Typical tasks might be: <ul> <li>open a path/file to the hardware <li>install an interrupt vector </ul>     </td>  </tr></table><a name="a13" doxytag="cpcore.h::CpCoreIntHandler"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td nowrap valign="top"><b> void CpCoreIntHandler (          </b></td>          <td valign="bottom"><b>void&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>CAN Interrupt Request (IRQ) Handler.<p><p> The CAN IRQ Handler is responsible for calling core functions and sending signals (events) to the application whenever an interrupt signal of the CAN controller occurs. This function is not intended to be used by the application program. <b> Do not call this function by the application program. The implementation of this function is system dependend. </b>     </td>  </tr></table><a name="a14" doxytag="cpcore.h::CpCoreMsgReceive"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td nowrap valign="top"><b> Cp_EXPORT _U08 Cp_PREFIX CpCoreMsgReceive (          </b></td>          <td valign="bottom"><b>_U08 <em>ubChannelV</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Read a CAN message from controller.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ubChannelV</em>&nbsp;</td><td>CAN channel of the hardware<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>This function reads the receive buffer of a CAN controller and builds a CAN message from that information. The function is also responsible to generate the time stamp for the CAN message. The complete CAN message is then transferred to the Receive FIFO. <b> Do not call this function by the application program. The implementation of this function is system dependent. </b>     </td>  </tr></table><a name="a15" doxytag="cpcore.h::CpCoreMsgTransmit"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td nowrap valign="top"><b> Cp_EXPORT _U08 Cp_PREFIX CpCoreMsgTransmit (          </b></td>          <td valign="bottom"><b>_U08 <em>ubChannelV</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Transmit a CAN message.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ubChannelV</em>&nbsp;</td><td>CAN channel of the hardware<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>This function gets the next CAN message out of the Transmit FIFO and writes it to the appropriate registers of the CAN controller. <b> Do not call this function by the application program. The implementation of this function is system dependent. </b>     </td>  </tr></table><a name="a16" doxytag="cpcore.h::CpCoreRegRead"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td nowrap valign="top"><b> Cp_EXPORT _U08 Cp_PREFIX CpCoreRegRead (          </b></td>          <td valign="bottom"><b>_U08 <em>ubChannelV</em>,           </b></td>        </tr>        <tr>          <td></td>          <td><b>_U16 <em>regAdr</em>,           </b></td>        </tr>        <tr>          <td></td>          <td><b>_U08 * <em>valuePtr</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Read from CAN controller register.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ubChannelV</em>&nbsp;</td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>regAdr</em>&nbsp;</td><td>Register address relative to the base address of the CAN controller. </td></tr><tr><td valign=top><em>valuePtr</em>&nbsp;</td><td>Pointer to a variable of type BYTE, which will hold the result of the read process<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. Possible return values are: <ul> <li>CpErr_CHANNEL - Channel number is out of range <li>CpErr_REGISTER - Register address is out of range <li>CpErr_SUPPORTED - Function is not supported <li>CpErr_OK - Function returned without error condition </ul><p></dl>This function will read a value from a CAN controller register. The first register starts at address 0.     </td>  </tr></table><a name="a17" doxytag="cpcore.h::CpCoreRegWrite"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td nowrap valign="top"><b> Cp_EXPORT _U08 Cp_PREFIX CpCoreRegWrite (          </b></td>          <td valign="bottom"><b>_U08 <em>ubChannelV</em>,           </b></td>        </tr>        <tr>          <td></td>          <td><b>_U16 <em>regAdr</em>,           </b></td>        </tr>        <tr>          <td></td>          <td><b>_U08 <em>value</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Write to CAN controller register.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ubChannelV</em>&nbsp;</td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>regAdr</em>&nbsp;</td><td>Register address relative to the base address of the CAN controller. </td></tr><tr><td valign=top><em>value</em>&nbsp;</td><td>Value to write<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. Possible return values are: <ul> <li>CpErr_CHANNEL - Channel number is out of range <li>CpErr_REGISTER - Register address is out of range <li>CpErr_SUPPORTED - Function is not supported <li>CpErr_OK - Function returned without error condition </ul><p></dl>This function will write a value to a CAN controller register. The first register starts at address 0.     </td>  </tr></table></td></tr></table><!------ Document footer -------------------------------------------><p><br><map name="FooterMap"><area shape=rect coords="  1, 1, 100, 20" href="#PageTop"><area shape=rect coords="400, 1, 500, 20" href="mailto:koppe@microcontrol.net?Subject=CANpie"></map><table width="600" border="0" bgcolor="#FFFFFF" cellspacing="0"><tr><td><IMG src="pictures/mapfoot.gif" border="0" usemap="#FooterMap"></td></tr><!------ print modification date -----------------------------------><tr><td align="right"><h4>Last modified: 10 Jul 2001</h4></td></tr></table>	</body></html>

⌨️ 快捷键说明

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