Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - andkae/usbiss at v0.1.0
Nothing Special   »   [go: up one dir, main page]

Skip to content

andkae/usbiss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Windows doxygen

usbiss

A USB-ISS C driver API and CLI tool for Linux and Windows.

Picture of USB-ISS adapter


Features

  • CLI interface to read/write arbitrary number of bytes from I2C slave
  • Windows/Linux support
  • Prebuild Windows excutable for command line
  • Easy to use C-API for project integration

Releases

Version Date Source Change log
latest latest.zip
v0.0.1 2023-08-04 v0.0.1.zip initial draft

Arguments

Argument Description Remark
-p, --port=[UART] USB-ISS belonging port Windows: COM1
Linux: /dev/ttyACM0
-b, --baud=[115200] communication speed Host/USB-ISS UART baud rate
-m, --mode=[I2C_S_100KHZ] I2C transfer mode, use usbiss -h for valid modes f.e. I2C_H_400KHZ
-c, --command={cmd} I2C access to perform
write: adr7 w b0 bn
read: adr7 r cnt
write-read: adr7 w bn r cnt
adr7: I2C slave address
bn: write byte value
cnt: number of read bytes
-h, --help help
--verbose enable debug output
--brief output only relevant USBISS responses write: exit code only, read: read data only

Run

This example modifies the EEPROM 24C256 memory content.

Write

Write to device 0x50 address 0 the data 0x01 0x02 0x03. The Arg accepts arbitary write data length, but keep the page overoll in this case in mind.

sudo ./bin/usbiss -m I2C_H_400KHz -c "0x50 w 0 0 0x01 0x02 0x03"

Following output:

[ INFO ]   USBISS started
[ OKAY ]   USBISS connected
             Baudrate : 115200
             Firmware : 0x09
             Serial   : 00060147
             Mode     : I2C_H_400KHZ
[ OKAY ]   Write 5 bytes to device 0x50
             0:  00 00 01 02 03
[ OKAY ]   ended normally

Read

Read from device 0x50 address 0 128 bytes.

sudo ./bin/usbiss -m I2C_H_400KHz -c "0x50 w 0 0 r 128"

Following output:

[ INFO ]   USBISS started
[ OKAY ]   USBISS connected
             Baudrate : 115200
             Firmware : 0x09
             Serial   : 00060147
             Mode     : I2C_H_400KHZ
[ OKAY ]   Write/Read interaction with device 0x50
           Write 2 Bytes
             0:  00 00
           Read 128 Bytes
             00:  01 02 03 05 06 07 08 09  0a 0b 0c 0d 0e 0f 10 11
             10:  12 13 14 15 16 17 18 19  1a 1b 1c 1d 1e 1f 20 21
             20:  22 23 24 25 26 27 28 29  0a 0b 0c 0d 2e 2f 30 31
             30:  32 33 34 35 36 37 38 39  3a 3b 3c 3d 3e 3f 40 41
             40:  0a 0b 0c 0d 1b 71 a4 00  00 00 00 00 00 00 00 00
             50:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
             60:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
             70:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[ OKAY ]   ended normally

List

int usbiss_list_uart( char *str, size_t len );

List USB-ISS suitable UART ports.

Arg Description
str Found UART ports on system
len max length of string

Init

int usbiss_init( t_usbiss *self );

Initialize USB-ISS handle.

Verbose

void usbiss_set_verbose( t_usbiss *self, uint8_t verbose );

Set message level of driver.

Arg Description
verbose Advanced debug information
0: no debug output
1: debug output via printf

Open

int usbiss_open( t_usbiss *self, char* port, uint32_t baud );

Open connection to USB-ISS.

Arg Description
port=[COM1 | /dev/ttyACM0] System path to USB-ISS belonging UART. Provide empty string "" for default
baud=[115200] Baud rate of UART connection. Provide 0 for default

Close

int usbiss_close( t_usbiss *self );

Close connection to USB-ISS.

Mode

int usbiss_set_mode( t_usbiss *self, const char* mode );

Setup USB-ISS transfer mode. Note: Currently only I2C modes supported.

Arg Description
mode=[USBISS_I2C_S_100KHZ] I2C Standard: USBISS_I2C_S_20KHZ, USBISS_I2C_S_50KHZ, USBISS_I2C_S_100KHZ, USBISS_I2C_S_400KHZ
I2C Fast: USBISS_I2C_H_100KHZ, USBISS_I2C_H_400KHZ, USBISS_I2C_H_1000KHZ

I2C-Write

int usbiss_i2c_wr( t_usbiss *self, uint8_t adr7, void* data, size_t len );

Write arbitrary number of bytes to I2C slave.

Arg Description
adr7 I2C slave address (7Bit)
data array with write data
len number of bytes in write array

I2C-Read

int usbiss_i2c_rd( t_usbiss *self, uint8_t adr7, void* data, size_t len );

Read arbitrary number of bytes from I2C slave.

Arg Description
adr7 I2C slave address (7Bit)
data array with read data
len number of requested read bytes

I2C-Write-Read

int usbiss_i2c_wr_rd( t_usbiss *self, uint8_t adr7, void* data, size_t wrLen, size_t rdLen );

Write arbitrary number of bytes to I2C slave, sent repeated start and read arbitrary number of bytes. Write and Read data takes place in the same data buffer.

Arg Description
adr7 I2C slave address (7Bit)
data array with write/read data
wrLen number of bytes to write
rdLen number of bytes for read

Acknowledgment

Special thanks to AndreRenaud for providing simple_uart. This nice module allows us to run USBISS for Linux and Windows.

References

About

C API and CLI Tool for Robot Electronics USB-I2C Bridge (USB-ISS)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0