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

7 lines
200 B
Bash
Executable file

#!/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