Files
OpenCellular/include/lightbar.h
Bill Richardson ede77d7cac Add "lightbar demo" mode for executive bikeshedding
I keep getting asked to build an EC image to manually control the lightbar
patterns so that the Powers That Be can look at it. This change just makes
it possible to turn that mode on and off for yourself. You'll need a root
shell or the EC console to do it, though.

BUG=chrome-os-partner:8039
BRANCH=link
TEST=manual

From the EC console, type

  lightbar demo 1

OR from the root shell run

  ectool lightbar demo 1

After that, these keys should change the lightbar appearance (transitions
may be slow and subtle - that's intended):

  UP = battery is more fully charged
  DOWN = battery is less fully charged
  RIGHT = battery is charging
  LEFT = battery is discharging
  BRIGHT = increase lightbar brightness
  DIM = decrase lightbar brightness

Note that this does not interfere with the normal function of any keys. It
only adds some additional EC behavior.

Change-Id: Ia1a9855188244d74b670f9dbfdf60e3ac0343460
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30899
2012-08-20 15:44:50 -07:00

49 lines
1.3 KiB
C

/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Ask the EC to set the lightbar state to reflect the CPU activity */
#ifndef __CROS_EC_LIGHTBAR_H
#define __CROS_EC_LIGHTBAR_H
/****************************************************************************/
/* Internal stuff */
/* Define the types of sequences */
#define LBMSG(state) LIGHTBAR_##state
#include "lightbar_msg_list.h"
enum lightbar_sequence {
LIGHTBAR_MSG_LIST
LIGHTBAR_NUM_SEQUENCES
};
#undef LBMSG
/* Request a preset sequence from the lightbar task. */
void lightbar_sequence(enum lightbar_sequence s);
/****************************************************************************/
/* External stuff */
/* These are the commands available to the EC console or via LPC. */
enum lightbar_command {
LIGHTBAR_CMD_DUMP,
LIGHTBAR_CMD_OFF,
LIGHTBAR_CMD_ON,
LIGHTBAR_CMD_INIT,
LIGHTBAR_CMD_BRIGHTNESS,
LIGHTBAR_CMD_SEQ,
LIGHTBAR_CMD_REG,
LIGHTBAR_CMD_RGB,
LIGHTBAR_CMD_GET_SEQ,
LIGHTBAR_CMD_DEMO,
LIGHTBAR_NUM_CMDS
};
/* These are used for demo purposes */
extern void demo_battery_level(int inc);
extern void demo_is_charging(int ischarge);
extern void demo_brightness(int inc);
#endif /* __CROS_EC_LIGHTBAR_H */