Attached to this article is a python 3 script to generate the I2C command arrays for a CP2114-B01 device, interfacing with a codec with 16-bit registers.
This script interprets the following commands to construct the command byte-array.
The commands may also start with one of the following tags:
If no tag begins the sequence, the device defaults to using this string as the initialization sequence of commands to be after reset, as long as this is the first sequence after the 30-byte configuration string.
Note - only one sequence can be generated at a time with this script. If all three sequences are needed, they will need to be generated individually, then appended together into one large byte array, with the reset sequence being first.
Here is an example image of the script running:
The left panel is the 'input' field, where commands are typed. The right panel is the 'output' field, where the byte array is generated. The byte array is refreshed any time return/enter are pressed in the input field.
The bottom panel is for any errors that may arise.
As an example, this is the input text required to generate a reset configuration for the WM8523 codec:
write(0x02, 0x00, 0x01)
write(0x02, 0x00, 0x02)
write(0x02, 0x00, 0x03)
write(0x05, 0x00, 0x0F)
write(0x06, 0x00, 0x01)
write(0x07, 0x00, 0x01)
write(0x03, 0x18, 0x11)
This generates the following binary array:
02 00 01 02 00 02 02 00 03 05 00 0F 06 00 01 07 00 01 03 18 11