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

📄 igorusb_dll_help.htm

📁 单片机AT90S系列 制作简易USB接口(软件模拟,无usb硬件)。
💻 HTM
📖 第 1 页 / 共 3 页
字号:
in input direction<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then bit value 1 represent switched
on pull-up resistor and bit value 0 represent switched off pull-up resistor
(high&nbsp;impedance<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input) on input data pin.</p>
<p><u>Return values</u><b><br>
&nbsp;&nbsp;&nbsp; </b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000">&nbsp;&nbsp;&nbsp;</font></b></i> If the function
fails, the return value is <i>DEVICE_NOT_PRESENT</i> (device is disconnected).</p>
<p><u>Notes:</u><br>
&nbsp;&nbsp;&nbsp; The output values are not read from physical pins, but from
internal register (stored value). For reading true physical values<br>
&nbsp;&nbsp;&nbsp; on output data pins use function <b><a href="#DoGetInDataPort">DoGetInDataPort</a></b>.</p>
<hr>
<p><font color="#000080">
function</font> <b><a name="DoGetInDataPort">DoGetInDataPort</a></b>(<font color="#000080">var</font>
<font color="#800000"><i><b>DataInByte</b></i></font>:<font color="#000080"><b>byte</b></font>):<font color="#0000FF"><b>integer</b></font>;
<font color="#000080"> stdcall</font>;</p>
<p>&nbsp;&nbsp;&nbsp; Function reads state of microcontroller data pins (D0-D7).<br>
<u>Parameters</u><br>
&nbsp;&nbsp; <i>DataOutByte</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out] Byte which bits represents levels on data pins
(level on physical pins).</p>
<p><u>Return values</u><b><br>
&nbsp;&nbsp;&nbsp; </b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000">&nbsp;&nbsp;&nbsp;</font></b></i> If the function
fails, the return value is <i>DEVICE_NOT_PRESENT</i> (device is disconnected).</p>
<hr>
<p><font color="#000080">
function</font> <b><a name="DoEEPROMRead">DoEEPROMRead</a></b>(<font color="#800000"><i><b>Address</b></i></font>:<font color="#000080"><b>byte</b></font>;
<font color="#000080"> var</font> <font color="#800000"><i><b>DataInByte</b></i></font>:<font color="#000080"><b>byte</b></font>):<font color="#0000FF"><b>integer</b></font>;
<font color="#000080"> stdcall</font>;</p>
<p>&nbsp;&nbsp;&nbsp; Function reads byte from given address of microcontroller data EEPROM.<br>
<u>Parameters<br>
</u>&nbsp;&nbsp; <i>Address</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in] Byte which bits represents
address of internal EEPROM (valid address range: 0 to 127).<br>
&nbsp;&nbsp; <i>DataInByte</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out] Value from EEPROM.</p>
<p><u>Return values</u><b><br>
&nbsp;&nbsp;&nbsp; </b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000">&nbsp;&nbsp;&nbsp;</font></b></i> If the function
fails, the return value is <i>DEVICE_NOT_PRESENT</i> (device is disconnected).</p>
<hr>
<p><font color="#000080">
function</font> <b><a name="DoEEPROMWrite">DoEEPROMWrite</a></b>(<font color="#800000"><i><b>Address</b></i></font>:<font color="#000080"><b>byte</b></font>;
<font color="#800000"><i><b>DataOutByte</b></i></font>:<font color="#000080"><b>byte</b></font>):<font color="#0000FF"><b>integer</b></font>;
<font color="#000080"> stdcall</font>;</p>
<p><br>
&nbsp;&nbsp;&nbsp; Function writes byte to given address of microcontroller data
EEPROM.<br>
<u>Parameters<br>
</u>&nbsp;&nbsp; <i>Address</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in] Byte which bits represents
address of internal EEPROM (valid address range: 0 to 127).<br>
&nbsp;&nbsp; <i>DataOutByte</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in] New value to write to EEPROM.</p>
<p><u>Return values</u><b><br>
&nbsp;&nbsp;&nbsp; </b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000">&nbsp;&nbsp;&nbsp;</font></b></i> If the function
fails, the return value is <i>DEVICE_NOT_PRESENT</i> (device is disconnected).</p>
<p><u>Notes:<br>
</u>&nbsp;&nbsp;&nbsp; Function waits for storing byte to EEPROM (write time is
cca 4ms).</p>
<hr>
<p><font color="#000080">
function</font> <b><a name="DoRS232Send">DoRS232Send</a></b>(<font color="#800000"><i><b>DataOutByte</b></i></font>:<font color="#000080"><b>byte</b></font>):<font color="#0000FF"><b>integer</b></font>;
<font color="#000080"> stdcall</font>;</p>
<p>&nbsp;&nbsp;&nbsp; Function sends byte to microcontroller RS232 line at
current baudrate.<br>
<u>Parameters<br>
</u>&nbsp;&nbsp; <i>DataOutByte</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in] Value to send to microcontroller
RS232 line.</p>
<p><u>Return values</u><b><br>
&nbsp;&nbsp;&nbsp; </b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000">&nbsp;&nbsp;&nbsp;</font></b></i> If the function
fails, the return value is <i>DEVICE_NOT_PRESENT</i> (device is disconnected).</p>
<p><u>Notes:<br>
</u>&nbsp;&nbsp;&nbsp; Function waits for transmitting given byte: all data bits + stop
bit are transmitted before function end.</p>
<hr>
<p><font color="#000080">
function</font> <b><a name="DoRS232Read">DoRS232Read</a></b>(<font color="#000080">var</font>
<font color="#800000"><i><b>DataInByte</b></i></font>:<font color="#000080"><b>byte</b></font>):<font color="#0000FF"><b>integer</b></font>;
<font color="#000080"> stdcall</font>;</p>
<p>&nbsp;&nbsp;&nbsp; Function reads byte received by microcontroller RS232
line.<br>
<u>Parameters<br>
</u>&nbsp;&nbsp; <i>DataInByte</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out] Byte received from
microcontroller RS232 line.</p>
<p><u>Return values</u><b><br>
</b>&nbsp;&nbsp;&nbsp; The return values are:<br>
&nbsp;&nbsp;&nbsp; <i>NO_ERROR</i> - one byte received (returned in <i>DataInByte</i>)<br>
<i>&nbsp;&nbsp;&nbsp; NO_DATA_AVAILABLE - </i>no data was received (value <i>DataInByte</i>
is not valid)<br>
<i>&nbsp;&nbsp;&nbsp;</i> <i>OVERRUN_ERROR</i>&nbsp; - more bytes was received, but
another received bytes was lost: in <i>DataInByte</i>  is returned only the first received
byte<br>
<i>&nbsp;&nbsp;&nbsp;</i> <i>DEVICE_NOT_PRESENT -</i> error: device is
disconnected</p>
<hr>
<p><font color="#000080">
function</font> <b><a name="DoSetRS232Baud">DoSetRS232Baud</a></b>(<font color="#800000"><i><b>BaudRate</b></i></font>:<font color="#000080"><b>integer</b></font>):<font color="#0000FF"><b>integer</b></font>;
<font color="#000080"> stdcall</font>;</p>
<p>&nbsp;&nbsp;&nbsp; Function sets speed of microcontroller RS232 line.<br>
<u>Parameters<br>
</u>&nbsp;&nbsp; <i>BaudRate</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in] Required baudrate of
microcontroller RS232 line (in bps).</p>
<p><u>Return values</u><b><br>
</b>&nbsp;&nbsp;&nbsp; The return values are:<br>
&nbsp;&nbsp;&nbsp; <i>NO_ERROR</i> - baudrate was set (error between required
and set baudrate is less than 4%)<br>
<i>&nbsp;&nbsp;&nbsp; INVALID_BAUDRATE - </i>not supported baudrate - baudrate
was not set (error from required baudrate is more than 4%)<br>
<i>&nbsp;&nbsp;&nbsp;</i> <i>DEVICE_NOT_PRESENT -</i> error: device is
disconnected</p>
<p><u>Notes:</u><br>
&nbsp;&nbsp;&nbsp; Valid baudrates are cca from 2900 Baud to 780 000 Baud.<br>
&nbsp;&nbsp;&nbsp; Supported &quot;standard&quot; baudrates are 4800,
9600,19200,38400,57600.<br>
&nbsp;&nbsp;&nbsp; To know internal baudrate - use function <b><a href="#DoGetRS232Baud">DoGetRS232Baud</a></b>.<br>
&nbsp;&nbsp;&nbsp; After power on - the baudrate is set to 57600.</p>
<hr>
<p><font color="#000080">
function</font> <b><a name="DoGetRS232Baud">DoGetRS232Baud</a></b>(<font color="#000080">var</font>
<font color="#800000"><i><b>BaudRate</b></i></font>:<font color="#000080"><b>integer</b></font>):<font color="#0000FF"><b>integer</b></font>;
<font color="#000080"> stdcall</font>;</p>
<p>&nbsp;&nbsp;&nbsp; Function reads current baudrate of microcontroller RS232
line.<br>
<u>Parameters<br>
</u>&nbsp;&nbsp; <i>BaudRate</i><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out] Exact value of current baudrate
of microcontroller RS232 line.</p>
<p><u>Return values</u><b><br>
&nbsp;&nbsp;&nbsp; </b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000">&nbsp;&nbsp;&nbsp;</font></b></i> If the function
fails, the return value is <i>DEVICE_NOT_PRESENT</i> (device is disconnected).</p>
<p><u>Notes:</u><br>
&nbsp;&nbsp;&nbsp; Function returns exact current baudrate value - may be
slightly different from the required value (error up to 4%).</p>
<hr>
<p>For more information see also file <b><i>IgorUSB.pas</i></b> .</p>
<p><i><b>Copyright 

⌨️ 快捷键说明

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