Difference between revisions of "Chumby device settings information on /proc"

From Chumby Wiki
Jump to: navigation, search
(/proc/sys/sense1/hpin)
(/proc/sys/sense1/dimlevel)
Line 42: Line 42:
  
 
''This worked for me once, then it stopped.  Don't know why. dimlevel does reflect the current dimlevel if I change it manually via the ControlPanel, however.''
 
''This worked for me once, then it stopped.  Don't know why. dimlevel does reflect the current dimlevel if I change it manually via the ControlPanel, however.''
 +
 +
''Update: It works for me again.  Did I do something wrong before?''
  
 
====/proc/sys/sense1/spkmute====
 
====/proc/sys/sense1/spkmute====

Revision as of 08:38, 26 November 2007

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.

Note, most of these files will be migrating out of /proc in the future to /sys, so do not write code that expects these files to be present all the time.

/proc/sys

Here are some chumby-specific system driver files

/proc/sys/accel

/proc/sys/accel/romBusy

/proc/sys/accel/painThresh

/proc/sys/accel/touchThresh

/proc/sys/accel/dbg-error

/proc/sys/accel/dbg-ioctl

/proc/sys/accel/dbg-trace

/proc/sys/timerx

/proc/sys/timerx/dbg-error

/proc/sys/timerx/dbg-ioctl

/proc/sys/timerx/dbg-trace

/proc/sys/sense1

/proc/sys/sense1/resetSerial

/proc/sys/sense1/debounce

/proc/sys/sense1/hpin

Contains 1 if something is plugged into the audio-out (headphone) jack.

/proc/sys/sense1/BTvolts

/proc/sys/sense1/DCvolts

/proc/sys/sense1/dimlevel

  • Full brightness (normal mode) with echo 0 > /proc/sys/sense1/dimlevel
  • Dim the screen (night mode) with echo 1 > /proc/sys/sense1/dimlevel
  • Screen off with echo 2 > /proc/sys/sense1/dimlevel

This worked for me once, then it stopped. Don't know why. dimlevel does reflect the current dimlevel if I change it manually via the ControlPanel, however.

Update: It works for me again. Did I do something wrong before?

/proc/sys/sense1/spkmute

Speaker mute (master?)

/proc/sys/sense1/dbg-error

/proc/sys/sense1/dbg-ioctl

/proc/sys/sense1/dbg-trace

/proc/chumby

Chumby has a special section just for Chumby-specific drivers. It's in /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