diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-04-16 16:10:05 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-15 05:20:14 +0000 |
commit | c46f569a39210c5ecc7f2f767b6a77c9554f3d73 (patch) | |
tree | 8d5544c243b4f305706e448013f31bba61588679 /extra/README | |
parent | 53eb009d52fe82409784dfa6f079d45e7a2339b5 (diff) | |
download | chrome-ec-c46f569a39210c5ecc7f2f767b6a77c9554f3d73.tar.gz |
Add standalone lightbar simulation tool
This adds an "extra/" directory to hold various experiments and optional
programs. With this change, we add a tool that can simulate the lightbar
behavior on the build machine. That can be used to experment with variations
in the lightbar pattern code without needing to reflash a Pixel with a new
EC to see the effect.
There is no functional change to the EC code, just a couple of #ifdefs to
allow common/lightbar.c to be compiled separately from the EC.
BUG=none
BRANCH=ToT
TEST=make buildall -j
cd extra
make
./lightbar
You may need to install the libxcb1-dev package on your build machine.
Change-Id: I847ce7ea97cae792b1de1b91f488819e873b6555
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199883
Diffstat (limited to 'extra/README')
-rw-r--r-- | extra/README | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/extra/README b/extra/README new file mode 100644 index 0000000000..16659415fb --- /dev/null +++ b/extra/README @@ -0,0 +1,46 @@ + +This directory is for experiments only. It is not built automatically, +required, supported, guaranteed to work, or necessarily well-documented. + +The contents may change without warning at any time. + +------------------------------------------------------------------------------ +Lightbar simulator +------------------------------------------------------------------------------ + +Build with "make lightbar". The executable is "./lightbar". + +You may need to install libxcb1-dev or similar. + +This provides a simulation environment for the lightbar task, compiling +common/lightbar.c from the EC source, but faking the rest of the EC. + +The EC console is on stdin/stdout, delivering all input to the lightbar's +console command handler (so it prefixes any input with "lightbar"). The +lightbar itself is displayed in an X window. You can click in that window to +emulate changes to the battery level, AC connection, and brightness, all of +which are normally outside the lightbar task's direct control. + +The initial sequence is "S5". Try issuing the command "seq s3s0" to see +something more familiar. + + +Note: the Pixel lightbar circuitry has three modes of operation: + +Unpowered + + When the host CPU is off (S5/G3), all power to the lightbar and its + controller circuitry is lost. + +On + + When the host CPU is on (S0) or suspended (S3), the lightbar is powered + again. After every power loss, it will need to be reinitialized by calling + lb_init() before it can be used. + +Standby + + The lightbar controller ICs can turn off all the LED outputs to conserve + power. This is the initial state when power is applied. You can turn the + LEDs off manually by calling lb_off(). When suspended, the controller will + respond to commands, but the LEDs aren't lit. Turn them on with lb_on(). |