netz39-infra-ansible/files/platon/i2cspeed.sh

8 lines
200 B
Bash
Raw Permalink Normal View History

#!/bin/bash
# https://gist.github.com/ribasco/c22ab6b791e681800df47dd0a46c7c3a
var="$(xxd -ps /sys/class/i2c-adapter/i2c-1/of_node/clock-frequency)"
var=${var//[[:blank:].\}]/}
printf "%d\n" 0x$var