[Armadeus-commitlog] SF.net SVN: armadeus:[963] trunk/target/test/test_adc.sh
Brought to you by:
sszy
|
From: <ar...@us...> - 2008-12-18 11:00:14
|
Revision: 963
http://armadeus.svn.sourceforge.net/armadeus/?rev=963&view=rev
Author: artemys
Date: 2008-12-18 11:00:12 +0000 (Thu, 18 Dec 2008)
Log Message:
-----------
[TEST] Add test script for ADC
Added Paths:
-----------
trunk/target/test/test_adc.sh
Added: trunk/target/test/test_adc.sh
===================================================================
--- trunk/target/test/test_adc.sh (rev 0)
+++ trunk/target/test/test_adc.sh 2008-12-18 11:00:12 UTC (rev 963)
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+
+test_ADC()
+{
+ show_test_banner "ADC"
+
+ modprobe spi_imx
+ modprobe max1027
+ if [ "$?" == 0 ]; then
+ # Slow mode
+ let set=0x62; echo $set > /sys/bus/spi/devices/spi1.0/setup
+ sleep 0.1
+ let conv=0xf9; echo $conv > /sys/bus/spi/devices/spi1.0/conversion
+ sleep 0.1
+ temp=`cat /sys/bus/spi/devices/spi1.0/temp1_input`
+ if [ "$temp" != "0" ]; then
+ echo "Temp: $temp m°C"
+ echo_test_ok
+ fi
+ else
+ echo "Hardware not found !"
+ fi
+}
+
+test_ADC
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|