Files
MicrochipFor32/Doc/latex/bsp___mod_bus_8cpp_source.tex

294 lines
54 KiB
TeX
Raw Normal View History

\hypertarget{bsp___mod_bus_8cpp_source}{}\doxysection{bsp\+\_\+\+Mod\+Bus.\+cpp}
\label{bsp___mod_bus_8cpp_source}\index{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_ModBus.cpp@{D:/gitt/MicrochipFor32/bsp\_Device/bsp\_ModBus.cpp}}
\mbox{\hyperlink{bsp___mod_bus_8cpp}{浏览该文件的文档.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00001}00001 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00002}00002 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00003}00003 \textcolor{comment}{ \# Copyright (c) 2022 Yuankang Liang(XerolySkinner)}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00004}00004 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00005}00005 \textcolor{comment}{ \# 本软件按原样提供,无任何明示或暗示}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00006}00006 \textcolor{comment}{ \# 在任何情况下,作者都不承担任何损害赔偿责任}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00007}00007 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00008}00008 \textcolor{comment}{ \# 使用的许可声明:}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00009}00009 \textcolor{comment}{ \# 1. 不得歪曲本软件的来源,你不能声称你编写了原始软件.}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00010}00010 \textcolor{comment}{ \# 2. 免费授予以任何目的,前提是版权声明出现在所有副本中.}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00011}00011 \textcolor{comment}{ \# 并且版权声明和许可声明同时出现.}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00012}00012 \textcolor{comment}{ \# 3. 你有使用,复制,修改,分发,和销售本软件的许可.}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00013}00013 \textcolor{comment}{ \# 4. 如果你在产品中使用,产品文档中的声明是赞赏的但不是必须的.}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00014}00014 \textcolor{comment}{ \# 5. 本通知不得从任何来源删除或更改.}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00015}00015 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00016}00016 \textcolor{comment}{ \# Yuankang Liang(XerolySkinner)}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00017}00017 \textcolor{comment}{ \# E-\/mail:zabbcccbbaz@163.com}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00018}00018 \textcolor{comment}{ \# QQ:2715099320}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00019}00019 \textcolor{comment}{ \# Mobile Phone:13005636215}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00020}00020 \textcolor{comment}{ \#}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00021}00021 \textcolor{comment}{ \# All rights reserved.}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00022}00022 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00023}00023 }
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00033}00033 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00035}00035 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00036}00036 \textcolor{comment}{// 头文件}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{bsp___mod_bus_8h}{bsp\_ModBus.h}}"{}}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00038}00038 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{bsp___c_r_c_8h}{bsp\_CRC.h}}"{}}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00039}00039 \textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00040}00040 \textcolor{preprocessor}{\#include <stdlib.h>}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00042}00042 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00043}00043 \textcolor{comment}{// 类函数}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00050}\mbox{\hyperlink{classbsp___mod_bus___tx_ada605c0e9195aefd43968cfe5b347565}{00050}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_ada605c0e9195aefd43968cfe5b347565}{bsp\_ModBus\_Tx::ReadKeepReg}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00051}00051 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat[8];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00052}00052 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00053}00053 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00054}00054 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a9ec5f1febebcade07d80148f67d51594}{Fun\_R\_KeepReg}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00055}00055 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00056}00056 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00057}00057 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00058}00058 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00059}00059 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, 6);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00060}00060 dat[6] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00061}00061 dat[7] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00062}00062 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat,8);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00063}00063 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00070}\mbox{\hyperlink{classbsp___mod_bus___tx_af055e2569107b8ece7abdce3301e9444}{00070}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_af055e2569107b8ece7abdce3301e9444}{bsp\_ModBus\_Tx::ReadInReg}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00071}00071 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat[8];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00072}00072 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00073}00073 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00074}00074 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643ab285b7d7c40fa9a85adba60a3a769fca}{Fun\_R\_InReg}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00075}00075 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00076}00076 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00077}00077 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00078}00078 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00079}00079 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat,6);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00080}00080 dat[6] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00081}00081 dat[7] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00082}00082 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, 8);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00083}00083 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00090}\mbox{\hyperlink{classbsp___mod_bus___tx_a02ea1680f5c361f2cf4ebcb48b565281}{00090}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_a02ea1680f5c361f2cf4ebcb48b565281}{bsp\_ModBus\_Tx::WriteOneReg}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} var) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00091}00091 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat[8];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00092}00092 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00093}00093 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00094}00094 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a2e8689560573f300af3a6c48fdd6ce86}{Fun\_W\_OneReg}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00095}00095 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00096}00096 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00097}00097 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&var))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00098}00098 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&var))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00099}00099 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, 6);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00100}00100 dat[6] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00101}00101 dat[7] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00102}00102 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, 8);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00103}00103 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00112}\mbox{\hyperlink{classbsp___mod_bus___tx_a268c136782f8146662f33878522c270c}{00112}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_a268c136782f8146662f33878522c270c}{bsp\_ModBus\_Tx::WriteRegs}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address,\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem,\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}}* var) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00113}00113 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} bytes = 9 + mem * 2;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00114}00114 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}* dat = (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)malloc(bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00115}00115 \textcolor{keywordflow}{if} (dat == NULL)\textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00116}00116 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00117}00117 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00118}00118 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a54562faaab8c1c932c46c6c4cb2552f9}{Fun\_W\_Regs}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00119}00119 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00120}00120 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00121}00121 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00122}00122 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00123}00123 dat[6] = mem*2;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00124}00124 \textcolor{comment}{// 填入数据}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00125}00125 \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i = 0; i < mem; i++)\{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00126}00126 dat[7 + i*2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)var)[1+i*2];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00127}00127 dat[8 + i*2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)var)[0+i*2];\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00128}00128 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, bytes -\/ 2);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00129}00129 dat[bytes -\/ 2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00130}00130 dat[bytes -\/ 1] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00131}00131 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00132}00132 free(dat);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00133}00133 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00142}\mbox{\hyperlink{classbsp___mod_bus___tx_acc267977d61716e25fd3e3ec57bc2960}{00142}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_acc267977d61716e25fd3e3ec57bc2960}{bsp\_ModBus\_Tx::WriteRegsVar}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem,...) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00143}00143 va\_list table;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00144}00144 va\_start(table,mem);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00145}00145 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} vars;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00146}00146 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} bytes = 9 + mem * 2;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00147}00147 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}* dat = (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)malloc(bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00148}00148 \textcolor{keywordflow}{if} (dat == NULL)\textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00149}00149 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00150}00150 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00151}00151 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a54562faaab8c1c932c46c6c4cb2552f9}{Fun\_W\_Regs}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00152}00152 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00153}00153 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00154}00154 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00155}00155 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00156}00156 dat[6] = mem*2;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00157}00157 \textcolor{comment}{// 填入数据}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00158}00158 \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i = 0; i < mem; i++)\{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00159}00159 vars=va\_arg(table, \mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00160}00160 dat[7 + i*2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&vars))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00161}00161 dat[8 + i*2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&vars))[0];\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00162}00162 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, bytes -\/ 2);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00163}00163 dat[bytes -\/ 2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00164}00164 dat[bytes -\/ 1] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00165}00165 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00166}00166 free(dat);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00167}00167 va\_end(table);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00168}00168 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00175}\mbox{\hyperlink{classbsp___mod_bus___tx_abc721f5c61e236df505f3447818be921}{00175}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_abc721f5c61e236df505f3447818be921}{bsp\_ModBus\_Tx::ReadOutCoil}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00176}00176 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat[8];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00177}00177 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00178}00178 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00179}00179 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643afa0834864982fdb57c9a954bdbd1599b}{Fun\_R\_OutCoil}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00180}00180 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00181}00181 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00182}00182 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00183}00183 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00184}00184 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, 6);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00185}00185 dat[6] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00186}00186 dat[7] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00187}00187 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, 8);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00188}00188 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00195}\mbox{\hyperlink{classbsp___mod_bus___tx_a76e712e8d638ecc7b453e1c8afbbad98}{00195}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_a76e712e8d638ecc7b453e1c8afbbad98}{bsp\_ModBus\_Tx::ReadInCoil}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00196}00196 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat[8];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00197}00197 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00198}00198 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00199}00199 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a8c70d4d5036c1a3f9c51a545d13fdd92}{Fun\_R\_InCoil}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00200}00200 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00201}00201 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00202}00202 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00203}00203 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00204}00204 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, 6);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00205}00205 dat[6] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00206}00206 dat[7] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00207}00207 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, 8);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00208}00208 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00217}\mbox{\hyperlink{classbsp___mod_bus___tx_aa8d37cc0cefaad8f41bc1d195a326d95}{00217}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_aa8d37cc0cefaad8f41bc1d195a326d95}{bsp\_ModBus\_Tx::WriteOneCoil}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} state)\{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00218}00218 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} dat[8];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00219}00219 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} var = state ? 0xFF00 : 0x0000;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00220}00220 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00221}00221 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00222}00222 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a95bb48bd2de82de8a2f5684a6cccff0f}{Fun\_W\_OneCoil}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00223}00223 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00224}00224 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00225}00225 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&var))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00226}00226 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&var))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00227}00227 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, 6);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00228}00228 dat[6] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00229}00229 dat[7] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00230}00230 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, 8);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00231}00231 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00240}\mbox{\hyperlink{classbsp___mod_bus___tx_a630ac7566fe9d1773baa813802202d0f}{00240}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_a630ac7566fe9d1773baa813802202d0f}{bsp\_ModBus\_Tx::WriteCoils}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem, \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}* var) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00241}00241 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} bytes = (mem / 8) + (mem \% 8 != 0) + 9;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00242}00242 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}* dat = (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)malloc(bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00243}00243 \textcolor{keywordflow}{if} (dat == NULL)\textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00244}00244 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00245}00245 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00246}00246 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a0a40a9622af4e5cb7daecbdb303ee35e}{Fun\_W\_Coils}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00247}00247 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00248}00248 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00249}00249 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00250}00250 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00251}00251 dat[6] = bytes -\/ 9;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00252}00252 \textcolor{comment}{// 填入数据}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00253}00253 \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i = 0; i < bytes -\/ 9; i++)dat[7 + i] = var[i];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00254}00254 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, bytes -\/ 2);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00255}00255 dat[bytes -\/ 2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00256}00256 dat[bytes -\/ 1] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00257}00257 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00258}00258 free(dat);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00259}00259 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00268}\mbox{\hyperlink{classbsp___mod_bus___tx_a280c5d7c99196a11b5fee7b34421a8ff}{00268}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___tx_a280c5d7c99196a11b5fee7b34421a8ff}{bsp\_ModBus\_Tx::WriteCoilsVar}}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} address, \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} mem,...) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00269}00269 va\_list table;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00270}00270 va\_start(table,mem);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00271}00271 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} var=0;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00272}00272 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00273}00273 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} bytes = (mem / 8) + (mem \% 8 != 0) + 9;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00274}00274 \mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}* dat = (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)malloc(bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00275}00275 \textcolor{keywordflow}{if} (dat == NULL)\textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00276}00276 dat[0] = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00277}00277 dat[1] = \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a0a40a9622af4e5cb7daecbdb303ee35e}{Fun\_W\_Coils}};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00278}00278 dat[2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00279}00279 dat[3] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&address))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00280}00280 dat[4] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00281}00281 dat[5] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&mem))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00282}00282 dat[6] = bytes -\/ 9;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00283}00283 \textcolor{comment}{// 填入管脚信息}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00284}00284 \textcolor{keywordflow}{for}(\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} i=0;i<mem;i++)\{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00285}00285 var=va\_arg(table,\mbox{\hyperlink{varint_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00286}00286 \textcolor{keywordflow}{if}(var)}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00287}00287 dat[7 + (i/8)]|=1<<(i\%8);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00288}00288 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00289}00289 dat[7 + (i/8)]\&=\string~(1<<(i\%8));\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00290}00290 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, bytes -\/ 2);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00291}00291 dat[bytes -\/ 2] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00292}00292 dat[bytes -\/ 1] = ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00293}00293 \mbox{\hyperlink{classbsp___mod_bus___tx_ac017f6145ba6f87c69a16510f868dcc2}{Transmit}}(dat, bytes);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00294}00294 free(dat);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00295}00295 va\_end(table);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00297}00297 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00298}00298 \textcolor{comment}{// 类函数}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00304}\mbox{\hyperlink{classbsp___mod_bus___rx_a39330845d4ced51850b9edaaab052e0f}{00304}} \textcolor{comment}{}\textcolor{keywordtype}{void} \mbox{\hyperlink{classbsp___mod_bus___rx_a39330845d4ced51850b9edaaab052e0f}{bsp\_ModBus\_Rx::analysis}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}* dat) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00305}00305 \mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}} crc = 0;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00306}00306 \mbox{\hyperlink{classbsp___mod_bus___rx_a045cc9c5f9d26ad5be1da2d2cfdcbefc}{ID}} = dat[0];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00307}00307 \mbox{\hyperlink{classbsp___mod_bus___rx_a0a5cdc492b09b33ae665706c9968e5d5}{Func}} = dat[1];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00308}00308 \textcolor{comment}{// 释放缓存内存}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00309}00309 free(\mbox{\hyperlink{classbsp___mod_bus___rx_a6612d15d148b4944662851bd8fabae04}{OutCoilDat}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00310}00310 free(\mbox{\hyperlink{classbsp___mod_bus___rx_a8ca97f2e7b033faddbb1772f15d91d4d}{InCoilDat}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00311}00311 free(\mbox{\hyperlink{classbsp___mod_bus___rx_a091cc0733eb4aa6b06c10afdbfd46b7f}{KeepRegDat}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00312}00312 free(\mbox{\hyperlink{classbsp___mod_bus___rx_ab275dbfa83dd90eff0cbf0411dfe8e4a}{InRegDat}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00313}00313 \textcolor{comment}{// CRC检验}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00314}00314 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classbsp___mod_bus___rx_a0a5cdc492b09b33ae665706c9968e5d5}{Func}} == \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643afa0834864982fdb57c9a954bdbd1599b}{Fun\_R\_OutCoil}} ||}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00315}00315 \mbox{\hyperlink{classbsp___mod_bus___rx_a0a5cdc492b09b33ae665706c9968e5d5}{Func}} == \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a8c70d4d5036c1a3f9c51a545d13fdd92}{Fun\_R\_InCoil}} ||}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00316}00316 \mbox{\hyperlink{classbsp___mod_bus___rx_a0a5cdc492b09b33ae665706c9968e5d5}{Func}} == \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a9ec5f1febebcade07d80148f67d51594}{Fun\_R\_KeepReg}} ||}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00317}00317 \mbox{\hyperlink{classbsp___mod_bus___rx_a0a5cdc492b09b33ae665706c9968e5d5}{Func}} == \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643ab285b7d7c40fa9a85adba60a3a769fca}{Fun\_R\_InReg}}) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00318}00318 crc = \mbox{\hyperlink{bsp___c_r_c_8cpp_abb1fda5ed561362d12fe987758986919}{CRC16\_MODBUS}}(dat, dat[2] + 3);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00319}00319 \mbox{\hyperlink{classbsp___mod_bus___rx_ac1a35ae91223298913373de0d3e7c02d}{crcts}} = ( ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[1] == dat[dat[2] + 3] \&\&}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00320}00320 ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)(\&crc))[0] == dat[dat[2] + 4]);\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00321}00321 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{classbsp___mod_bus___rx_a0a5cdc492b09b33ae665706c9968e5d5}{Func}}) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00322}00322 \textcolor{keywordflow}{case} \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643afa0834864982fdb57c9a954bdbd1599b}{Fun\_R\_OutCoil}}:}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00323}00323 \textcolor{comment}{// 输出线圈}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00324}00324 \mbox{\hyperlink{classbsp___mod_bus___rx_a062f82edfe722d8cb783b67a5a085bee}{OutCoilMem}} = dat[2];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00325}00325 \mbox{\hyperlink{classbsp___mod_bus___rx_a6612d15d148b4944662851bd8fabae04}{OutCoilDat}} = (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)malloc(\mbox{\hyperlink{classbsp___mod_bus___rx_a062f82edfe722d8cb783b67a5a085bee}{OutCoilMem}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00326}00326 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classbsp___mod_bus___rx_a6612d15d148b4944662851bd8fabae04}{OutCoilDat}} == NULL)\textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00327}00327 \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i = 0; i < \mbox{\hyperlink{classbsp___mod_bus___rx_a062f82edfe722d8cb783b67a5a085bee}{OutCoilMem}}; i++)}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00328}00328 \mbox{\hyperlink{classbsp___mod_bus___rx_a6612d15d148b4944662851bd8fabae04}{OutCoilDat}}[i] = dat[3 + i];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00329}00329 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00330}00330 \textcolor{keywordflow}{case} \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a8c70d4d5036c1a3f9c51a545d13fdd92}{Fun\_R\_InCoil}}:}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00331}00331 \textcolor{comment}{// 输入线圈}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00332}00332 \mbox{\hyperlink{classbsp___mod_bus___rx_a22f49f0782c4580b0f582c27fbd758a3}{InCoilMem}} = dat[2];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00333}00333 \mbox{\hyperlink{classbsp___mod_bus___rx_a8ca97f2e7b033faddbb1772f15d91d4d}{InCoilDat}} = (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)malloc(\mbox{\hyperlink{classbsp___mod_bus___rx_a22f49f0782c4580b0f582c27fbd758a3}{InCoilMem}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00334}00334 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classbsp___mod_bus___rx_a8ca97f2e7b033faddbb1772f15d91d4d}{InCoilDat}} == NULL)\textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00335}00335 \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i = 0; i < \mbox{\hyperlink{classbsp___mod_bus___rx_a22f49f0782c4580b0f582c27fbd758a3}{InCoilMem}}; i++)}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00336}00336 \mbox{\hyperlink{classbsp___mod_bus___rx_a8ca97f2e7b033faddbb1772f15d91d4d}{InCoilDat}}[i] = dat[3 + i];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00337}00337 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00338}00338 \textcolor{keywordflow}{case} \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643a9ec5f1febebcade07d80148f67d51594}{Fun\_R\_KeepReg}}:}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00339}00339 \textcolor{comment}{// 保持寄存器}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00340}00340 \mbox{\hyperlink{classbsp___mod_bus___rx_a7622d0c8c56feb97d263f57115ef3f6a}{KeepRegMem}} = dat[2] / 2;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00341}00341 \mbox{\hyperlink{classbsp___mod_bus___rx_a091cc0733eb4aa6b06c10afdbfd46b7f}{KeepRegDat}} = (\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}}*)malloc(\mbox{\hyperlink{classbsp___mod_bus___rx_a7622d0c8c56feb97d263f57115ef3f6a}{KeepRegMem}} * 2);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00342}00342 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classbsp___mod_bus___rx_a091cc0733eb4aa6b06c10afdbfd46b7f}{KeepRegDat}} == NULL)\textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00343}00343 \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i = 0; i < \mbox{\hyperlink{classbsp___mod_bus___rx_a7622d0c8c56feb97d263f57115ef3f6a}{KeepRegMem}}; i++) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00344}00344 ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)\mbox{\hyperlink{classbsp___mod_bus___rx_a091cc0733eb4aa6b06c10afdbfd46b7f}{KeepRegDat}})[1 + i * 2] = dat[3 + i * 2];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00345}00345 ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)\mbox{\hyperlink{classbsp___mod_bus___rx_a091cc0733eb4aa6b06c10afdbfd46b7f}{KeepRegDat}})[0 + i * 2] = dat[4 + i * 2];\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00346}00346 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00347}00347 \textcolor{keywordflow}{case} \mbox{\hyperlink{bsp___mod_bus_8h_ac6d9f6c262df700be9045045502e7643ab285b7d7c40fa9a85adba60a3a769fca}{Fun\_R\_InReg}}:}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00348}00348 \textcolor{comment}{// 输入寄存器}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00349}00349 \mbox{\hyperlink{classbsp___mod_bus___rx_a37508047d184916eb7133a4ad8f10a6c}{InRegMem}} = dat[2] / 2;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00350}00350 \mbox{\hyperlink{classbsp___mod_bus___rx_ab275dbfa83dd90eff0cbf0411dfe8e4a}{InRegDat}} = (\mbox{\hyperlink{varint_8h_ace9d960e74685e2cd84b36132dbbf8aa}{u16}}*)malloc(\mbox{\hyperlink{classbsp___mod_bus___rx_a37508047d184916eb7133a4ad8f10a6c}{InRegMem}} * 2);}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00351}00351 \textcolor{keywordflow}{if} (\mbox{\hyperlink{classbsp___mod_bus___rx_ab275dbfa83dd90eff0cbf0411dfe8e4a}{InRegDat}} == NULL)\textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00352}00352 \textcolor{keywordflow}{for} (\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} i = 0; i < \mbox{\hyperlink{classbsp___mod_bus___rx_a37508047d184916eb7133a4ad8f10a6c}{InRegMem}}; i++) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00353}00353 ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)\mbox{\hyperlink{classbsp___mod_bus___rx_ab275dbfa83dd90eff0cbf0411dfe8e4a}{InRegDat}})[1 + i * 2] = dat[3 + i * 2];}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00354}00354 ((\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}}*)\mbox{\hyperlink{classbsp___mod_bus___rx_ab275dbfa83dd90eff0cbf0411dfe8e4a}{InRegDat}})[0 + i * 2] = dat[4 + i * 2];\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00355}00355 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00356}00356 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00357}00357 \textcolor{comment}{// 写回显与其他}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00358}00358 \textcolor{keywordflow}{break};\}\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00360}00360 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00361}00361 \textcolor{comment}{// 构造函数}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00362}\mbox{\hyperlink{classbsp___mod_bus___tx_ac277122ddb733aa37a0000086d5ae239}{00362}} \mbox{\hyperlink{classbsp___mod_bus___tx_ac277122ddb733aa37a0000086d5ae239}{bsp\_ModBus\_Tx::bsp\_ModBus\_Tx}}(\mbox{\hyperlink{varint_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} ID) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00363}00363 \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{bsp\_ModBus\_Tx::ID}} = \mbox{\hyperlink{classbsp___mod_bus___tx_a4ee454ddd116e2b608d9b35b02eee0e4}{ID}};\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00364}00364 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00365}\mbox{\hyperlink{classbsp___mod_bus___rx_a87e68578770301c3d78c9b7f551bb627}{00365}} \mbox{\hyperlink{classbsp___mod_bus___rx_a87e68578770301c3d78c9b7f551bb627}{bsp\_ModBus\_Rx::bsp\_ModBus\_Rx}}(\textcolor{keywordtype}{void}) \{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00366}00366 \mbox{\hyperlink{classbsp___mod_bus___rx_a091cc0733eb4aa6b06c10afdbfd46b7f}{KeepRegDat}} = NULL;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00367}00367 \mbox{\hyperlink{classbsp___mod_bus___rx_ab275dbfa83dd90eff0cbf0411dfe8e4a}{InRegDat}} = NULL;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00368}00368 \mbox{\hyperlink{classbsp___mod_bus___rx_a6612d15d148b4944662851bd8fabae04}{OutCoilDat}} = NULL;}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00369}00369 \mbox{\hyperlink{classbsp___mod_bus___rx_a8ca97f2e7b033faddbb1772f15d91d4d}{InCoilDat}} = NULL;\}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00370}00370 \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00371}\mbox{\hyperlink{classbsp___mod_bus___rx_afa1dac97034b51725349ab5b1a2aa909}{00371}} \mbox{\hyperlink{classbsp___mod_bus___rx_afa1dac97034b51725349ab5b1a2aa909}{bsp\_ModBus\_Rx::\string~bsp\_ModBus\_Rx}}(\textcolor{keywordtype}{void})\{}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00372}00372 free(\mbox{\hyperlink{classbsp___mod_bus___rx_a6612d15d148b4944662851bd8fabae04}{OutCoilDat}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00373}00373 free(\mbox{\hyperlink{classbsp___mod_bus___rx_a8ca97f2e7b033faddbb1772f15d91d4d}{InCoilDat}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00374}00374 free(\mbox{\hyperlink{classbsp___mod_bus___rx_a091cc0733eb4aa6b06c10afdbfd46b7f}{KeepRegDat}});}
\DoxyCodeLine{\Hypertarget{bsp___mod_bus_8cpp_source_l00375}00375 free(\mbox{\hyperlink{classbsp___mod_bus___rx_ab275dbfa83dd90eff0cbf0411dfe8e4a}{InRegDat}});\}}
\end{DoxyCode}