Project

General

Profile

Programming the DevKit Silicon Labs PLL ยป pgm-pll-uboot.sh

convert clock builder csv file to uboot script. - Michael Williamson, 02/26/2026 08:12 PM

 
#!/bin/bash
# Create uBoot commands to program SI5332 PLL Chip from
# a clock generator CSV output file.
#
# usage: pgm-pll-uboot.sh file.csv > uboot_script.cmd
#

# this is the standard bus for the mitysom-a5e devkit
bus=3
# this is the standard I2C address for the SI5332 PLL
dev=0x6a

if [ $# -ne 1 ]; then
echo "usage: $0 <register-csv>"
exit 1
fi

echo "i2c dev $bus"

while read -r reg; do
echo "i2c mw $dev $reg"

# Strip lines that aren't register values, convert "addr,data" to "addr data"
# (and strip any carriage returns), and iterate the result
done < <(sed -n 's/^\(0x..\),\(0x..\).*/\1 \2/p' "$1")
    (1-1/1)