From 755df739094da0b7da418f9a207be70bdddf42b7 Mon Sep 17 00:00:00 2001 From: jepenven-silabs Date: Thu, 18 Aug 2022 14:25:55 -0400 Subject: [PATCH] Upgrade LCD EFR32 --- examples/chef/efr32/BUILD.gn | 6 +- examples/light-switch-app/efr32/BUILD.gn | 11 +- .../light-switch-app/efr32/src/AppTask.cpp | 21 +- examples/lighting-app/efr32/BUILD.gn | 12 +- examples/lighting-app/efr32/src/AppTask.cpp | 27 +- examples/lock-app/efr32/BUILD.gn | 11 +- examples/lock-app/efr32/src/AppTask.cpp | 20 +- examples/platform/efr32/BaseApplication.cpp | 17 +- examples/platform/efr32/BaseApplication.h | 18 +- .../platform/efr32/display/demo-ui-bitmaps.h | 490 ++++++++++++++++++ examples/platform/efr32/display/demo-ui.c | 136 +++++ examples/platform/efr32/display/demo-ui.h | 128 +++++ .../platform/efr32/display/{lcd.c => lcd.cpp} | 90 +++- examples/platform/efr32/display/lcd.h | 73 +++ examples/platform/efr32/init_efrPlatform.cpp | 8 - examples/platform/efr32/lcd.h | 38 -- examples/window-app/efr32/BUILD.gn | 4 +- .../window-app/efr32/include/LcdPainter.h | 4 +- examples/window-app/efr32/src/LcdPainter.cpp | 11 +- .../window-app/efr32/src/WindowAppImpl.cpp | 13 +- 20 files changed, 1032 insertions(+), 106 deletions(-) create mode 100644 examples/platform/efr32/display/demo-ui-bitmaps.h create mode 100644 examples/platform/efr32/display/demo-ui.c create mode 100644 examples/platform/efr32/display/demo-ui.h rename examples/platform/efr32/display/{lcd.c => lcd.cpp} (62%) create mode 100644 examples/platform/efr32/display/lcd.h delete mode 100644 examples/platform/efr32/lcd.h diff --git a/examples/chef/efr32/BUILD.gn b/examples/chef/efr32/BUILD.gn index efaace05910a0b..662933081bc331 100644 --- a/examples/chef/efr32/BUILD.gn +++ b/examples/chef/efr32/BUILD.gn @@ -246,7 +246,11 @@ efr32_executable("chef_app") { } if (!disable_lcd) { - sources += [ "${examples_plat_dir}/display/lcd.c" ] + sources += [ + "${examples_plat_dir}/display/demo-ui.c", + "${examples_plat_dir}/display/lcd.cpp", + ] + include_dirs += [ "${examples_plat_dir}/display" ] defines += [ "DISPLAY_ENABLED" ] if (show_qr_code) { defines += [ "QR_CODE_ENABLED" ] diff --git a/examples/light-switch-app/efr32/BUILD.gn b/examples/light-switch-app/efr32/BUILD.gn index 026dc46d13195c..3118b7a6dadc18 100644 --- a/examples/light-switch-app/efr32/BUILD.gn +++ b/examples/light-switch-app/efr32/BUILD.gn @@ -253,8 +253,15 @@ efr32_executable("light_switch_app") { } if (!disable_lcd) { - sources += [ "${examples_plat_dir}/display/lcd.c" ] - defines += [ "DISPLAY_ENABLED" ] + sources += [ + "${examples_plat_dir}/display/demo-ui.c", + "${examples_plat_dir}/display/lcd.cpp", + ] + include_dirs += [ "${examples_plat_dir}/display" ] + defines += [ + "DISPLAY_ENABLED", + "IS_DEMO_SWITCH=1", + ] if (show_qr_code) { defines += [ "QR_CODE_ENABLED" ] deps += [ "${chip_root}/examples/common/QRCode" ] diff --git a/examples/light-switch-app/efr32/src/AppTask.cpp b/examples/light-switch-app/efr32/src/AppTask.cpp index 29d9e6527ea8e9..83ac3ac8c94ec7 100644 --- a/examples/light-switch-app/efr32/src/AppTask.cpp +++ b/examples/light-switch-app/efr32/src/AppTask.cpp @@ -70,6 +70,8 @@ namespace { EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; +bool mCurrentButtonState = false; + /********************************************************** * Identify Callbacks *********************************************************/ @@ -146,6 +148,9 @@ AppTask AppTask::sAppTask; CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Light Switch"); +#endif err = BaseApplication::Init(&gIdentify); if (err != CHIP_NO_ERROR) @@ -221,9 +226,23 @@ void AppTask::SwitchActionEventHandler(AppEvent * aEvent) if (aEvent->Type == AppEvent::kEventType_Button) { BindingCommandData * data = Platform::New(); - data->commandId = chip::app::Clusters::OnOff::Commands::Toggle::Id; data->clusterId = chip::app::Clusters::OnOff::Id; + if (mCurrentButtonState) + { + mCurrentButtonState = false; + data->commandId = chip::app::Clusters::OnOff::Commands::Off::Id; + } + else + { + data->commandId = chip::app::Clusters::OnOff::Commands::On::Id; + mCurrentButtonState = true; + } + +#ifdef DISPLAY_ENABLED + sAppTask.GetLCD().WriteDemoUI(mCurrentButtonState); +#endif + DeviceLayer::PlatformMgr().ScheduleWork(SwitchWorkerFunction, reinterpret_cast(data)); } } diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 81a25554eb9ba2..76430e8586e8d3 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -253,8 +253,16 @@ efr32_executable("lighting_app") { } if (!disable_lcd) { - sources += [ "${examples_plat_dir}/display/lcd.c" ] - defines += [ "DISPLAY_ENABLED" ] + sources += [ + "${examples_plat_dir}/display/demo-ui.c", + "${examples_plat_dir}/display/lcd.cpp", + ] + + include_dirs += [ "${examples_plat_dir}/display" ] + defines += [ + "DISPLAY_ENABLED", + "IS_DEMO_LIGHT=1", + ] if (show_qr_code) { defines += [ "QR_CODE_ENABLED" ] diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp index d8fe8940ce3434..89963785b8f02b 100644 --- a/examples/lighting-app/efr32/src/AppTask.cpp +++ b/examples/lighting-app/efr32/src/AppTask.cpp @@ -21,12 +21,7 @@ #include "AppConfig.h" #include "AppEvent.h" #include "LEDWidget.h" -#ifdef DISPLAY_ENABLED -#include "lcd.h" -#ifdef QR_CODE_ENABLED -#include "qrcodegen.h" -#endif // QR_CODE_ENABLED -#endif // DISPLAY_ENABLED + #include "sl_simple_led_instances.h" #include #include @@ -132,6 +127,9 @@ AppTask AppTask::sAppTask; CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Lighting-App"); +#endif err = BaseApplication::Init(&gIdentify); if (err != CHIP_NO_ERROR) @@ -266,16 +264,13 @@ void AppTask::ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAc void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) { // Action initiated, update the light led - if (aAction == LightingManager::ON_ACTION) - { - EFR32_LOG("Turning light ON") - sLightLED.Set(true); - } - else if (aAction == LightingManager::OFF_ACTION) - { - EFR32_LOG("Turning light OFF") - sLightLED.Set(false); - } + bool lightOn = aAction == LightingManager::ON_ACTION; + EFR32_LOG("Turning light %s", (lightOn) ? "On" : "Off") + sLightLED.Set(lightOn); + +#ifdef DISPLAY_ENABLED + sAppTask.GetLCD().WriteDemoUI(lightOn); +#endif if (aActor == AppEvent::kEventType_Button) { diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index c98bebfed6d942..bb6530f56e5313 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -250,8 +250,15 @@ efr32_executable("lock_app") { } if (!disable_lcd) { - sources += [ "${examples_plat_dir}/display/lcd.c" ] - defines += [ "DISPLAY_ENABLED" ] + sources += [ + "${examples_plat_dir}/display/demo-ui.c", + "${examples_plat_dir}/display/lcd.cpp", + ] + include_dirs += [ "${examples_plat_dir}/display" ] + defines += [ + "DISPLAY_ENABLED", + "IS_DEMO_LOCK=1", + ] if (show_qr_code) { defines += [ "QR_CODE_ENABLED" ] deps += [ "${chip_root}/examples/common/QRCode" ] diff --git a/examples/lock-app/efr32/src/AppTask.cpp b/examples/lock-app/efr32/src/AppTask.cpp index 8b72c5aac4a28f..33a331c752920b 100644 --- a/examples/lock-app/efr32/src/AppTask.cpp +++ b/examples/lock-app/efr32/src/AppTask.cpp @@ -142,6 +142,10 @@ CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Lock-App", true); +#endif + err = BaseApplication::Init(&gIdentify); if (err != CHIP_NO_ERROR) { @@ -354,16 +358,14 @@ void AppTask::ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAc void AppTask::ActionInitiated(LockManager::Action_t aAction, int32_t aActor) { - // Action initiated, update the light led - if (aAction == LockManager::LOCK_ACTION) + if (aAction == LockManager::UNLOCK_ACTION || aAction == LockManager::LOCK_ACTION) { - EFR32_LOG("Lock Action has been initiated") - sLockLED.Set(false); - } - else if (aAction == LockManager::UNLOCK_ACTION) - { - EFR32_LOG("Unlock Action has been initiated") - sLockLED.Set(true); + bool locked = (aAction == LockManager::LOCK_ACTION); + EFR32_LOG("%s Action has been initiated", (locked) ? "Lock" : "Unlock"); + sLockLED.Set(!locked); +#ifdef DISPLAY_ENABLED + sAppTask.GetLCD().WriteDemoUI(locked); +#endif } if (aActor == AppEvent::kEventType_Button) diff --git a/examples/platform/efr32/BaseApplication.cpp b/examples/platform/efr32/BaseApplication.cpp index 47dbb9c001361d..2cdc4753ef572b 100644 --- a/examples/platform/efr32/BaseApplication.cpp +++ b/examples/platform/efr32/BaseApplication.cpp @@ -120,6 +120,10 @@ bool mFunctionTimerActive; Identify * gIdentifyptr = nullptr; +#ifdef DISPLAY_ENABLED +SilabsLCD slLCD; +#endif + } // namespace /********************************************************** @@ -214,7 +218,8 @@ CHIP_ERROR BaseApplication::Init(Identify * identifyObj) if (GetQRCode(QRCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)) == CHIP_NO_ERROR) { - LCDWriteQRCode((uint8_t *) QRCode.data()); + slLCD.SetQRCode((uint8_t *) QRCode.data(), QRCode.size()); + slLCD.ShowQRCode(true, true); } else { @@ -386,6 +391,9 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) CancelFunctionTimer(); mFunction = kFunction_NoneSelected; + // TOGGLE QRCode/LCD demo UI + slLCD.ToggleQRCode(); + #ifdef SL_WIFI if (!ConnectivityMgr().IsWiFiStationProvisioned()) #else @@ -469,6 +477,13 @@ void BaseApplication::LightTimerEventHandler(TimerHandle_t xTimer) LightEventHandler(); } +#ifdef DISPLAY_ENABLED +SilabsLCD & BaseApplication::GetLCD(void) +{ + return slLCD; +} +#endif + void BaseApplication::PostEvent(const AppEvent * aEvent) { if (sAppEventQueue != NULL) diff --git a/examples/platform/efr32/BaseApplication.h b/examples/platform/efr32/BaseApplication.h index 41e2c1dbe64ffd..9c7ef22d8fe7d6 100644 --- a/examples/platform/efr32/BaseApplication.h +++ b/examples/platform/efr32/BaseApplication.h @@ -35,6 +35,14 @@ #include #include +#ifdef DISPLAY_ENABLED +#include "demo-ui.h" +#include "lcd.h" +#ifdef QR_CODE_ENABLED +#include "qrcodegen.h" +#endif // QR_CODE_ENABLED +#endif // DISPLAY_ENABLED + /********************************************************** * Defines *********************************************************/ @@ -73,6 +81,13 @@ class BaseApplication */ static void PostEvent(const AppEvent * event); +#ifdef DISPLAY_ENABLED + /** + * @brief Return LCD object + */ + static SilabsLCD & GetLCD(void); +#endif + /** * @brief Event handler when a button is pressed * Function posts an event for button processing @@ -165,8 +180,7 @@ class BaseApplication static void LightEventHandler(); /********************************************************** - * Private Attributes declaration + * Protected Attributes declaration *********************************************************/ - bool mSyncClusterToButtonAction; }; diff --git a/examples/platform/efr32/display/demo-ui-bitmaps.h b/examples/platform/efr32/display/demo-ui-bitmaps.h new file mode 100644 index 00000000000000..705015d3cf2beb --- /dev/null +++ b/examples/platform/efr32/display/demo-ui-bitmaps.h @@ -0,0 +1,490 @@ +/***************************************************************************//** + * @file + * @brief User Interface bitmaps for demo. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef SILABS_DEMO_UI_BITMAPS_H +#define SILABS_DEMO_UI_BITMAPS_H + +#define SILICONLABS_BITMAP_WIDTH 128 +#define SILICONLABS_BITMAP_HEIGHT 45 + +#define ZIGBEE_BITMAP_WIDTH 16 +#define ZIGBEE_BITMAP_HEIGHT 16 + +#define RAIL_BITMAP_WIDTH 16 +#define RAIL_BITMAP_HEIGHT 16 + +#define CONNECT_BITMAP_WIDTH 16 +#define CONNECT_BITMAP_HEIGHT 16 + +#define BLUETOOTH_BITMAP_WIDTH 16 +#define BLUETOOTH_BITMAP_HEIGHT 18 + + +#define SILABS_BITMAP \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xcf, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, \ + 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0x3f, \ + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, \ + 0xf3, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x1f, 0xf8, \ + 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, \ + 0xfc, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x7f, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0xe0, 0xff, 0xff, 0xff, 0xc3, \ + 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0xc0, \ + 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x03, 0x00, \ + 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x07, 0xfc, \ + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x80, \ + 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0xf8, 0x0f, 0x00, 0x80, 0xff, 0x7f, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x80, 0xff, \ + 0xff, 0xff, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xc0, \ + 0xff, 0x0f, 0x80, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, \ + 0x01, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xe0, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0x01, 0xc0, 0xff, \ + 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xe0, \ + 0xff, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0x01, 0x00, 0xf0, 0x7f, 0x00, 0x80, 0xff, 0xff, 0xff, 0x0f, 0xfc, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0xf8, 0x3f, 0x00, 0x80, 0xff, \ + 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xfc, \ + 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, \ + 0xff, 0x0f, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0x0f, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xff, 0x07, 0x00, 0x00, 0xf0, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x1f, 0x80, 0xff, \ + 0x07, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf8, 0xff, \ + 0xff, 0x1f, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, \ + 0xff, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, \ + 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0xfc, 0xff, \ + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, \ + 0xff, 0x07, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0xf8, 0xff, 0xff, 0x83, 0xff, 0xff, 0x01, 0x00, 0xc0, 0xff, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xe1, 0xff, 0xff, \ + 0x03, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, \ + 0xff, 0xf8, 0xff, 0xff, 0x03, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x03, 0x00, 0xfe, 0xff, \ + 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, \ + 0x07, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0x0f, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, \ + 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xc0, 0xff, 0xff, \ + 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0x3f, 0xc0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x80, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, \ + 0xff, 0x1f, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + +#define THREAD_BITMAP_WIDTH 16 +#define THREAD_BITMAP_HEIGHT 18 + +#define THREAD_BITMAP \ + 0x1F, 0xF8, 0x07, 0xE0, 0x03, 0xCE, 0x01, 0x9F, 0x01, 0xB3, 0x00, 0x33, \ + 0xF0, 0x3F, 0xF8, 0x1F, 0x0C, 0x03, 0x0C, 0x03, 0x18, 0x03, 0x11, 0x83, \ + 0x01, 0x83, 0x03, 0xC3, 0x07, 0xE3, 0x1F, 0xFB, 0x7f, 0xff, 0xff, 0xff + +#define WIFI_BITMAP_WIDTH 18 +#define WIFI_BITMAP_HEIGHT 18 + +#define WIFI_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0x01, 0xE0, 0x03, 0x00, 0xC7, \ + 0xFF, 0xB8, 0xFF, 0xF7, 0x07, 0xF8, 0x0F, 0xC0, 0x3F, 0x3F, 0xFF, 0xFF, \ + 0xFF, 0x3F, 0xFF, 0x7F, 0xF8, 0xFF, 0xE1, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0x0F + +#define MATTER_LOGO_WIDTH 18 +#define MATTER_LOGO_HEIGHT 17 + +#define MATTER_LOGO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xF3, 0xFF, 0xCF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFC, 0x3F, \ + 0x12, 0xFF, 0x01, 0xFE, 0xFF, 0xFF, 0xF3, 0x3F, 0x8F, 0x7F, 0xFC, 0xFC, \ + 0xFC, 0xE3, 0xF1, 0x87, 0x87, 0xC7, 0xDE, 0x88, 0x33, 0xC7, 0xCF, 0xFC, \ + 0xFF, 0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, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF +#elif IS_DEMO_LIGHT +#define ON_DEMO_BITMAP \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, \ + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, \ + 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, \ + 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0x8f, 0xff, 0xff, \ + 0xff, 0xff, 0xf1, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, \ + 0xff, 0x1f, 0xfe, 0x07, 0xe0, 0x7f, 0xf8, 0xff, 0xff, 0x3f, 0xfc, 0x00, \ + 0x00, 0x3f, 0xfc, 0xff, 0xff, 0x7f, 0x3c, 0xe0, 0x07, 0x3c, 0xfe, 0xff, \ + 0xff, 0xff, 0x1f, 0xfe, 0x7f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, \ + 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xe3, 0xff, 0xff, \ + 0xff, 0xff, 0xe3, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, \ + 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0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0xff, 0xff, 0xff, 0xff, 0x8f, 0xbf, \ + 0xfd, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x3f, 0xfc, 0xf8, 0xff, 0xff, \ + 0xff, 0xff, 0x3f, 0x3e, 0x7c, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, \ + 0x3f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0x3f, 0xfe, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \ + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, \ + 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \ + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xf1, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, \ + 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + +#define OFF_DEMO_BITMAP \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \ + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0x07, 0xfc, 0xff, 0xff, \ + 0xff, 0xff, 0x1f, 0xfe, 0x7f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, \ + 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xe3, 0xff, 0xff, \ + 0xff, 0xff, 0xe3, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, \ + 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0x8f, 0xff, 0xff, \ + 0xff, 0xff, 0xf8, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, \ + 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, \ + 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, \ + 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, \ + 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, \ + 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, \ + 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, \ + 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, \ + 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x7f, 0xfe, 0xff, \ + 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, \ + 0xff, 0xff, 0xfc, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, \ + 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0x1f, 0xff, 0xff, \ + 0xff, 0xff, 0xf1, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, \ + 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xc3, 0xff, 0xff, \ + 0xff, 0xff, 0xc7, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, \ + 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xf8, 0xff, 0xff, \ + 0xff, 0xff, 0x3f, 0xfe, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, \ + 0x3f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0x3f, 0xfe, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \ + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, \ + 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, \ + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xf1, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, \ + 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +#elif IS_DEMO_LOCK +#define ON_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, \ + 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF,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x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x80, \ + 0x01, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xE0, 0x07, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xF0, 0x0F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF8, \ + 0x1F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF8, 0x1F, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xFC, 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xFC, \ + 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF8, 0x1F, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xF8, 0x1F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF0, \ + 0x0F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xE0, 0x07, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x80, 0x01, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 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FF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x80, \ + 0x01, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xE0, 0x07, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xF0, 0x0F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF8, \ + 0x1F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF8, 0x1F, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xFC, 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xFC, \ + 0x3F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF8, 0x1F, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xF8, 0x1F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xF0, \ + 0x0F, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0xE0, 0x07, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x80, 0x01, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0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0xFF, 0x3F, 0x00, 0x00, \ + 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, \ + 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, \ + 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, \ + 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x0F, 0x00, 0x00, \ + 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, \ + 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, \ + 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, \ + 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, \ + 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x3F, 0x00, 0x00, \ + 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, \ + 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x7F, 0x00, 0x00, \ + 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, \ + 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, \ + 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, \ + 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#endif + +#endif // SILABS_DEMO_UI_BITMAPS_H diff --git a/examples/platform/efr32/display/demo-ui.c b/examples/platform/efr32/display/demo-ui.c new file mode 100644 index 00000000000000..73a8d52ea71090 --- /dev/null +++ b/examples/platform/efr32/display/demo-ui.c @@ -0,0 +1,136 @@ +/** + * @file + * @brief User Interface core logic for demo. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. + *www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon + *Laboratories Inc. Your use of this software is + *governed by the terms of Silicon Labs Master + *Software License Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. + *This software is distributed to you in Source Code + *format and is governed by the sections of the MSLA + *applicable to Source Code. + * + ******************************************************************************/ + +#include "demo-ui.h" +#include "demo-ui-bitmaps.h" +#include "dmd/dmd.h" +#include "em_types.h" +#include "glib.h" +#include +#include + +// Main Logo and App image +#define SILICONLABS_X_POSITION ((glibContext.pDisplayGeometry->xSize - SILICONLABS_BITMAP_WIDTH) / 2) +#define SILICONLABS_Y_POSITION 0 +#define APP_BITMAP_WIDTH 64 +#define APP_BITMAP_HEIGHT 64 +#define APP_X_POSITION ((glibContext.pDisplayGeometry->xSize - APP_BITMAP_WIDTH) / 2) +#define APP_Y_POSITION (glibContext.pDisplayGeometry->ySize - APP_BITMAP_HEIGHT - 5) +#define PROT1_ID_X_POSITION 1 +#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 +#define PROT1_BITMAP_WIDTH WIFI_BITMAP_WIDTH +#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 +#define PROT1_Y_POSITION (APP_Y_POSITION + (APP_Y_POSITION / 2)) +#define PROT1_BITMAP (networkBitMap) +#define PROT1_BITMAP_CONN (networkBitMap) +#endif + +/******************************************************************************* + *************************** LOCAL VARIABLES ******************************** + ******************************************************************************/ +static GLIB_Context_t glibContext; /* Global glib context */ + +static const uint8_t siliconlabsBitmap[] = { SILABS_BITMAP }; +static const uint8_t matterLogoBitmap[] = { MATTER_LOGO_BITMAP }; + +static const uint8_t OnStateBitMap[] = { ON_DEMO_BITMAP }; +static const uint8_t OffStateBitMap[] = { OFF_DEMO_BITMAP }; + +#ifdef SL_WIFI +static const uint8_t networkBitMap[] = { WIFI_BITMAP }; +#else +static const uint8_t networkBitMap[] = { THREAD_BITMAP }; +#endif + +// Future usage +// static const uint8_t unconnectedBitMap[] = { QUESTION_MARK_BITMAP }; + +/******************************************************************************* + ************************** LOCAL FUNCTIONS ******************************** + ******************************************************************************/ +static void demoUIDisplayLogo(void) +{ + GLIB_drawBitmap(&glibContext, SILICONLABS_X_POSITION, SILICONLABS_Y_POSITION, SILICONLABS_BITMAP_WIDTH, + SILICONLABS_BITMAP_HEIGHT, siliconlabsBitmap); +} + +/******************************************************************************* + ************************** GLOBAL FUNCTIONS ******************************* + ******************************************************************************/ +void demoUIInit(GLIB_Context_t * context) +{ + memcpy(&glibContext, context, sizeof(GLIB_Context_t)); +} + +void demoUIDisplayHeader(char * name) +{ + demoUIDisplayLogo(); + if (APP_NAME_MAX_LENGTH >= strlen(name)) + { + GLIB_drawStringOnLine(&glibContext, name, 5, GLIB_ALIGN_CENTER, 0, 0, true); + } + DMD_updateDisplay(); +} + +void demoUIDisplayApp(bool on) +{ + GLIB_drawBitmap(&glibContext, APP_X_POSITION, APP_Y_POSITION, APP_BITMAP_WIDTH, APP_BITMAP_HEIGHT, + (on ? OnStateBitMap : OffStateBitMap)); + DMD_updateDisplay(); +} + +void demoUIDisplayProtocol(demoUIProtocol protocol, bool isConnected) +{ + 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))); + DMD_updateDisplay(); +} + +void demoUIClearMainScreen(uint8_t * name) +{ + GLIB_clear(&glibContext); + demoUIDisplayHeader((char *) name); + demoUIDisplayApp(false); + demoUIDisplayProtocol(DEMO_UI_PROTOCOL1, false); + demoUIDisplayProtocol(DEMO_UI_PROTOCOL2, false); +} diff --git a/examples/platform/efr32/display/demo-ui.h b/examples/platform/efr32/display/demo-ui.h new file mode 100644 index 00000000000000..58babe7e008129 --- /dev/null +++ b/examples/platform/efr32/display/demo-ui.h @@ -0,0 +1,128 @@ +/***************************************************************************//** + * @file + * @brief User Interface for demo. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "glib.h" +/**************************************************************************//** +* DEMO UI uses the underlying DMD interface and the GLIB and exposes several +* wrapper functions to application. These functions are used to display +* different bitmaps for the demo. +* +******************************************************************************/ + +#define APP_NAME_MAX_LENGTH 20 + +/******************************************************************************* + ******************************** ENUMS ************************************ + ******************************************************************************/ + +typedef enum { + DEMO_UI_PROTOCOL1, + DEMO_UI_PROTOCOL2 +} demoUIProtocol; + +typedef enum { + DEMO_UI_LIGHT_OFF, + DEMO_UI_LIGHT_ON +} demoUILightState_t; + +typedef enum { + DEMO_UI_DIRECTION_PROT1, + DEMO_UI_DIRECTION_PROT2, + DEMO_UI_DIRECTION_SWITCH, + DEMO_UI_DIRECTION_INVALID +} demoUILightDirection_t; + +typedef enum { + DEMO_UI_NO_NETWORK, + DEMO_UI_SCANNING, + DEMO_UI_JOINING, + DEMO_UI_FORMING, + DEMO_UI_NETWORK_UP, + DEMO_UI_STATE_UNKNOWN +} demoUIZigBeeNetworkState_t; + +/******************************************************************************* + ****************************** PROTOTYPES ********************************* + ******************************************************************************/ + +/**************************************************************************//** + * @brief + * Initilize the GLIB and DMD interfaces. + * + * @param[in] void + * + * @return + * void + *****************************************************************************/ +void demoUIInit(GLIB_Context_t * context); + +/**************************************************************************//** + * @brief + * Update the display with Silicon Labs logo and application name. + * + * @param[in] name name of the current application. + * + * @return + * void + *****************************************************************************/ +void demoUIDisplayHeader(char* name); + +/**************************************************************************//** + * @brief + * Update the display with App image. Bool state only for now. + * + * @param[in] on status of App + * + * @return + * void + *****************************************************************************/ +void demoUIDisplayApp(bool on); + +/**************************************************************************//** + * @brief + * Update the display to show if the bluetooth is connected to the mobile device. + * + * @param[in] bool, true if the Light is connected to mobile device, false otherwise. + * + * @return + * void + *****************************************************************************/ +void demoUIDisplayProtocol(demoUIProtocol protocol, bool isConnected); + +/**************************************************************************//** + * @brief + * Clear the Lcd screen and display the main screen. + * + * @param[in] name - application name + * @param[in] showPROT1 - show protocol 1 related icon. + * @param[in] showPROT2 - show protocol 2 related icon. + * + * @return + * void + *****************************************************************************/ +void demoUIClearMainScreen(uint8_t* name); + + +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/efr32/display/lcd.c b/examples/platform/efr32/display/lcd.cpp similarity index 62% rename from examples/platform/efr32/display/lcd.c rename to examples/platform/efr32/display/lcd.cpp index a62f89c8ba25ab..dfbd4ce92e3693 100644 --- a/examples/platform/efr32/display/lcd.c +++ b/examples/platform/efr32/display/lcd.cpp @@ -20,6 +20,7 @@ #include #include "lcd.h" +#include "demo-ui.h" #include "dmd.h" #include "glib.h" @@ -35,25 +36,38 @@ #define QR_CODE_MODULE_SIZE 3 #define QR_CODE_BORDER_SIZE 0 -static GLIB_Context_t glibContext; + #ifdef QR_CODE_ENABLED static uint8_t qrCode[qrcodegen_BUFFER_LEN_FOR_VERSION(QR_CODE_VERSION)]; static uint8_t workBuffer[qrcodegen_BUFFER_LEN_FOR_VERSION(QR_CODE_VERSION)]; #endif // QR_CODE_ENABLED -#ifdef QR_CODE_ENABLED -static void LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h); -#endif // QR_CODE_ENABLED -void initLCD(void) +CHIP_ERROR SilabsLCD::Init(uint8_t * name, bool initialState) { EMSTATUS status; + CHIP_ERROR err = CHIP_NO_ERROR; + + // Check if Name is to long + if(name != nullptr) + { + if (APP_NAME_MAX_LENGTH < strlen((char*)name)) + { + EFR32_LOG("App Name too long"); + return CHIP_ERROR_INVALID_ARGUMENT; + } + else + { + strcpy((char*)mName, (char*)name); + } + } /* Enable the memory lcd */ status = sl_board_enable_display(); - if (status == SL_STATUS_OK) + if (status != SL_STATUS_OK) { EFR32_LOG("Board Display enable fail %d", status); + err = CHIP_ERROR_INTERNAL; } /* Initialize the DMD module for the DISPLAY device driver. */ @@ -61,6 +75,7 @@ void initLCD(void) if (DMD_OK != status) { EFR32_LOG("DMD init failed %d", status); + err = CHIP_ERROR_INTERNAL; } /* Initialize the glib context */ @@ -68,6 +83,7 @@ void initLCD(void) if (GLIB_OK != status) { EFR32_LOG("Glib context init failed %d", status); + err = CHIP_ERROR_INTERNAL; } glibContext.backgroundColor = White; @@ -76,34 +92,57 @@ void initLCD(void) if (GLIB_OK != status) { EFR32_LOG("Glib clear failed %d", status); + err = CHIP_ERROR_INTERNAL; } + demoUIInit(&glibContext); + + dState.mainState = initialState; + + return err; } /* This function is necessary because currently glib.h cannot be used within a C++ context. */ -void * LCDContext() +void * SilabsLCD::Context() { return (void *) &glibContext; } -int LCD_clear(void * pContext) +int SilabsLCD::Clear() { - return GLIB_clear((GLIB_Context_t *) pContext); + return GLIB_clear(&glibContext); } -int LCD_drawPixel(void * pContext, int32_t x, int32_t y) +int SilabsLCD::DrawPixel(void * pContext, int32_t x, int32_t y) { return GLIB_drawPixel((GLIB_Context_t *) pContext, x, y); } -int LCD_update(void) +int SilabsLCD::Update(void) { return DMD_updateDisplay(); } +void SilabsLCD::WriteDemoUI(bool state) +{ + if (mShowQRCode) + { + mShowQRCode = false; + } + dState.mainState = state; + WriteDemoUI(); +} + +void SilabsLCD::WriteDemoUI() +{ + Clear(); + demoUIClearMainScreen(mName); + demoUIDisplayApp(dState.mainState); +} + #ifdef QR_CODE_ENABLED -void LCDWriteQRCode(uint8_t * str) +void SilabsLCD::WriteQRCode() { - if (!qrcodegen_encodeText((const char *) str, workBuffer, qrCode, qrcodegen_Ecc_LOW, QR_CODE_VERSION, QR_CODE_VERSION, + if (!qrcodegen_encodeText((const char *) mQRCodeBuffer, workBuffer, qrCode, qrcodegen_Ecc_LOW, QR_CODE_VERSION, QR_CODE_VERSION, qrcodegen_Mask_AUTO, true)) { EFR32_LOG("qrcodegen_encodeText() failed"); @@ -133,7 +172,30 @@ void LCDWriteQRCode(uint8_t * str) DMD_updateDisplay(); } -void LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h) +void SilabsLCD::SetQRCode(uint8_t * str, uint32_t size) +{ + if (size < chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1) + { + memcpy(mQRCodeBuffer, str, size); + } +} + +void SilabsLCD::ShowQRCode(bool show, bool forceRefresh) +{ + if(show != mShowQRCode || forceRefresh) + { + (show) ? WriteQRCode() : WriteDemoUI(); + mShowQRCode = show; + } +} + +void SilabsLCD::ToggleQRCode(void) +{ + (mShowQRCode) ? WriteDemoUI() : WriteQRCode(); + mShowQRCode = !mShowQRCode; +} + +void SilabsLCD::LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h) { for (int i = 0; i < h; i++) { diff --git a/examples/platform/efr32/display/lcd.h b/examples/platform/efr32/display/lcd.h new file mode 100644 index 00000000000000..2c6247d74a9558 --- /dev/null +++ b/examples/platform/efr32/display/lcd.h @@ -0,0 +1,73 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "AppConfig.h" +#include "glib.h" +#ifdef QR_CODE_ENABLED +#include "qrcodegen.h" +#include +#endif // QR_CODE_ENABLED + +#include "demo-ui.h" + +#define MAX_STR_LEN 48 + +class SilabsLCD +{ + +public : + + CHIP_ERROR Init(uint8_t * name = nullptr, bool initialState = false); + void * Context(); + int Clear(void); + int DrawPixel(void * pContext, int32_t x, int32_t y); + int Update(void); + void WriteDemoUI(bool state); +#ifdef QR_CODE_ENABLED + void SetQRCode(uint8_t * str, uint32_t size); + void ShowQRCode(bool show, bool forceRefresh = false); + void ToggleQRCode(void); +#endif + +private : + typedef struct demoState + { + bool mainState = false; + bool protocol1 = false; /* data */ + } DemoState_t; + + + void WriteQRCode(); + void WriteDemoUI(); +#ifdef QR_CODE_ENABLED + void LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h); + char mQRCodeBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1]; + bool mShowQRCode = true; +#endif + GLIB_Context_t glibContext; + + #ifdef SL_DEMO_NAME + uint8_t mName[] = SL_DEMO_NAME + #else + uint8_t mName[APP_NAME_MAX_LENGTH + 1]; + #endif + + DemoState_t dState; +}; \ No newline at end of file diff --git a/examples/platform/efr32/init_efrPlatform.cpp b/examples/platform/efr32/init_efrPlatform.cpp index d0fb913165c469..a0e33702b40e68 100644 --- a/examples/platform/efr32/init_efrPlatform.cpp +++ b/examples/platform/efr32/init_efrPlatform.cpp @@ -56,10 +56,6 @@ extern "C" { #include "sl_mbedtls.h" #include "sl_system_init.h" -#if DISPLAY_ENABLED -#include "lcd.h" -#endif - void initAntenna(void); void init_efrPlatform(void) @@ -67,10 +63,6 @@ void init_efrPlatform(void) sl_system_init(); sl_mbedtls_init(); -#if DISPLAY_ENABLED - initLCD(); -#endif - #if EFR32_LOG_ENABLED efr32InitLog(); #endif diff --git a/examples/platform/efr32/lcd.h b/examples/platform/efr32/lcd.h deleted file mode 100644 index b3702305d40f69..00000000000000 --- a/examples/platform/efr32/lcd.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "AppConfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAX_STR_LEN 48 - -void initLCD(void); -void * LCDContext(); -int LCD_clear(void * pContext); -int LCD_drawPixel(void * pContext, int32_t x, int32_t y); -int LCD_update(void); -void LCDWriteQRCode(uint8_t * str); - -#ifdef __cplusplus -} -#endif diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index bcd17e3b6dddcf..7d2bfbec6dca1f 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -237,9 +237,11 @@ efr32_executable("window_app") { if (!disable_lcd) { sources += [ - "${examples_plat_dir}/display/lcd.c", + "${examples_plat_dir}/display/demo-ui.c", + "${examples_plat_dir}/display/lcd.cpp", "src/LcdPainter.cpp", ] + include_dirs += [ "${examples_plat_dir}/display" ] defines += [ "DISPLAY_ENABLED" ] if (show_qr_code) { diff --git a/examples/window-app/efr32/include/LcdPainter.h b/examples/window-app/efr32/include/LcdPainter.h index 448c750e166613..4a30bdede2c3ea 100644 --- a/examples/window-app/efr32/include/LcdPainter.h +++ b/examples/window-app/efr32/include/LcdPainter.h @@ -23,6 +23,8 @@ #include "app-common/app-common/zap-generated/cluster-enums.h" // clang-format on +#include + #include enum class LcdIcon @@ -104,7 +106,7 @@ class VerticalBlindPainter : public PixelPainter class LcdPainter { public: - static void Paint(chip::app::Clusters::WindowCovering::Type type, uint16_t lift, uint16_t tilt, LcdIcon icon); + static void Paint(SilabsLCD & lcd, chip::app::Clusters::WindowCovering::Type type, uint16_t lift, uint16_t tilt, LcdIcon icon); private: static PixelPainter * GetCoverPainter(chip::app::Clusters::WindowCovering::Type type, uint16_t lift, uint16_t tilt); diff --git a/examples/window-app/efr32/src/LcdPainter.cpp b/examples/window-app/efr32/src/LcdPainter.cpp index 6ff452cf197eee..e1a8041f075c79 100644 --- a/examples/window-app/efr32/src/LcdPainter.cpp +++ b/examples/window-app/efr32/src/LcdPainter.cpp @@ -18,7 +18,6 @@ */ #include -#include using namespace chip::app::Clusters::WindowCovering; @@ -202,15 +201,15 @@ PixelPainter * LcdPainter::GetCoverPainter(Type type, uint16_t lift, uint16_t ti return nullptr; } -void LcdPainter::Paint(Type type, uint16_t lift, uint16_t tilt, LcdIcon icon) +void LcdPainter::Paint(SilabsLCD & lcd, Type type, uint16_t lift, uint16_t tilt, LcdIcon icon) { FramePainter framePaint = FramePainter(lift, tilt); IconPainter iconPaint = IconPainter(lift, tilt, icon); PixelPainter * coverPaint = GetCoverPainter(type, lift, tilt); CompositePainter compositePaint = CompositePainter(lift, tilt, &framePaint, &iconPaint, coverPaint); - void * context = LCDContext(); + void * context = lcd.Context(); - LCD_clear(context); + lcd.Clear(); for (int i = 0; i < LCD_SIZE; i++) { @@ -218,10 +217,10 @@ void LcdPainter::Paint(Type type, uint16_t lift, uint16_t tilt, LcdIcon icon) { if (compositePaint.Color(i, j)) { - LCD_drawPixel(context, i, j); + lcd.DrawPixel(context, i, j); } } } - LCD_update(); + lcd.Update(); delete coverPaint; } diff --git a/examples/window-app/efr32/src/WindowAppImpl.cpp b/examples/window-app/efr32/src/WindowAppImpl.cpp index 2330bade5d2506..8ccfa97ea098a7 100644 --- a/examples/window-app/efr32/src/WindowAppImpl.cpp +++ b/examples/window-app/efr32/src/WindowAppImpl.cpp @@ -129,6 +129,10 @@ StaticQueue_t sAppEventQueueStruct; WindowAppImpl WindowAppImpl::sInstance; +#ifdef DISPLAY_ENABLED +SilabsLCD slLCD; +#endif + WindowApp & WindowApp::Instance() { return WindowAppImpl::sInstance; @@ -184,6 +188,10 @@ CHIP_ERROR WindowAppImpl::Init() mStatusLED.Init(APP_STATE_LED); mActionLED.Init(APP_ACTION_LED); +#ifdef DISPLAY_ENABLED + slLCD.Init(); +#endif + return CHIP_NO_ERROR; } @@ -427,7 +435,7 @@ void WindowAppImpl::UpdateLCD() if (!tilt.IsNull() && !lift.IsNull()) { - LcdPainter::Paint(type, lift.Value(), tilt.Value(), mIcon); + LcdPainter::Paint(slLCD, type, lift.Value(), tilt.Value(), mIcon); } } #ifdef QR_CODE_ENABLED @@ -436,7 +444,8 @@ void WindowAppImpl::UpdateLCD() chip::MutableCharSpan qrCode(mQRCodeBuffer); if (GetQRCode(qrCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)) == CHIP_NO_ERROR) { - LCDWriteQRCode((uint8_t *) qrCode.data()); + slLCD.SetQRCode((uint8_t *) qrCode.data(), qrCode.size()); + slLCD.ShowQRCode(true, true); } } #endif // QR_CODE_ENABLED