# Secondary Display Constants and Definitions This document provides Secondary Display (LSG 0x2B) specific constants, enumerations, and implementation details. ## Standard Functions | FCT | | | | | -------- | ------------------- | --------- | -------------------------------------------- | | **0x10** | ASG_Capabilities | ASG → FSG | Declare ASG display/input capabilities | | **0x11** | ASG_Config | ASG → FSG | Configure ASG-specific parameters | | 0x10 | ASG_Capabilities | ASG → FSG | ASG display capabilities | | 0x11 | ASG_Config | ASG → FSG | ASG configuration | | 0x12 | MFL_BlockDefinition | ASG → FSG | Multi-function steering wheel button mapping | | 0x13 | FrameStatus | ASG ↔ FSG | Frame/screen status | | 0x14 | FrameData | ASG → FSG | Screen content data | | 0x15 | FrameDataAck | FSG → ASG | Acknowledge frame data | | 0x16 | ScrollBar | ASG ↔ FSG | Scrollbar position/screen selection | | 0x17 | LsgStatus | ASG ↔ FSG | LSG operational status | ## Frame Management ### Frame IDs ```c KPB_FRAME_ID_INVALID = 0x00 // Invalid frame KPB_FRAME_ID_1 = 0x01 // Frame 1 KPB_FRAME_ID_2 = 0x02 // Frame 2 KPB_FRAME_ID_3 = 0x03 // Frame 3 KPB_FRAME_ID_4 = 0x04 // Frame 4 KPB_FRAME_ID_5 = 0x05 // Frame 5 KPB_FRAME_ID_6 = 0x06 // Frame 6 KPB_FRAME_ID_7 = 0x07 // Frame 7 KPB_FRAME_ID_ANY = 0xFE // Any available frame KPB_FRAME_ID_NOT_AVAIL = 0xFF // Frame not available ``` ### Frame Status Communication States **ASG Response Values:** ```c KPB_ASG_SET_V_IS_OFF = 0x00 // ASG set visibility off KPB_ASG_SET_V_IS_ON = 0x01 // ASG set visibility on KPB_ASG_QUEUED_UP = 0x02 // Request queued KPB_ASG_REQ_V_IS_ON = 0x03 // ASG requests visibility on KPB_ASG_NO_RESPONSE = 0xFF // No response ``` **FSG Request Values:** ```c KPB_FSG_REQ_V_IS_OFF = 0x00 // FSG requests visibility off KPB_FSG_REQ_V_IS_ON = 0x01 // FSG requests visibility on KPB_FSG_ACCEPT_ASG_REQ = 0x02 // FSG accepts ASG request KPB_FSG_REFUSE_ASG_REQ = 0x03 // FSG refuses ASG request KPB_FSG_REQ_V_IS_OFF_MENUE_QUIT_SHORT = 0x04 // Menu quit (short) KPB_FSG_REQ_V_IS_OFF_MENUE_QUIT_LONG = 0x05 // Menu quit (long) KPB_FSG_NO_REQUEST = 0xFF // No request ``` ## Display Configuration ### Display Size Classes ```c KPB_DISP_SIZE_SMALL = 0x00 // 3 lines, ~21 characters KPB_DISP_SIZE_MEDIUM = 0x01 // 5 lines, ~31 characters KPB_DISP_SIZE_LARGE = 0x02 // 8+ lines ``` ### Character Limits per Display Class - **Small Display**: 21 characters per line - **Medium Display**: 31 characters per line - **Large Display**: Variable (defined by ASG) ## Cell Types and Attributes ### Cell Entry Types ```c KPB_CELL_TYPE_ANY_STRING = 0x00 // Generic text KPB_CELL_TYPE_DIRECTORY = 0x01 // Directory entry KPB_CELL_TYPE_FILE_NAME = 0x02 // File name KPB_CELL_TYPE_PHONE_NUMBER = 0x03 // Phone number KPB_CELL_TYPE_MENU_ITEM = 0x04 // Menu item KPB_CELL_TYPE_CHECK_BOX = 0x05 // Checkbox KPB_CELL_TYPE_RADIO_BUTTON = 0x06 // Radio button KPB_CELL_TYPE_SPELLER = 0x07 // Text input KPB_CELL_TYPE_SUB_MENU = 0x08 // Submenu entry ``` ### Cell Attributes (Bit Flags) ```c KPB_CELL_ATTRIBUTE_VISIBLE = 0x80 // Item is visible KPB_CELL_ATTRIBUTE_ACTIVATED = 0x08 // Checkbox/radio selected KPB_CELL_ATTRIBUTE_SELECTED = 0x04 // OK button pressed KPB_CELL_ATTRIBUTE_FOCUSED = 0x02 // Item is highlighted KPB_CELL_ATTRIBUTE_SELECTABLE = 0x01 // Item can be selected ``` ## Scrollbar Configuration ### Scrollbar Attributes ```c KPB_SB_ATTRIBUTE_SHOW_ARROWS = 0x01 // Show scroll arrows KPB_SB_ATTRIBUTE_ENDLESS_LIST = 0x02 // Wrap-around scrolling KPB_SB_ATTRIBUTE_IS_POPUP = 0x04 // Popup window mode ``` ### List Operations ```c KPB_NO_LIST_OPERATION = 0x00 // No operation KPB_LIST_UP = 0x01 // Move up one item KPB_LIST_DOWN = 0x02 // Move down one item KPB_PAGE_FLIP_UP = 0x03 // Page up KPB_PAGE_FLIP_DOWN = 0x04 // Page down KPB_FAST_SCROLLING_UP = 0x05 // Fast scroll up KPB_FAST_SCROLLING_DOWN = 0x06 // Fast scroll down KPB_FAST_PAGE_FLIP_UP = 0x07 // Fast page up KPB_FAST_PAGE_FLIP_DOWN = 0x08 // Fast page down KPB_MOVING_TO_TOP_OF_LIST = 0x09 // Jump to top KPB_MOVING_TO_BOTTOM_OF_LIST = 0x0A // Jump to bottom KPB_MENU_CHANGE = 0x0B // Menu changed (v1.10+) KPB_ENTER_MENUE = 0x0C // Enter menu (v1.11+) KPB_LEAVE_MENUE = 0x0D // Leave menu (v1.11+) ``` ## Multi-Function Steering Wheel (MFL) ### Key Block Definitions ```c KPB_KB_NO_KEYS = 0x00 // No keys assigned KPB_KB_ALL_SHARED_MFL_KEYS = 0x01 // All shared MFL keys KPB_KB_UP_DOWN = 0x02 // Up/Down keys KPB_KB_LEFT_RIGHT = 0x03 // Left/Right keys KPB_KB_UP_DOWN_LEFT_RIGHT_OK = 0x04 // D-pad + OK KPB_KB_ROTARY_1 = 0x05 // Rotary encoder 1 KPB_KB_ROTARY_2 = 0x06 // Rotary encoder 2 KPB_KB_OK = 0x07 // OK button KPB_KB_BACK = 0x08 // Back button ``` ## FrameData Array Modes ### Array Mode Flags ```c KPB_ARRAY_MODE_NAME_ONLY = 0x01 // Send only names KPB_ARRAY_MODE_TYPE_ONLY = 0x02 // Send only types KPB_ARRAY_MODE_ATTRIBUTES_ONLY = 0x04 // Send only attributes KPB_ARRAY_MODE_BACKWARD_ONLY = 0x10 // Reverse order KPB_ARRAY_MODE_POSITION_ONLY = 0x40 // Position info only ``` ### Frame Data Receive Address Flags ```c KPB_FRAME_DATA_REC_ADDR_NAME = 0x01 // Receive names KPB_FRAME_DATA_REC_ADDR_TYPE = 0x02 // Receive types KPB_FRAME_DATA_REC_ADDR_ATTR = 0x04 // Receive attributes ``` ## System Limits ### Maximum Values ```c KPB_MAX_FRAME_CELL_NUMBER = 12 // Max cells per frame KPB_MAX_CELLS_PER_ARRAY = 6 // Max cells in array msg KPB_MAX_KEY_BLOCK_NUMBER = 8 // Max key blocks KPB_MAX_CELL_CONTENT_SIZE = 93 // Max bytes per cell MAX_CHARACTERS_PER_CELL_FOR_PHONE_NUMBERS = 32 // Phone numbers ``` ## Version Support ### Protocol Versions ```c KPB_VERSION_UNSUPPORTED = 0x00 // Not supported KPB_VERSION_1_0 = 0x01 // Version 1.0 KPB_VERSION_1_1 = 0x02 // Version 1.1 ``` ## Usage Examples ### Setting Cell Attributes ```python # Make a menu item visible and selectable attributes = KPB_CELL_ATTRIBUTE_VISIBLE | KPB_CELL_ATTRIBUTE_SELECTABLE # Result: 0x81 # Focused checkbox that's checked attributes = (KPB_CELL_ATTRIBUTE_VISIBLE | KPB_CELL_ATTRIBUTE_FOCUSED | KPB_CELL_ATTRIBUTE_ACTIVATED) # Result: 0x8A ``` ### Configuring Display ```python # Small display with 3 visible elements asg_capabilities = [KPB_DISP_SIZE_SMALL, 0x03] # Medium display with 5 visible elements asg_capabilities = [KPB_DISP_SIZE_MEDIUM, 0x05] ``` ### MFL Key Assignment ```python # Assign D-pad + OK to key block 0 mfl_blocks = [KPB_KB_UP_DOWN_LEFT_RIGHT_OK, 0, 0, 0, 0, 0, 0, 0] ``` ## Related Documentation - [[Secondary Display Overview|Secondary Display Overview]] - [[Icon Mappings|Icon Reference]] - [[core/Opcodes and Function IDs|Standard BAP Functions]]