📄 igorusb_dll_help.htm
字号:
in input direction<br>
then bit value 1 represent switched
on pull-up resistor and bit value 0 represent switched off pull-up resistor
(high impedance<br>
input) on input data pin.</p>
<p><u>Return values</u><b><br>
</b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000"> </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>
The output values are not read from physical pins, but from
internal register (stored value). For reading true physical values<br>
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> Function reads state of microcontroller data pins (D0-D7).<br>
<u>Parameters</u><br>
<i>DataOutByte</i><br>
[out] Byte which bits represents levels on data pins
(level on physical pins).</p>
<p><u>Return values</u><b><br>
</b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000"> </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> Function reads byte from given address of microcontroller data EEPROM.<br>
<u>Parameters<br>
</u> <i>Address</i><br>
[in] Byte which bits represents
address of internal EEPROM (valid address range: 0 to 127).<br>
<i>DataInByte</i><br>
[out] Value from EEPROM.</p>
<p><u>Return values</u><b><br>
</b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000"> </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>
Function writes byte to given address of microcontroller data
EEPROM.<br>
<u>Parameters<br>
</u> <i>Address</i><br>
[in] Byte which bits represents
address of internal EEPROM (valid address range: 0 to 127).<br>
<i>DataOutByte</i><br>
[in] New value to write to EEPROM.</p>
<p><u>Return values</u><b><br>
</b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000"> </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> 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> Function sends byte to microcontroller RS232 line at
current baudrate.<br>
<u>Parameters<br>
</u> <i>DataOutByte</i><br>
[in] Value to send to microcontroller
RS232 line.</p>
<p><u>Return values</u><b><br>
</b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000"> </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> 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> Function reads byte received by microcontroller RS232
line.<br>
<u>Parameters<br>
</u> <i>DataInByte</i><br>
[out] Byte received from
microcontroller RS232 line.</p>
<p><u>Return values</u><b><br>
</b> The return values are:<br>
<i>NO_ERROR</i> - one byte received (returned in <i>DataInByte</i>)<br>
<i> NO_DATA_AVAILABLE - </i>no data was received (value <i>DataInByte</i>
is not valid)<br>
<i> </i> <i>OVERRUN_ERROR</i> - more bytes was received, but
another received bytes was lost: in <i>DataInByte</i> is returned only the first received
byte<br>
<i> </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> Function sets speed of microcontroller RS232 line.<br>
<u>Parameters<br>
</u> <i>BaudRate</i><br>
[in] Required baudrate of
microcontroller RS232 line (in bps).</p>
<p><u>Return values</u><b><br>
</b> The return values are:<br>
<i>NO_ERROR</i> - baudrate was set (error between required
and set baudrate is less than 4%)<br>
<i> INVALID_BAUDRATE - </i>not supported baudrate - baudrate
was not set (error from required baudrate is more than 4%)<br>
<i> </i> <i>DEVICE_NOT_PRESENT -</i> error: device is
disconnected</p>
<p><u>Notes:</u><br>
Valid baudrates are cca from 2900 Baud to 780 000 Baud.<br>
Supported "standard" baudrates are 4800,
9600,19200,38400,57600.<br>
To know internal baudrate - use function <b><a href="#DoGetRS232Baud">DoGetRS232Baud</a></b>.<br>
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> Function reads current baudrate of microcontroller RS232
line.<br>
<u>Parameters<br>
</u> <i>BaudRate</i><br>
[out] Exact value of current baudrate
of microcontroller RS232 line.</p>
<p><u>Return values</u><b><br>
</b>If the function succeeds, the return value is <i>NO_ERROR</i>.<br>
<i><b><font color="#800000"> </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>
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 + -