HiveMind
Public Member Functions | List of all members
IUserInterface Class Referenceabstract

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>

Inheritance diagram for IUserInterface:
Inheritance graph
Collaboration diagram for IUserInterface:
Collaboration graph

Public Member Functions

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~IUserInterface()

virtual IUserInterface::~IUserInterface ( )
virtualdefault

Member Function Documentation

◆ flush()

virtual void IUserInterface::flush ( )
pure virtual

Adds a newline and flushes the input to the serial port.

Implemented in UserInterface.

Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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]formatText to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function
[in]argsPreviously 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]formatText 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.

Here is the caller graph for this function:

◆ 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]formatText to be written, can contain format specifiers that will be replaced by values specified in the additional arguments, matches the standard printf function
[in]argsPreviously 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]formatText 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.

Here is the caller graph for this function:

◆ setButtonCallback()

virtual void IUserInterface::setButtonCallback ( Button  button,
buttonCallbackFunction_t  callback,
void *  context 
)
pure virtual

Sets the callback associated with a given button press.

Parameters
buttonButton to register the callback on
callbackCallback to call
contextContext to pass to the callback

Implemented in UserInterface.

Here is the caller graph for this function:

◆ 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
valueThe value to set

Implemented in UserInterface.

Here is the caller graph for this function:

◆ setLed()

virtual void IUserInterface::setLed ( LED  led,
bool  state 
)
pure virtual

Sets an LED on or off.

Parameters
ledwich led to toggle
statewhich state to put the led (on or off)

Implemented in UserInterface.

Here is the caller graph for this function:

◆ setRGBLed()

virtual void IUserInterface::setRGBLed ( RgbColor  color)
pure virtual

Sets the RGB LED to a given color.

Parameters
colorThe color to set

Implemented in UserInterface.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: