mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 15:48:51 +01:00
added get_sid, and tests speaker and LED for assy tests
This commit is contained in:
parent
f2a9bbea2a
commit
f9fa3ae10e
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
echo $(for i in 0 4 8 c; do devmem 0x01c2380$i 32; done) | sed 's/ \?0x//g'
|
||||
26
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-led
Normal file
26
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-led
Normal 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
|
||||
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user