From 148dd71e1391602e4bd216c0bf3311baebb031f4 Mon Sep 17 00:00:00 2001 From: warhog Date: Sat, 28 May 2011 15:15:24 +0200 Subject: new package alix-temperature Signed-off-by: warhog --- package/alix-temperature/files/alix-temperature | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 package/alix-temperature/files/alix-temperature (limited to 'package/alix-temperature/files') diff --git a/package/alix-temperature/files/alix-temperature b/package/alix-temperature/files/alix-temperature new file mode 100644 index 000000000..cdcf5c1fe --- /dev/null +++ b/package/alix-temperature/files/alix-temperature @@ -0,0 +1,43 @@ +#!/bin/sh +# temperature.sh +# this tool reads the lm86 from pcengines alix mainboards. +# http://pcengines.ch/alix.htm +# tested only on alix2d13 but should work on the other +# alix2dxx and alix3dxx boards too. +# +# Copyright (C) 2011 Tobias Breckle +# +# 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 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +CMD="i2cget -y 0 0x4c" + +TEMP_LOCAL=`$CMD 0x00` +TEMP_REMOTE_HIGH=`$CMD 0x01` +TEMP_REMOTE_LOW=`$CMD 0x10` + +let "TEMP_REMOTE_LOW >>= 5" +let "TEMP_REMOTE_LOW = TEMP_REMOTE_LOW * 125" + +if [ "$1" = "local" ] +then + printf "Local:\t%d\n" $TEMP_LOCAL +elif [ "$1" = "remote" ] +then + printf "Remote:\t%d,%d\n" $TEMP_REMOTE_HIGH $TEMP_REMOTE_LOW +elif [ -z "$1" ] +then + printf "Local:\t%d\n" $TEMP_LOCAL + printf "Remote:\t%d,%d\n" $TEMP_REMOTE_HIGH $TEMP_REMOTE_LOW +fi + -- cgit v1.2.3