User Manual
FUSB307BGEVB
www.onsemi.com
12
Scripting
This tab enables the use of scripts to configure the
FUSB307B. The window in the left side of the tab controls
the scripting.
Scripts can be added through the GUI using normal
copy/paste methods or imported from an external file using
the “Load” button. After achieving a desired setup, a script
can also be exported to a file using the “Save” button.
Each line of the script should be formatted as follows:
Command, port, I
2
C addr, # bytes, register addr, data1,
0, dataN, optional comment
• The Command is: “r” or “w”
• The port is always 0
• The I
2
C addr is any connected device I
2
C address
• The # bytes is the number of bytes to read or write
• The register addr is the starting register address
• The data1, ..., dataN are for writing values to registers
• And optional comment is just informational
Each field can be separated with a space (“ ”), a comma (“,”),
or a semicolon (“;”).
The Run button will execute all the lines of the script.
The Step button will execute the highlighted line.
The Loop feature will loop the entire script up to 99 times.
Setting Loop count to 0 will loop indefinitely.
Some example script commands are given below:
• r 0, 0xA0, 2, 0x04; Read DeviceID
• r 0, 0xA0, 1, 0x1A; Read RoleControl
• w 0, 0xA0, 1, 0x1A, 0x1B; Set Rp 1.5A
• w 0, 0xA0, 3, 0x51, 0x02, 0x47, 0x06; Write PD Byte
Count and Header for GetSourceCaps
• w 0, 0xA0, 1, 0x50, 0x30; Write Transmit SOP
command
Results of an executed script are shown in the box on the
right side of the tab. These results can be exported to a file
using normal copy and paste functions.
Figure 14. Script Tab
Load
Save
Run
Stop
Step
Figure 15. Example Script and Results
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.