Chumby device settings information on /proc

From Chumby Wiki
Revision as of 15:36, 16 November 2007 by Phord (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Device access

On Linux you can communicate with "device drivers" through the "/proc" filesystem. For example,

chumby:~# cat /proc/cpuinfo
Processor       : ARM926EJ-Sid(wb) rev 4 (v5l)
BogoMIPS        : 174.89
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
etc.

Chumby has a special section just for Chumby-specific drivers. It's in /proc/chumby*

/proc/chumby

/proc/chumby/temperature

Appears to contain the most recent polled temperature values in raw format.

Most recent values are at the head of the file.

TODO: How to convert this to human readable values?

/proc/chumby/battery-voltage

Appears to contain the most recent polled battery voltage values in raw format.

Most recent values are at the head of the file.

TODO: How to convert this to human readable values?

/proc/chumby/tsc2100

/proc/chumby/tsc2100/control5-page2

/proc/chumby/tsc2100/control4-page2

/proc/chumby/tsc2100/pll2-page2

/proc/chumby/tsc2100/pll1-page2

/proc/chumby/tsc2100/control3-page2

/proc/chumby/tsc2100/powercon-page2

/proc/chumby/tsc2100/control2-page2

/proc/chumby/tsc2100/sidetone-page2

/proc/chumby/tsc2100/audiodac-page2

/proc/chumby/tsc2100/audioadc-page2

/proc/chumby/tsc2100/control1-page2

/proc/chumby/tsc2100/refctl-page1

/proc/chumby/tsc2100/adc-page1

/proc/chumby/tsc2100/registers

/proc/chumby/audio

/proc/chumby/audio/side-tone

/proc/chumby/audio/side-tone/digital-gain

/proc/chumby/audio/side-tone/digital-mute

/proc/chumby/audio/side-tone/analog-gain

/proc/chumby/audio/side-tone/analog-mute

/proc/chumby/audio/mixer

/proc/chumby/audio/mixer/both-speakers

/proc/chumby/audio/mixer/both-speakers/volume

/proc/chumby/audio/mixer/both-speakers/mute

/proc/chumby/audio/mixer/right-speaker

/proc/chumby/audio/mixer/right-speaker/volume

/proc/chumby/audio/mixer/right-speaker/mute

/proc/chumby/audio/mixer/left-speaker

/proc/chumby/audio/mixer/left-speaker/volume

/proc/chumby/audio/mixer/left-speaker/mute

/proc/chumby/touchscreen

/proc/chumby/touchscreen/touchclick

Contains 1 if touchscreen click is enabled.

Contains 0 if touchscreen click is disabled.

You can enable the touchscreen click by putting a 1 in this file:

echo 1 > /proc/chumby/touchscreen/touchclick

/proc/chumby/touchscreen/poll-interval

/proc/chumby/touchscreen/coordinates

Shows the most recent 29(?) touchscreen events.

Most recent values are at the head of the file.

This example shows the last two events once per second. Run this and then touch the screen to see it update.

chumby:~# while [ 1 ] ; do head -2 /proc/chumby/touchscreen/coordinates ; sleep 1 ; done

There appear to be two events logged in the coordinates file, pen-up and pen-down.

  • pen-up is logged when you stop touching the screen. Its coordinates are always 0.
  • pen-down is continuously logged when you are touching the screen. Its coordinates reflect the location you are touching on the screen (x,y) and the pressure applied (p).
    • P is LARGER for lighter touches. It seems to range from 0 - 10000 most of the time, but I have seen some values over 19,000.
    • Y coordinates range from about 167 to 3920 on my screen, left to right.
    • X coordinates range from about 220 to 3860 on my screen, bottom to top.
chumby:~# head /proc/chumby/touchscreen/coordinates
256: x=0 y=0 p=0 pen-up
255: x=564 y=3763 p=6698 pen-down
254: x=561 y=3768 p=6052 pen-down
253: x=561 y=3757 p=5798 pen-down
252: x=566 y=3760 p=5677 pen-down
251: x=573 y=3761 p=5767 pen-down
250: x=579 y=3757 p=5873 pen-down
249: x=583 y=3762 p=6122 pen-down
248: x=590 y=3761 p=6426 pen-down
247: x=590 y=3752 p=6633 pen-down


/proc/chumby/touchscreen/enable

Contains 1 if touchscreen is enabled.

Contains 0 if touchscreen is disabled.

You can disable the touchscreen by putting a 0 in this file:

echo 0 > /proc/chumby/touchscreen/enable

/proc/chumby-wifi

/proc/chumby-wifi/network-status

/proc/chumby-wifi/link-status

/proc/chumby-wifi/regs

/proc/chumby-wifi/bss-scantab

/proc/chumby-wifi/mlme-aux

/proc/chumby-wifi/mlme-struct

/proc/chumby-wifi/dev-stats

/proc/chumby-wifi/counters

/proc/chumby-wifi/active-config

/proc/chumby-wifi/port-config

/proc/chumby-wifi/rtmp-adapter

/proc/chumby-wifi/trace-buffer

/proc/chumby-wifi/dbug-pages

/proc/chumby-wifi/dbug-level

/proc/chumby-wifi/RTDebugLevel