diff --git a/examples/platform/silabs/display/demo-ui-bitmaps.h b/examples/platform/silabs/display/demo-ui-bitmaps.h index b5a6103a8fddb2..2a46413adad5b9 100644 --- a/examples/platform/silabs/display/demo-ui-bitmaps.h +++ b/examples/platform/silabs/display/demo-ui-bitmaps.h @@ -29,6 +29,10 @@ #define ZIGBEE_BITMAP_WIDTH 16 #define ZIGBEE_BITMAP_HEIGHT 16 +#define ZIGBEE_BITMAP \ + 0x3f, 0xfc, 0x07, 0xf0, 0xff, 0xc7, 0xff, 0x9f, 0x01, 0x9c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01, 0xe0, 0x00, 0x70, \ + 0x80, 0x39, 0x80, 0xf9, 0xff, 0xfb, 0xff, 0x07, 0xe0, 0x1f, 0xfc + #define RAIL_BITMAP_WIDTH 16 #define RAIL_BITMAP_HEIGHT 16 diff --git a/examples/platform/silabs/display/demo-ui.c b/examples/platform/silabs/display/demo-ui.c index ff207fa26656a7..03a997fbcf9baa 100644 --- a/examples/platform/silabs/display/demo-ui.c +++ b/examples/platform/silabs/display/demo-ui.c @@ -23,6 +23,7 @@ #include "dmd/dmd.h" #include "em_types.h" #include "glib.h" +#include "sl_component_catalog.h" #include "sl_memlcd.h" #if SL_WIFI && !SIWX_917 #include "spi_multiplex.h" @@ -41,12 +42,8 @@ #define PROT2_ID_X_POSITION 79 // Matter Logo -#define PROT2_BITMAP_WIDTH MATTER_LOGO_WIDTH -#define PROT2_BITMAP_HEIGHT MATTER_LOGO_HEIGHT #define PROT2_X_POSITION 104 #define PROT2_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2)) -#define PROT2_BITMAP (matterLogoBitmap) -#define PROT2_BITMAP_CONN (matterLogoBitmap) // Networking Protocol Logo #ifdef SL_WIFI @@ -54,15 +51,16 @@ #define PROT1_BITMAP_HEIGHT WIFI_BITMAP_HEIGHT #define PROT1_X_POSITION 8 #define PROT1_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2)) -#define PROT1_BITMAP (networkBitMap) -#define PROT1_BITMAP_CONN (networkBitMap) #else #define PROT1_BITMAP_WIDTH THREAD_BITMAP_WIDTH #define PROT1_BITMAP_HEIGHT THREAD_BITMAP_HEIGHT #define PROT1_X_POSITION 8 +#ifdef SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT +#define ZIGBEE_POSITION_Y (APP_Y_POSITION + (APP_Y_POSITION / 2) + (ZIGBEE_BITMAP_HEIGHT / 2)) +#define PROT1_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2) - (ZIGBEE_BITMAP_HEIGHT / 2)) +#else #define PROT1_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2)) -#define PROT1_BITMAP (networkBitMap) -#define PROT1_BITMAP_CONN (networkBitMap) +#endif #endif /******************************************************************************* @@ -82,6 +80,10 @@ static const uint8_t networkBitMap[] = { WIFI_BITMAP }; static const uint8_t networkBitMap[] = { THREAD_BITMAP }; #endif +#ifdef SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT +static const uint8_t zigbeeBitMap[] = { ZIGBEE_BITMAP }; +#endif + // Future usage // static const uint8_t unconnectedBitMap[] = { QUESTION_MARK_BITMAP }; @@ -135,14 +137,13 @@ void demoUIDisplayApp(bool on) updateDisplay(); } -void demoUIDisplayProtocol(demoUIProtocol protocol, bool isConnected) +void demoUIDisplayProtocols() { - GLIB_drawBitmap(&glibContext, (protocol == DEMO_UI_PROTOCOL1 ? PROT1_X_POSITION : PROT2_X_POSITION), - (protocol == DEMO_UI_PROTOCOL1 ? PROT1_Y_POSITION : PROT2_Y_POSITION), - (protocol == DEMO_UI_PROTOCOL1 ? PROT1_BITMAP_WIDTH : PROT2_BITMAP_WIDTH), - (protocol == DEMO_UI_PROTOCOL1 ? PROT1_BITMAP_HEIGHT : PROT2_BITMAP_HEIGHT), - (protocol == DEMO_UI_PROTOCOL1 ? (isConnected ? PROT1_BITMAP_CONN : PROT1_BITMAP) - : (isConnected ? PROT2_BITMAP_CONN : PROT2_BITMAP))); + GLIB_drawBitmap(&glibContext, PROT2_X_POSITION, PROT2_Y_POSITION, MATTER_LOGO_WIDTH, MATTER_LOGO_HEIGHT, matterLogoBitmap); + GLIB_drawBitmap(&glibContext, PROT1_X_POSITION, PROT1_Y_POSITION, PROT1_BITMAP_WIDTH, PROT1_BITMAP_HEIGHT, networkBitMap); +#ifdef SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT + GLIB_drawBitmap(&glibContext, PROT1_X_POSITION, ZIGBEE_POSITION_Y, ZIGBEE_BITMAP_WIDTH, ZIGBEE_BITMAP_HEIGHT, zigbeeBitMap); +#endif updateDisplay(); } @@ -151,6 +152,5 @@ void demoUIClearMainScreen(uint8_t * name) GLIB_clear(&glibContext); demoUIDisplayHeader((char *) name); demoUIDisplayApp(false); - demoUIDisplayProtocol(DEMO_UI_PROTOCOL1, false); - demoUIDisplayProtocol(DEMO_UI_PROTOCOL2, false); + demoUIDisplayProtocols(); } diff --git a/examples/platform/silabs/display/demo-ui.h b/examples/platform/silabs/display/demo-ui.h index baf4902ef6184b..aac7d4aa4640c9 100644 --- a/examples/platform/silabs/display/demo-ui.h +++ b/examples/platform/silabs/display/demo-ui.h @@ -126,7 +126,7 @@ void demoUIDisplayApp(bool on); * @return * void *****************************************************************************/ -void demoUIDisplayProtocol(demoUIProtocol protocol, bool isConnected); +void demoUIDisplayProtocols(); /**************************************************************************/ /**