added get_sid, and tests speaker and LED for assy tests

This commit is contained in:
Vincent-FK 2020-09-15 23:19:28 +02:00
parent f2a9bbea2a
commit f9fa3ae10e
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,2 @@
#!/bin/sh
echo $(for i in 0 4 8 c; do devmem 0x01c2380$i 32; done) | sed 's/ \?0x//g'

View File

@ -0,0 +1,26 @@
#!/bin/sh
if [ $# -ne 1 ];then
echo "ERROR LED ARGS"
exit;
fi
case ${1} in
0) value=0x0a;;
1) value=0x3a;;
*) echo "ERROR LED VALUE"; exit 1;;
esac
# Load I2C modules
modprobe i2c-dev
modprobe i2c-mv64xxx
# Turn on/off the LED
i2cset -y 0 0x34 0x32 ${value}
if [ $? -ne 0 ]; then
echo "ERROR LED I2C"
else
echo "OK"
fi
# Unload I2C modules
modprobe -r i2c_mv64xxx i2c_dev >/dev/null 2>&1

View File

@ -0,0 +1,24 @@
#!/bin/sh
# Turn on Power Amplifier
gpioset $(gpiofind "PA")=1
if [ $? -ne 0 ]; then
echo "ERROR SPEAKER ON"
else
# Play 1kHz sine wave
speaker-test -t sine -s 1 -f 1000 >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR SPEAKER SINE"
gpioset $(gpiofind "PA")=0
else
# Turn off Power Amplifier
gpioset $(gpiofind "PA")=0
if [ $? -ne 0 ]; then
echo "ERROR SPEAKER OFF"
else
echo "OK"
fi
fi
fi