![]() |
OSCR
Open Source Cartridge Reader
|
User interface methods. More...
Namespaces | |
| namespace | NeoPixel |
| NeoPixel-specific methods and variables. | |
| namespace | ProgressBar |
| Progress bar methods. | |
Classes | |
| class | Button |
| class | FlashTemplateMenu |
| class | IntegerTemplateMenu |
| class | Menu |
| An interface for handling menus. More... | |
| class | MenuBase |
| A base interface for handling menus. More... | |
| struct | MenuOptions |
| Data struct for Menu instances. More... | |
| class | MenuOptionsMenu |
| class | MenuRenderer |
| Abstract menu renderer class. More... | |
| class | RangeSelect |
| struct | rgb_t |
| A structured RGB value. More... | |
Enumerations | |
| enum | UserInput : uint8_t { kUserInputIgnore , kUserInputConfirm , kUserInputNext , kUserInputBack , kUserInputConfirmShort , kUserInputConfirmLong , kUserInputUnknown } |
| enum | InterfaceInput : uint8_t { kInterfaceInputIgnore , kInterfaceInputPress , kInterfaceInputPressDouble , kInterfaceInputPressShort , kInterfaceInputPressLong } |
| enum | NavDir : bool { kNavDirBackward , kNavDirForward } |
| enum | MenuMode : uint8_t { kMenuFlashString , kMenuRamFlashString , kMenuOptionStruct , kMenuNullChar , kMenuFlashStringTemplate , kMenuIntegerTemplate } |
Functions | |
| void | drowse () |
| void | sleep () |
| void | wake () |
| void | wait () |
| void | waitButton () |
| UserInput | waitInput () |
| void | setup () |
| void | blinkLED () |
| void | update () |
| void | clear () |
| void | clearLine () |
| UserInput | checkButton () |
| uint16_t | rangeSelect (__FlashStringHelper const *menuTitle, uint16_t const rangeMax) |
| uint16_t | rangeSelect (__FlashStringHelper const *menuTitle, uint16_t const rangeMin, uint16_t const rangeMax) |
| uint16_t | rangeSelect (__FlashStringHelper const *menuTitle, uint16_t const rangeMin, uint16_t const rangeMax, uint16_t const startAt) |
| uint8_t | menu (__FlashStringHelper const *menuTitle, char const *const menuEntries[], uint8_t entryCount) |
| uint8_t | menu (char const *menuTitle, char const *const menuEntries[], uint8_t entryCount) |
| uint8_t | menu (__FlashStringHelper const *menuTitle, __FlashStringHelper const *const *menuEntries, uint8_t entryCount) |
| uint8_t | menu (char const *menuTitle, __FlashStringHelper const *const *menuEntries, uint8_t entryCount) |
| uint8_t | menu (__FlashStringHelper const *menuTitle, char *menuEntries[], uint8_t entryCount, uint8_t entryLength=((uint8_t) 31)) |
| uint8_t | menu (char const *menuTitle, char *menuEntries[], uint8_t entryCount, uint8_t entryLength=((uint8_t) 31)) |
| uint8_t | menu (__FlashStringHelper const *menuTitle, __FlashStringHelper const *templateStr, char const *const menuEntries[], uint8_t entryCount) |
| uint8_t | menu (char const *menuTitle, __FlashStringHelper const *templateStr, char const *const menuEntries[], uint8_t entryCount) |
| template<typename T, OSCR::Util::enable_if_t< OSCR::Util::is_integer< T >::value, bool > Enable = true> | |
| uint8_t | menu (__FlashStringHelper const *menuTitle, __FlashStringHelper const *templateStr, T const *menuEntries, uint8_t entryCount) |
| template<typename T, OSCR::Util::enable_if_t< OSCR::Util::is_integer< T >::value, bool > Enable = true> | |
| uint8_t | menu (char const *menuTitle, __FlashStringHelper const *templateStr, T const *menuEntries, uint8_t entryCount) |
| template<uint8_t optionCount, uint8_t optionLength> | |
| uint8_t | menu (__FlashStringHelper const *menuTitle, MenuOptions< optionCount, optionLength > &menuEntries) |
| template<uint8_t optionCount, uint8_t optionLength> | |
| uint8_t | menu (char const *menuTitle, MenuOptions< optionCount, optionLength > &menuEntries) |
| void | printHeader (char const *title) |
| void | printHeader (__FlashStringHelper const *title) |
| void | printNotificationHeader (char const *title) |
| void | printNotificationHeader (__FlashStringHelper const *title) |
| void | printErrorHeader (char const *title) |
| void | printErrorHeader (__FlashStringHelper const *title) |
| void | printFatalErrorHeader (char const *title) |
| void | printFatalErrorHeader (__FlashStringHelper const *title) |
| template<bool prfx = true, typename T, OSCR::Util::if_is_any_unsigned_t< T > Enable = true> | |
| void | printHex (T number) |
| template<bool prfx = true, typename T, OSCR::Util::if_is_any_unsigned_t< T > Enable = true> | |
| void | printHexLine (T number) |
| template<bool sync = false, typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable = true, OSCR::Util::enable_if_t<!(OSCR::Util::is_printable< T >::value), bool > NonPrintable = true> | |
| void | print (T string) |
| template<bool sync = false, typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable = true, OSCR::Util::enable_if_t<!(OSCR::Util::is_printable< T >::value), bool > NonPrintable = true> | |
| void | printLine (T string) |
| template<typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable = true, OSCR::Util::enable_if_t<!(OSCR::Util::is_printable< T >::value), bool > NonPrintable = true> | |
| void | printSync (T string) |
| template<typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable = true, OSCR::Util::enable_if_t<!(OSCR::Util::is_printable< T >::value), bool > NonPrintable = true> | |
| void | printLineSync (T string) |
| template<bool sync = false> | |
| void | printLine (void) |
| void | printLineSync (void) |
| template<bool sync = false, typename Tint, OSCR::Util::enable_if_t< OSCR::Util::is_integer< Tint >::value, bool > Enable = true> | |
| void | print (Tint number, int base=10) |
| template<bool sync = false, typename Tint, OSCR::Util::enable_if_t< OSCR::Util::is_integer< Tint >::value, bool > Enable = true> | |
| void | printLine (Tint number, int base=10) |
| template<bool sync = false, typename Tint, OSCR::Util::enable_if_t< OSCR::Util::is_integer< Tint >::value, bool > Enable = true> | |
| void | printSync (Tint number, int base=10) |
| template<bool sync = false, typename Tint, OSCR::Util::enable_if_t< OSCR::Util::is_integer< Tint >::value, bool > Enable = true> | |
| void | printLineSync (Tint number, int base=10) |
| void | setLineRel (int8_t numLines) |
| void | gotoLast () |
| void | gotoLine (uint8_t lineNumber) |
| void | gotoLineBottom (uint8_t lineNumber) |
| bool | overlapsCurrentLine (uint8_t lineNumber) |
| bool | overlapsCurrentLineBottom (uint8_t lineNumber) |
| void | _notificationFormat () |
| void | _notification (void) |
| void | _errorFormat () |
| void | _error () |
| void | _fatalErrorFormat () |
| void | _fatalError () |
| void | notification (void) |
| template<typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable = true> | |
| void | notification (T message) |
| void | error (void) |
| template<typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable = true> | |
| void | error (T message) |
| void | fatalError (void) |
| template<typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable = true> | |
| void | fatalError (T message) |
| void | ncFatalErrorStorage () |
| void | fatalErrorStorage () |
| void | fatalErrorBufferOverflow () |
| void | fatalErrorNameOverflow () |
| void | fatalErrorNoBuffer () |
| void | fatalErrorInvalidData () |
| void | print (OSCR::Storage::Path const *path) |
| void | printLine (OSCR::Storage::Path const *path) |
| void | print (OSCR::Storage::Path const &path) |
| void | printLine (OSCR::Storage::Path const &path) |
| void | printSync (OSCR::Storage::Path const *path) |
| void | printLineSync (OSCR::Storage::Path const *path) |
| void | printSync (OSCR::Storage::Path const &path) |
| void | printLineSync (OSCR::Storage::Path const &path) |
| void | print (OSCR::CRC32::crc32_t const *crc32) |
| void | printLine (OSCR::CRC32::crc32_t const *crc32) |
| void | print (OSCR::CRC32::crc32_t const &crc32) |
| void | printLine (OSCR::CRC32::crc32_t const &crc32) |
| void | printSync (OSCR::CRC32::crc32_t const *crc32) |
| void | printLineSync (OSCR::CRC32::crc32_t const *crc32) |
| void | printSync (OSCR::CRC32::crc32_t const &crc32) |
| void | printLineSync (OSCR::CRC32::crc32_t const &crc32) |
| template<typename T, OSCR::Util::if_is_integer_t< T > Enable> | |
| uint8_t | menu (__FlashStringHelper const *menuTitle, __FlashStringHelper const *templateStr, T const *menuEntries, uint8_t entryCount) |
| template<typename T, OSCR::Util::if_is_integer_t< T > Enable> | |
| uint8_t | menu (char const *menuTitle, __FlashStringHelper const *templateStr, T const *menuEntries, uint8_t entryCount) |
| void | printLine (void) |
| template<typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable, OSCR::Util::enable_if_t<!(OSCR::Util::is_printable< T >::value), bool > NonPrintable> | |
| void | print (T string) |
| template<typename T, OSCR::Util::enable_if_t<!(OSCR::Util::is_number< T >::value), bool > Enable, OSCR::Util::enable_if_t<!(OSCR::Util::is_printable< T >::value), bool > NonPrintable> | |
| void | printLine (T string) |
| template<typename Tint, OSCR::Util::enable_if_t< OSCR::Util::is_integer< Tint >::value, bool > Enable> | |
| void | print (Tint number, int base) |
| template<typename Tint, OSCR::Util::enable_if_t< OSCR::Util::is_integer< Tint >::value, bool > Enable> | |
| void | printLine (Tint number, int base) |
| bool | getCommand () |
Variables | |
| constexpr uint32_t const | kLongHold = 5000 |
| constexpr uint32_t const | kShortHold = 2000 |
| constexpr uint32_t const | kDoubleClick = 250 |
| constexpr uint32_t const | kDebounceDelay = 20 |
| bool const | kSupportsLineAdjments |
| uint8_t const | kDisplayWidth |
| Display width in pixels (0 = unsupported). | |
| uint8_t const | kDisplayHeight |
| Display height in pixels (0 = unsupported). | |
| uint8_t const | kLineHeight |
| Line height in pixels (0 = unsupported). | |
| uint8_t const | kDisplayLines |
| Lines that can be seen at once (0 = unlimited). | |
| uint8_t const | kDisplayLineStart |
| Y position of the first line. | |
| bool | menuActive = false |
| uint8_t | menuSelection = 0 |
| uint8_t | selection = 0 |
| char | command [commandMax] |
User interface methods.
| enum OSCR::UI::InterfaceInput : uint8_t |
Enumeration of interface input events.
| enum OSCR::UI::MenuMode : uint8_t |
| enum OSCR::UI::NavDir : bool |
Enumeration of navigation events.
| enum OSCR::UI::UserInput : uint8_t |
Enumeration of user input events.
|
extern |
|
extern |
|
extern |
Internal function implemented by the UI output implementation which is called when a fatal error occurs.
|
extern |
Internal function implemented by the UI output implementation which is called when a fatal error occurs, before any output.
|
extern |
Internal function implemented by the UI output implementation which is called when a notification occurs.
|
extern |
Internal function implemented by the UI output implementation which is called when a notification occurs, before any output.
|
extern |
Toggle the LED
Toggle the LED present on some hardware versions
|
extern |
Check for user input.
|
extern |
Clear the output.
|
extern |
Clear the current line. Creates a newline if unsupported.
|
extern |
Enter drowse state (dim displays, LEDs, etc.)
|
extern |
Output an error message and wait for input to continue.
| message | The message to output. |
| T | Any non-numeric type supported by printLine() |
|
extern |
Set the error format but don't output anything.
|
extern |
Output an error message and wait for input to reset.
| message | The message to output. |
| T | Any non-numeric type supported by printLine() |
|
extern |
Set the fatal error format but don't output anything.
|
extern |
Clear and output a fatal buffer overflow message.
|
extern |
Clear and output a fatal invalid data message.
|
extern |
Clear and output a fatal buffer overflow (name) message.
|
extern |
Clear and output a fatal no buffer message.
|
extern |
Clear and output a fatal SD error message.
|
extern |
Go to the last line of the display. For outputs without a fixed number of lines, such as serial, this will output one new line instead.
|
extern |
Go to the specified line of the display. For outputs without a way to change lines, such as ASCII serial, this does nothing.
| lineNumber | The line number. |
|
extern |
Go to the specified line of the display, counting from the bottom. For outputs without a way to change lines, such as ASCII serial, this prints a new line instead.
| lineNumber | The line number. |
|
extern |
Prompt a user to select from an array of choices and return the index of the selection.
| menuTitle | A flash string to use for the menu title. |
| menuEntries | An array of flash strings located in SRAM. |
| entryCount | How many entries are in menuEntries (usually sizeofarray(menuEntries)). |
|
extern |
Prompt a user to select from an array of choices and return the index of the selection.
| menuTitle | A flash string to use for the menu title. |
| menuEntries | An array of null-terminated strings. |
| entryCount | Total entries in menuEntries (usually sizeofarray(menuEntries)). |
| entryLength | Maxinum length of an entry in menuEntries. |
|
extern |
Prompt a user to select from an array of choices and return the index of the selection.
| menuTitle | A flash string to use for the menu title. |
| menuEntries | An array of flash strings located in PROGMEM. |
| entryCount | How many entries are in menuEntries (usually sizeofarray(menuEntries)). |
|
extern |
Prompt a user to select from an array of choices and return the index of the selection.
| menuTitle | A flash string to use for the menu title. |
| menuEntries | An instance of MenuOptions ready for use. |
|
extern |
Output a fatal SD error message.
|
extern |
Output a notification message and wait for input to continue.
| message | The message to output. |
| T | Any non-numeric type supported by printLine() |
|
extern |
Set the notification format but don't output anything.
|
extern |
Checks if the specified line number will overlap the current line. For outputs without a way to change lines, such as ASCII serial, this is always false.
| lineNumber | The line number. |
|
extern |
Checks if the specified line number, counting from the bottom, will overlap the current line. For outputs without a way to change lines, such as ASCII serial, this is always false.
| lineNumber | The line number. |
|
extern |
Output a string to the UI.
| string | The string to output. |
| T | A type of string |
|
extern |
Output a number to the UI.
| number | The number to output. |
| base | The base to display the number in. |
| Tint | A type of interger |
|
extern |
Print a string using the error header format.
|
extern |
Print a string using the fatal error header format.
|
extern |
Print a string using the header format.
|
extern |
Print a number as hex.
| number | The number to print. |
|
extern |
Print a number as hex, followed by a new line.
| number | The number to print. |
|
extern |
Output a string and a newline character to the UI.
| string | The string to output. |
| T | A type of string |
|
extern |
Output a number and a newline character to the UI.
| number | The number to output. |
| base | The base to display the number in. |
| Tint | A type of interger |
|
extern |
Output a newline character to the UI.
| string | The string to output. |
|
inline |
Output a string and a newline character to the UI.
| string | The string to output. |
| T | A type of string |
|
extern |
Output a number and a newline character to the UI.
| number | The number to output. |
| base | The base to display the number in. |
| Tint | A type of interger |
|
inline |
Output a newline character to the UI.
| string | The string to output. |
|
extern |
Print a string using the notification header format.
|
inline |
Output a string to the UI.
| string | The string to output. |
| T | A type of string |
|
inline |
Output a number to the UI.
| number | The number to output. |
| base | The base to display the number in. |
| Tint | A type of interger |
|
extern |
Printing doubles is expensive (~1KB), so we don't do it.
These functions are defined as deleted so the compiler error makes more sense. Without this, the compiler complains about the other templates not being a match.
Printing doubles is expensive (~1KB), so we don't do it.
These functions are defined as deleted so the compiler error makes more sense. Without this, the compiler complains about the other templates not being a match.
Move the cursor to the start of a line relative to the current line.
| numLines | The number of lines. |
|
extern |
Run UI setup.
|
extern |
Enter sleep state (disable displays, LEDs, etc.)
|
extern |
Update the output target with any pending data.
|
extern |
Wait for any user input (button press, etc).
|
extern |
Prompt the user to push a button and wait for them to do so.
|
extern |
Wait for any user input and return that input event.
|
extern |
Enter wake state (enable displays, LEDs, etc.)
|
extern |
Display height in pixels (0 = unsupported).
The height of the display in pixels, or 0 if the output does not support graphics.
|
extern |
Lines that can be seen at once (0 = unlimited).
The number of lines the output can shown at a time, or 0 for an unlimited (infinite) number of lines.
|
extern |
Y position of the first line.
The Y position of the first line. This variable can be 0, so check kDisplayLines or another variable for line support.
|
extern |
Display width in pixels (0 = unsupported).
The width of the display in pixels, or 0 if the output does not support graphics.
|
extern |
Line height in pixels (0 = unsupported).
The height of a line on the display in pixels, or 0 if the output does not support graphics.
| bool OSCR::UI::menuActive = false |
Define if a menu is active.
| uint8_t OSCR::UI::menuSelection = 0 |
The user's selection from a menu.
| uint8_t OSCR::UI::selection = 0 |
The user's selection from a non-menu. This allows non-menu methods to ask for numerical input, such as the size of a cartridge, etc. It's split out so they don't need to store the result.