Working with MDIO via sub_app.exe

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Working with MDIO via sub_app.exe

Post by xol »

Command line utility sub_app.exe (or sub_app for Linux) provides access to SUB-20 MDIO functionality.

SYNOPSIS
sub_app.exe --mdio=<R|W|a|w|r|p>,<PRT_PHY>,<DEV_REG>,<DATA> [--mdio...]
where:
R - Clause22 Read
W - Clause22 Write
r - Clause45 read
w- Clause45 write
a - Clause45 address write
p - Clause45 post-read-increment
PRT_PHY - Phy/Port address (hex)
DEV_REG - Register/Device address (hex)
DATA - Data/Address (hex)

There can be a number of --mdio options in one command. They will be processed in series in order of appearance.

EXAMPLE
sub_app.exe --mdio=R,12,10,0 - Clause22 Read Phy=0x12 Register=0x10
Output:
MDIO[0] data=0xFFFF

sub_app.exe --mdio=a,23,5A,1000 --mdio=r,23,5A,0 --mdio=w,23,5A,300 - Clause45 Port=0x23, Device=0x5A, address write 0x1000, read, write 0x300
Output:
MDIO[0] data=0x1000
MDIO[1] data=0x1F23 - data read from port
MDIO[2] data=0x0300

Post Reply