Manages the user interface The user interface can consist of buttons, LED, serial print ports, etc. It is not a graphical interface. The board will communicate its state via the UI and the user can send commands via the UI.
More...
#include <IUserInterface.h>
|
virtual | ~IUserInterface ()=default |
|
virtual Mutex & | getPrintMutex ()=0 |
| get the mutex for printing. Note that the mutex is not used in any functions, the user needs to lock and unlock this mutex More...
|
|
virtual void | flush ()=0 |
| Adds a newline and flushes the input to the serial port. More...
|
|
virtual int | print (const char *format,...)=0 |
| Provides an interface to print to the console or serial port. The arguments and return values match the standard printf library. A flush needs to be called after this function. More...
|
|
virtual int | print (const char *format, va_list args)=0 |
| Provides an interface to print to the console or serial port using an initialized va_list. The return value matches the standard printf library. A flush needs to be called after this function. More...
|
|
virtual int | printLine (const char *format,...)=0 |
| Provides an interface to print a line to the console or serial port. Flushes the input and adds a newline. The arguments and return values match the standard printf library. More...
|
|
virtual int | printLine (const char *format, va_list args)=0 |
| Provides an interface to print to the console or serial port using an initialized va_list. Flushes the input and adds a newline. The return value matches the standard printf library. More...
|
|
virtual void | setRGBLed (RgbColor color)=0 |
| Sets the RGB LED to a given color. More...
|
|
virtual void | setLed (LED led, bool state)=0 |
| Sets an LED on or off. More...
|
|
virtual void | setHexDisplay (uint8_t value)=0 |
| Sets the hex display to a given 8 bit value (not available on the HiveSight) More...
|
|
virtual void | setButtonCallback (Button button, buttonCallbackFunction_t callback, void *context)=0 |
| Sets the callback associated with a given button press. More...
|
|
Manages the user interface The user interface can consist of buttons, LED, serial print ports, etc. It is not a graphical interface. The board will communicate its state via the UI and the user can send commands via the UI.
◆ ~IUserInterface()
virtual IUserInterface::~IUserInterface |
( |
| ) |
|
|
virtualdefault |
◆ flush()
virtual void IUserInterface::flush |
( |
| ) |
|
|
pure virtual |
Adds a newline and flushes the input to the serial port.
Implemented in UserInterface.
◆ getPrintMutex()
virtual Mutex& IUserInterface::getPrintMutex |
( |
| ) |
|
|
pure virtual |
get the mutex for printing. Note that the mutex is not used in any functions, the user needs to lock and unlock this mutex
Implemented in UserInterface.
◆ print() [1/2]
virtual int IUserInterface::print |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
|
pure virtual |
Provides an interface to print to the console or serial port using an initialized va_list. The return value matches the standard printf library. A flush needs to be called after this function.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | args | Previously initialized va_list |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implemented in UserInterface.
◆ print() [2/2]
virtual int IUserInterface::print |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
pure virtual |
Provides an interface to print to the console or serial port. The arguments and return values match the standard printf library. A flush needs to be called after this function.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | ... | Additionnal arguments for the format parameter |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implemented in UserInterface.
◆ printLine() [1/2]
virtual int IUserInterface::printLine |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
|
pure virtual |
Provides an interface to print to the console or serial port using an initialized va_list. Flushes the input and adds a newline. The return value matches the standard printf library.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | args | Previously initialized va_list |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implemented in UserInterface.
◆ printLine() [2/2]
virtual int IUserInterface::printLine |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
pure virtual |
Provides an interface to print a line to the console or serial port. Flushes the input and adds a newline. The arguments and return values match the standard printf library.
- Parameters
-
[in] | format | Text to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function |
[in] | ... | Additionnal arguments for the format parameter |
- Returns
- Matches the standard printf return. The total number of characters is returned or a negative number on error
Implemented in UserInterface.
◆ setButtonCallback()
Sets the callback associated with a given button press.
- Parameters
-
button | Button to register the callback on |
callback | Callback to call |
context | Context to pass to the callback |
Implemented in UserInterface.
◆ setHexDisplay()
virtual void IUserInterface::setHexDisplay |
( |
uint8_t |
value | ) |
|
|
pure virtual |
Sets the hex display to a given 8 bit value (not available on the HiveSight)
- Parameters
-
Implemented in UserInterface.
◆ setLed()
virtual void IUserInterface::setLed |
( |
LED |
led, |
|
|
bool |
state |
|
) |
| |
|
pure virtual |
Sets an LED on or off.
- Parameters
-
led | wich led to toggle |
state | which state to put the led (on or off) |
Implemented in UserInterface.
◆ setRGBLed()
virtual void IUserInterface::setRGBLed |
( |
RgbColor |
color | ) |
|
|
pure virtual |
Sets the RGB LED to a given color.
- Parameters
-
Implemented in UserInterface.
The documentation for this class was generated from the following file: