468 #include <ti/drivers/apps/Button.h> 469 #include <ti/drivers/apps/LED.h> 507 #define MAX_CLIENTS 2 509 #ifndef MAX_CLIENT_NAME_LEN 510 #define MAX_CLIENT_NAME_LEN 64 517 #ifndef MAX_REGISTERED_MENUS 518 #define MAX_REGISTERED_MENUS 4 520 #ifndef MAX_MENU_LINE_LEN 521 #define MAX_MENU_LINE_LEN 128 527 #ifndef MAX_STATUS_LINE_LABEL_LEN 528 #define MAX_STATUS_LINE_LABEL_LEN 32 530 #ifndef MAX_STATUS_LINE_VALUE_LEN 531 #define MAX_STATUS_LINE_VALUE_LEN 128 534 #ifndef CUI_MIN_FOOTPRINT 540 #define CUI_MAIN_MENU(_menuSymbol, _pMenuTitle, _numItems, _pMenuUpdateFn) \ 541 CUI_menu_t _menuSymbol = { \ 542 .uartUpdateFn=_pMenuUpdateFn, \ 543 .pTitle=_pMenuTitle, \ 544 .numItems=_numItems + 1, \ 552 #define CUI_SUB_MENU(_menuSymbol, _pMenuTitle, _numItems, _pUpperMenu) \ 553 extern CUI_menu_t _pUpperMenu; \ 554 CUI_menu_t _menuSymbol = { \ 555 .uartUpdateFn=NULL, \ 556 .pTitle=_pMenuTitle, \ 557 .numItems=_numItems + 1, \ 558 .pUpper=&_pUpperMenu, \ 564 #define CUI_MENU_ITEM_SUBMENU(_pSubMenu) { \ 566 .itemType=CUI_MENU_ITEM_TYPE_SUBMENU, \ 567 .item.pSubMenu=(&_pSubMenu)}, 572 #define CUI_MENU_ITEM_ACTION(_pItemDesc, _pFnAction) { \ 573 .pDesc=(_pItemDesc), \ 574 .itemType=CUI_MENU_ITEM_TYPE_ACTION, \ 575 .interceptActive=false, \ 576 .item.pFnAction=(_pFnAction)}, 581 #define CUI_MENU_ITEM_INT_ACTION(_pItemDesc, _pFnIntercept) { \ 582 .pDesc=(_pItemDesc), \ 583 .itemType=CUI_MENU_ITEM_TYPE_INTERCEPT, \ 584 .interceptActive=false, \ 585 .item.pFnIntercept=(_pFnIntercept)}, 590 #define CUI_MENU_ITEM_LIST_ACTION(_pItemDesc, _maxListItems, _pFnListAction) { \ 591 .pDesc=(_pItemDesc), \ 592 .itemType=CUI_MENU_ITEM_TYPE_LIST, \ 593 .interceptActive=false, \ 594 .item.pList=&((CUI_list_t){ \ 595 .pFnListAction=(_pFnListAction), \ 596 .maxListItems=_maxListItems, \ 603 #define CUI_MENU_ITEM_HELP CUI_MENU_ITEM_INT_ACTION(CUI_MENU_ACTION_HELP_DESC, (CUI_pFnIntercept_t) CUI_menuActionHelp) 604 #define CUI_MENU_ITEM_BACK CUI_MENU_ITEM_ACTION(CUI_MENU_ACTION_BACK_DESC, (CUI_pFnAction_t) CUI_menuActionBack) 605 #define CUI_MAIN_MENU_END CUI_MENU_ITEM_HELP }}; 606 #define CUI_SUB_MENU_END CUI_MENU_ITEM_BACK }}; 607 #define CUI_MENU_ACTION_BACK_DESC "< BACK >" 608 #define CUI_MENU_ACTION_HELP_DESC "< HELP >" 611 #define CUI_MAIN_MENU(_menuSymbol, _pMenuTitle, _numItems, _pMenuUpdateFn) \ 612 CUI_menu_t _menuSymbol; 614 #define CUI_SUB_MENU(_menuSymbol, _pMenuTitle, _numItems, _pUpperMenu) \ 615 CUI_menu_t _menuSymbol; 617 #define CUI_MENU_ITEM_SUBMENU(_pSubMenu) 619 #define CUI_MENU_ITEM_ACTION(_pItemDesc, _pFnAction) 621 #define CUI_MENU_ITEM_INT_ACTION(_pItemDesc, _pFnIntercept) 623 #define CUI_MENU_ITEM_LIST_ACTION(_pItemDesc, _maxListItems, _pFnListAction) 625 #define CUI_MENU_ITEM_HELP 626 #define CUI_MENU_ITEM_BACK 627 #define CUI_MAIN_MENU_END 628 #define CUI_SUB_MENU_END 629 #define CUI_MENU_ACTION_BACK_DESC "< BACK >" 630 #define CUI_MENU_ACTION_HELP_DESC "< HELP >" 633 #define CUI_IS_INPUT_NUM(_input) ((_input >= '0') && (_input <= '9')) 634 #define CUI_IS_INPUT_ALPHA(_input) ((_input >= 'a') && (_input <= 'z')) 635 #define CUI_IS_INPUT_ALPHA_NUM(_input) ((CUI_IS_INPUT_ALPHA(_input)) && (CUI_IS_INPUT_NUM(_input))) 636 #define CUI_IS_INPUT_HEX(_input) ((CUI_IS_INPUT_NUM(_input)) || ((_input >= 'a') && (_input <= 'f'))) 637 #define CUI_IS_INPUT_BINARY(_input) ((_input == '0') || (_input == '1')) 642 #define CUI_ITEM_PREVIEW 0x00 645 #define CUI_ITEM_INTERCEPT_START 0xFE 648 #define CUI_ITEM_INTERCEPT_STOP 0xFF 651 #define CUI_ITEM_INTERCEPT_CANCEL 0xF9 653 #define CUI_INPUT_UP 0xFA // Up Arrow 654 #define CUI_INPUT_DOWN 0xFB // Down Arrow 655 #define CUI_INPUT_RIGHT 0xFC // Right Arrow 656 #define CUI_INPUT_LEFT 0xFD // Left Arrow 657 #define CUI_INPUT_BACK 0x7F // Backspace Key 658 #define CUI_INPUT_EXECUTE 0x0D // Enter Key 659 #define CUI_INPUT_ESC 0x1B // ESC (escape) Key 661 #define CUI_COLOR_RESET "\033[0m" 662 #define CUI_COLOR_RED "\033[31m" 663 #define CUI_COLOR_GREEN "\033[32m" 664 #define CUI_COLOR_YELLOW "\033[33m" 665 #define CUI_COLOR_BLUE "\033[34m" 666 #define CUI_COLOR_MAGENTA "\033[35m" 667 #define CUI_COLOR_CYAN "\033[36m" 668 #define CUI_COLOR_WHITE "\033[37m" 670 #define CUI_DEBUG_MSG_START "\0337" 671 #define CUI_DEBUG_MSG_END "\0338" 845 CUI_retVal_t
CUI_menuNav(
const CUI_clientHandle_t _clientHandle,
CUI_menu_t* _pMenu,
const uint32_t _itemIndex);
870 CUI_retVal_t
CUI_statusLinePrintf(
const CUI_clientHandle_t _clientHandle,
const uint32_t _lineId,
const char *format, ...);
886 void CUI_assert(
const char* _assertMsg,
const bool _spinLock);
887 #ifndef CUI_MIN_FOOTPRINT
uint8_t maxStatusLines
Definition: cui.h:712
void(* CUI_pFnListAction_t)(const uint32_t _listIndex, char *_lines[3], bool _selected)
Definition: cui.h:728
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:726
CUI_retVal_t CUI_deRegisterMenu(const CUI_clientHandle_t _clientHandle, CUI_menu_t *_pMenu)
#define MAX_CLIENT_NAME_LEN
Definition: cui.h:510
void CUI_assert(const char *_assertMsg, const bool _spinLock)
uint16_t maxListItems
Definition: cui.h:765
int16_t row
Definition: cui.h:719
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:707
int16_t col
Definition: cui.h:720
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:733
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:727
CUI_retVal
Definition: cui.h:680
void CUI_menuActionBack(const int32_t _itemEntry)
enum CUI_retVal CUI_retVal_t
uint16_t currListIndex
Definition: cui.h:766
CUI_pFnListAction_t pFnListAction
Definition: cui.h:764
void CUI_clientParamsInit(CUI_clientParams_t *_pClientParams)
void(* CUI_pFnClientMenuUpdate_t)(void)
Definition: cui.h:723
enum CUI_menuItems CUI_itemType_t
uint32_t CUI_clientHandle_t
Definition: cui.h:704
#define MAX_STATUS_LINE_LABEL_LEN
Definition: cui.h:528