Namespaces | |
Detect | |
The Detect namespace contains several related functions to help determine if the device where the code is running is a BeagleBone Black, BeagleBone Green, or some other type of device. | |
USB | |
Manipulate the USB Type-A port on a BeagleBone. | |
Classes | |
class | LEDControl |
BeagleBone LED software controller. More... | |
class | Watchdog |
BeagleBone hardware watchdog. More... | |
Typedefs | |
typedef std::map< SG::BeagleBone::LED, bool > | PatternStep |
Every blink pattern is a vector of steps, where each step is map of LEDs to turn on and off. More... | |
typedef std::vector< SG::BeagleBone::PatternStep > | BlinkPattern |
Every blink pattern is a vector of steps, where each step is map of LEDs to turn on and off. More... | |
Functions | |
std::string | to_string (const Trigger trigger) |
Convert the trigger enum to the string expected in the trigger file. More... | |
Trigger | default_trigger (const SG::BeagleBone::LED led) |
Return the default trigger typically used by each LED. More... | |
int | index_of (const SG::BeagleBone::LED led) |
Determine the index of the specified LED. More... | |
bool | is_single_LED (const SG::BeagleBone::LED led) |
Determine if the specified LED enum is a single physical LED, or a "pseudo" LED such as LED::all. More... | |
bool | is_pseudo_LED (const SG::BeagleBone::LED led) |
Determine if the specified LED enum represents a "pseudo" LED, such as LED::all or LED::none. More... | |
BlinkPattern | LED_invert_pattern (const BlinkPattern &pattern) |
Invert the pattern. More... | |
BlinkPattern | LED_pattern_none (void) |
Turn all the lights off. More... | |
BlinkPattern | LED_pattern_all (void) |
Turn all lights on. More... | |
BlinkPattern | LED_pattern_blink (void) |
Blink all lights in unison. More... | |
BlinkPattern | LED_pattern_blinkOffset (void) |
Blink even and odd lights. More... | |
BlinkPattern | LED_pattern_blinkSplit (void) |
Blink left and right lights. More... | |
BlinkPattern | LED_pattern_cylon (void) |
Multi-light sweep similar to BSG Cylons. More... | |
BlinkPattern | LED_pattern_kitt (void) |
Single light sweep similar to KITT ("Knight Rider") from the 1980s. More... | |
BlinkPattern | LED_pattern_mergeLeft (void) |
Lights moving from right to left. More... | |
BlinkPattern | LED_pattern_mergeRight (void) |
Lights moving from left to right. More... | |
BlinkPattern | LED_pattern_mergeBoth (void) |
Mix of merge left and merge right. More... | |
BlinkPattern | LED_pattern_inchwormLeft (void) |
Lights moving from right to left. More... | |
BlinkPattern | LED_pattern_inchwormRight (void) |
Lights moving from left to right. More... | |
BlinkPattern | LED_pattern_inchwormBoth (void) |
Mix of merge left and merge right. More... | |
BlinkPattern | LED_pattern_insideOut (void) |
Blink inside lights, then outside lights. More... | |
BlinkPattern | LED_get_pattern (const LEDPattern pattern) |
Return the corresponding blink pattern that corresponds to the given enum value. More... | |
typedef std::vector< SG::BeagleBone::PatternStep > SG::BeagleBone::BlinkPattern |
Every blink pattern is a vector of steps, where each step is map of LEDs to turn on and off.
typedef std::map< SG::BeagleBone::LED, bool > SG::BeagleBone::PatternStep |
Every blink pattern is a vector of steps, where each step is map of LEDs to turn on and off.
|
strong |
Enumerator for the various LEDs on BeagleBone Black and BeagleBone Green.
Enumerator | |
---|---|
invalid | |
none | |
all | |
usr0 |
LED closest to the outside and the |
usr1 | |
usr2 | |
usr3 |
LED closest to the Ethernet cable and the |
min | |
max |
|
strong |
Several "built-in" (to this library) blink patterns that can easily be used with SG::BeagleBone::LEDControl.
|
strong |
Enumerator for the LED trigger type to use.
Enumerator | |
---|---|
invalid | |
none |
Prevents the LED from automatically changing. Use this trigger if you want to manually turn on and turn off the LED. |
nand_disk | |
usb_gadget | |
usb_host | |
mmc0 |
Micro SD card is accessed. |
mmc1 |
Internal eMMC is accessed. |
timer | |
oneshot |
https://www.kernel.org/doc/Documentation/leds/ledtrig-oneshot.txt |
heartbeat |
Periodic double-blink from the Linux kernel to indicate the device is still running. |
backlight | |
gpio | |
cpu0 |
Blink rate is determined by the load average. |
default_on |
|
inline |
|
inline |
Determine the index of the specified LED.
For example, the index of LED::usr0 is 0
, while the index of LED::usr3 is 3
. All other enums such as LED::all will result in -1
.
References usr0, usr1, usr2, and usr3.
Referenced by SG::BeagleBone::LEDControl::get_base_path(), is_pseudo_LED(), and is_single_LED().
|
inline |
Determine if the specified LED enum represents a "pseudo" LED, such as LED::all or LED::none.
References index_of().
Referenced by SG::BeagleBone::LEDControl::get_base_path(), SG::BeagleBone::LEDControl::set_default_trigger(), SG::BeagleBone::LEDControl::set_trigger(), and SG::BeagleBone::LEDControl::toggle().
|
inline |
Determine if the specified LED enum is a single physical LED, or a "pseudo" LED such as LED::all.
References index_of().
|
inline |
Return the corresponding blink pattern that corresponds to the given enum value.
References all, blink, blinkOffset, blinkSplit, cylon, inchwormBoth, inchwormLeft, inchwormRight, insideOut, invalid, kitt, LED_pattern_all(), LED_pattern_blink(), LED_pattern_blinkOffset(), LED_pattern_blinkSplit(), LED_pattern_cylon(), LED_pattern_inchwormBoth(), LED_pattern_inchwormLeft(), LED_pattern_inchwormRight(), LED_pattern_insideOut(), LED_pattern_kitt(), LED_pattern_mergeBoth(), LED_pattern_mergeLeft(), LED_pattern_mergeRight(), LED_pattern_none(), max, mergeBoth, mergeLeft, mergeRight, and none.
Referenced by SG::BeagleBone::LEDControl::load_pattern(), SG::BeagleBone::LEDControl::load_random_pattern(), and SG::BeagleBone::LEDControl::set_idle_timeout().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_invert_pattern | ( | const BlinkPattern & | pattern | ) |
Invert the pattern.
Reverse all values of "on"
and "off"
in a pattern. For example, given the pattern LED_pattern_none(), calling this method would result in the same pattern as LED_pattern_all().
Referenced by SG::BeagleBone::LEDControl::invert_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_all | ( | void | ) |
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_blink | ( | void | ) |
Blink all lights in unison.
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_blinkOffset | ( | void | ) |
Blink even and odd lights.
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_blinkSplit | ( | void | ) |
Blink left and right lights.
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_cylon | ( | void | ) |
Multi-light sweep similar to BSG Cylons.
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_inchwormBoth | ( | void | ) |
Mix of merge left and merge right.
References LED_pattern_inchwormLeft(), and LED_pattern_inchwormRight().
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_inchwormLeft | ( | void | ) |
Lights moving from right to left.
Referenced by LED_get_pattern(), and LED_pattern_inchwormBoth().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_inchwormRight | ( | void | ) |
Lights moving from left to right.
Referenced by LED_get_pattern(), and LED_pattern_inchwormBoth().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_insideOut | ( | void | ) |
Blink inside lights, then outside lights.
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_kitt | ( | void | ) |
Single light sweep similar to KITT ("Knight Rider") from the 1980s.
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_mergeBoth | ( | void | ) |
Mix of merge left and merge right.
References LED_pattern_mergeLeft(), LED_pattern_mergeRight(), LED_pattern_none(), and none.
Referenced by LED_get_pattern().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_mergeLeft | ( | void | ) |
Lights moving from right to left.
Referenced by LED_get_pattern(), and LED_pattern_mergeBoth().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_mergeRight | ( | void | ) |
Lights moving from left to right.
Referenced by LED_get_pattern(), and LED_pattern_mergeBoth().
SG::BeagleBone::BlinkPattern SG::BeagleBone::LED_pattern_none | ( | void | ) |
Turn all the lights off.
Referenced by LED_get_pattern(), and LED_pattern_mergeBoth().
|
inline |
Convert the trigger enum to the string expected in the trigger
file.
References backlight, cpu0, default_on, gpio, heartbeat, mmc0, mmc1, nand_disk, none, oneshot, timer, usb_gadget, and usb_host.
Referenced by SG::BeagleBone::LEDControl::set_trigger().