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 8-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 CS42L55 codec:
This generates the following binary array:
FE 04 FD FF FD FF FD FF FD FF FE 84 FD 01 00 99 2E 30 32 07 33 FD 34 F8
35 DC 36 F8 37 6C 3A F8 3C D3 3D 23 3E 81 3F 46 00 00 04 02 05 09 1A C4
1B C4 1C C4 1D C4 02 08 FD FF FD FF FD FF 03 00 06 20 2A 00