498 #include <ti/drivers/apps/Button.h> 499 #include <ti/drivers/apps/LED.h> 537 #define MAX_CLIENTS 2 539 #ifndef MAX_CLIENT_NAME_LEN 540 #define MAX_CLIENT_NAME_LEN 64 547 #ifndef MAX_REGISTERED_MENUS 548 #define MAX_REGISTERED_MENUS 4 550 #ifndef MAX_MENU_LINE_LEN 551 #define MAX_MENU_LINE_LEN 128 557 #ifndef MAX_STATUS_LINE_LABEL_LEN 558 #define MAX_STATUS_LINE_LABEL_LEN 32 560 #ifndef MAX_STATUS_LINE_VALUE_LEN 561 #define MAX_STATUS_LINE_VALUE_LEN 128 564 #ifndef CUI_MIN_FOOTPRINT 570 #define CUI_MAIN_MENU(_menuSymbol, _pMenuTitle, _numItems, _pMenuUpdateFn) \ 571 CUI_menu_t _menuSymbol = { \ 572 .uartUpdateFn=_pMenuUpdateFn, \ 573 .pTitle=_pMenuTitle, \ 574 .numItems=_numItems + 1, \ 582 #define CUI_SUB_MENU(_menuSymbol, _pMenuTitle, _numItems, _pUpperMenu) \ 583 extern CUI_menu_t _pUpperMenu; \ 584 CUI_menu_t _menuSymbol = { \ 585 .uartUpdateFn=NULL, \ 586 .pTitle=_pMenuTitle, \ 587 .numItems=_numItems + 1, \ 588 .pUpper=&_pUpperMenu, \ 594 #define CUI_MENU_ITEM_SUBMENU(_pSubMenu) { \ 596 .itemType=CUI_MENU_ITEM_TYPE_SUBMENU, \ 597 .item.pSubMenu=(&_pSubMenu)}, 602 #define CUI_MENU_ITEM_ACTION(_pItemDesc, _pFnAction) { \ 603 .pDesc=(_pItemDesc), \ 604 .itemType=CUI_MENU_ITEM_TYPE_ACTION, \ 605 .interceptActive=false, \ 606 .item.pFnAction=(_pFnAction)}, 611 #define CUI_MENU_ITEM_INT_ACTION(_pItemDesc, _pFnIntercept) { \ 612 .pDesc=(_pItemDesc), \ 613 .itemType=CUI_MENU_ITEM_TYPE_INTERCEPT, \ 614 .interceptActive=false, \ 615 .item.pFnIntercept=(_pFnIntercept)}, 620 #define CUI_MENU_ITEM_LIST_ACTION(_pItemDesc, _maxListItems, _pFnListAction) { \ 621 .pDesc=(_pItemDesc), \ 622 .itemType=CUI_MENU_ITEM_TYPE_LIST, \ 623 .interceptActive=false, \ 624 .item.pList=&((CUI_list_t){ \ 625 .pFnListAction=(_pFnListAction), \ 626 .maxListItems=_maxListItems, \ 633 #define CUI_MENU_ITEM_HELP CUI_MENU_ITEM_INT_ACTION(CUI_MENU_ACTION_HELP_DESC, (CUI_pFnIntercept_t) CUI_menuActionHelp) 634 #define CUI_MENU_ITEM_BACK CUI_MENU_ITEM_ACTION(CUI_MENU_ACTION_BACK_DESC, (CUI_pFnAction_t) CUI_menuActionBack) 635 #define CUI_MAIN_MENU_END CUI_MENU_ITEM_HELP }}; 636 #define CUI_SUB_MENU_END CUI_MENU_ITEM_BACK }}; 637 #define CUI_MENU_ACTION_BACK_DESC "< BACK >" 638 #define CUI_MENU_ACTION_HELP_DESC "< HELP >" 641 #define CUI_MAIN_MENU(_menuSymbol, _pMenuTitle, _numItems, _pMenuUpdateFn) \ 642 CUI_menu_t _menuSymbol; 644 #define CUI_SUB_MENU(_menuSymbol, _pMenuTitle, _numItems, _pUpperMenu) \ 645 CUI_menu_t _menuSymbol; 647 #define CUI_MENU_ITEM_SUBMENU(_pSubMenu) 649 #define CUI_MENU_ITEM_ACTION(_pItemDesc, _pFnAction) 651 #define CUI_MENU_ITEM_INT_ACTION(_pItemDesc, _pFnIntercept) 653 #define CUI_MENU_ITEM_LIST_ACTION(_pItemDesc, _maxListItems, _pFnListAction) 655 #define CUI_MENU_ITEM_HELP 656 #define CUI_MENU_ITEM_BACK 657 #define CUI_MAIN_MENU_END 658 #define CUI_SUB_MENU_END 659 #define CUI_MENU_ACTION_BACK_DESC "< BACK >" 660 #define CUI_MENU_ACTION_HELP_DESC "< HELP >" 663 #define CUI_IS_INPUT_NUM(_input) ((_input >= '0') && (_input <= '9')) 664 #define CUI_IS_INPUT_ALPHA(_input) ((_input >= 'a') && (_input <= 'z')) 665 #define CUI_IS_INPUT_ALPHA_NUM(_input) ((CUI_IS_INPUT_ALPHA(_input)) && (CUI_IS_INPUT_NUM(_input))) 666 #define CUI_IS_INPUT_HEX(_input) ((CUI_IS_INPUT_NUM(_input)) || ((_input >= 'a') && (_input <= 'f'))) 667 #define CUI_IS_INPUT_BINARY(_input) ((_input == '0') || (_input == '1')) 672 #define CUI_ITEM_PREVIEW 0x00 675 #define CUI_ITEM_INTERCEPT_START 0xFE 678 #define CUI_ITEM_INTERCEPT_STOP 0xFF 681 #define CUI_ITEM_INTERCEPT_CANCEL 0xF9 683 #define CUI_INPUT_UP 0xFA // Up Arrow 684 #define CUI_INPUT_DOWN 0xFB // Down Arrow 685 #define CUI_INPUT_RIGHT 0xFC // Right Arrow 686 #define CUI_INPUT_LEFT 0xFD // Left Arrow 687 #define CUI_INPUT_BACK 0x7F // Backspace Key 688 #define CUI_INPUT_EXECUTE 0x0D // Enter Key 689 #define CUI_INPUT_ESC 0x1B // ESC (escape) Key 691 #define CUI_COLOR_RESET "\033[0m" 692 #define CUI_COLOR_RED "\033[31m" 693 #define CUI_COLOR_GREEN "\033[32m" 694 #define CUI_COLOR_YELLOW "\033[33m" 695 #define CUI_COLOR_BLUE "\033[34m" 696 #define CUI_COLOR_MAGENTA "\033[35m" 697 #define CUI_COLOR_CYAN "\033[36m" 698 #define CUI_COLOR_WHITE "\033[37m" 700 #define CUI_DEBUG_MSG_START "\0337" 701 #define CUI_DEBUG_MSG_END "\0338" 875 CUI_retVal_t
CUI_menuNav(
const CUI_clientHandle_t _clientHandle,
CUI_menu_t* _pMenu,
const uint32_t _itemIndex);
900 CUI_retVal_t
CUI_statusLinePrintf(
const CUI_clientHandle_t _clientHandle,
const uint32_t _lineId,
const char *format, ...);
916 void CUI_assert(
const char* _assertMsg,
const bool _spinLock);
917 #ifndef CUI_MIN_FOOTPRINT
uint8_t maxStatusLines
Definition: cui.h:742
void(* CUI_pFnListAction_t)(const uint32_t _listIndex, char *_lines[3], bool _selected)
Definition: cui.h:758
CUI_retVal_t CUI_statusLineResourceRequest(const CUI_clientHandle_t _clientHandle, const char _pLabel[MAX_STATUS_LINE_LABEL_LEN], const bool _refreshInd, uint32_t *_pLineId)
void CUI_paramsInit(CUI_params_t *_pParams)
void(* CUI_pFnAction_t)(const int32_t _itemEntry)
Definition: cui.h:756
CUI_retVal_t CUI_deRegisterMenu(const CUI_clientHandle_t _clientHandle, CUI_menu_t *_pMenu)
#define MAX_CLIENT_NAME_LEN
Definition: cui.h:540
void CUI_assert(const char *_assertMsg, const bool _spinLock)
uint16_t maxListItems
Definition: cui.h:795
int16_t row
Definition: cui.h:749
CUI_retVal_t CUI_processMenuUpdate(void)
CUI_retVal_t CUI_menuNav(const CUI_clientHandle_t _clientHandle, CUI_menu_t *_pMenu, const uint32_t _itemIndex)
CUI_retVal_t CUI_registerMenu(const CUI_clientHandle_t _clientHandle, CUI_menu_t *_pMenu)
bool manageUart
Definition: cui.h:737
int16_t col
Definition: cui.h:750
void CUI_menuActionHelp(const char _input, char *_pLines[3], CUI_cursorInfo_t *_pCurInfo)
CUI_retVal_t CUI_updateMultiMenuTitle(const char *_pTitle)
CUI_menuItems
Definition: cui.h:763
CUI_retVal_t CUI_init(CUI_params_t *_pParams)
CUI_retVal_t CUI_statusLinePrintf(const CUI_clientHandle_t _clientHandle, const uint32_t _lineId, const char *format,...)
void CUI_wrappedIncrement(size_t *_pValue, int32_t _incAmt, size_t _maxValue)
CUI_clientHandle_t CUI_clientOpen(CUI_clientParams_t *_pParams)
void(* CUI_pFnIntercept_t)(const char _input, char *_lines[3], CUI_cursorInfo_t *_curInfo)
Definition: cui.h:757
CUI_retVal
Definition: cui.h:710
void CUI_menuActionBack(const int32_t _itemEntry)
enum CUI_retVal CUI_retVal_t
uint16_t currListIndex
Definition: cui.h:796
CUI_pFnListAction_t pFnListAction
Definition: cui.h:794
void CUI_clientParamsInit(CUI_clientParams_t *_pClientParams)
void(* CUI_pFnClientMenuUpdate_t)(void)
Definition: cui.h:753
enum CUI_menuItems CUI_itemType_t
uint32_t CUI_clientHandle_t
Definition: cui.h:734
#define MAX_STATUS_LINE_LABEL_LEN
Definition: cui.h:558