1 1 рік тому
батько
коміт
c63c68a53e
100 змінених файлів з 8870 додано та 0 видалено
  1. 19 0
      vendor/bossay/.vscode/c_cpp_properties.json
  2. 10 0
      vendor/bossay/CH2O_Monitoring/BUILD.gn
  3. 95 0
      vendor/bossay/CH2O_Monitoring/config.json
  4. 32 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/BUILD.gn
  5. 20 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/BUILD.gn
  6. 14 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/OLED_DisplayTask.c
  7. 44 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/include/OLED_I2C.h
  8. 281 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/include/codetab.h
  9. 228 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/include/iot_gpio.h
  10. 311 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/src/OLED_I2C.c
  11. 25 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/BUILD.gn
  12. 172 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/inc/cloud_communicate.h
  13. 78 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/inc/cloud_schedule.h
  14. 527 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/src/cloud_communicate.c
  15. 300 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/src/cloud_schedule.c
  16. 224 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/main_entry.c
  17. 23 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/sensor/BUILD.gn
  18. 33 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/sensor/inc/CH2O.h
  19. 169 0
      vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/sensor/src/CH2O.c
  20. 27 0
      vendor/bossay/CH2O_Monitoring/hals/utils/sys_param/BUILD.gn
  21. 128 0
      vendor/bossay/CH2O_Monitoring/hals/utils/sys_param/hal_sys_param.c
  22. 22 0
      vendor/bossay/CH2O_Monitoring/hals/utils/token/BUILD.gn
  23. 104 0
      vendor/bossay/CH2O_Monitoring/hals/utils/token/hal_token.c
  24. 8 0
      vendor/bossay/DCMOTOR/BUILD.gn
  25. 10 0
      vendor/bossay/DCMOTOR/SOURCE_DCMOTOR/BUILD.gn
  26. 55 0
      vendor/bossay/DCMOTOR/SOURCE_DCMOTOR/main_entry.c
  27. 52 0
      vendor/bossay/DCMOTOR/config.json
  28. 20 0
      vendor/bossay/DCMOTOR/hals/utils/sys_param/BUILD.gn
  29. 200 0
      vendor/bossay/DCMOTOR/hals/utils/sys_param/hal_sys_param.c
  30. 22 0
      vendor/bossay/DCMOTOR/hals/utils/token/BUILD.gn
  31. 104 0
      vendor/bossay/DCMOTOR/hals/utils/token/hal_token.c
  32. 4 0
      vendor/bossay/DHT11/BUILD.gn
  33. 95 0
      vendor/bossay/DHT11/config.json
  34. 35 0
      vendor/bossay/DHT11/demo_DHT11/BUILD.gn
  35. 184 0
      vendor/bossay/DHT11/demo_DHT11/main_entry.c
  36. 8 0
      vendor/bossay/Digital_tube/BUILD.gn
  37. 17 0
      vendor/bossay/Digital_tube/SOURCE_Digital_tube/BUILD.gn
  38. 195 0
      vendor/bossay/Digital_tube/SOURCE_Digital_tube/iic_my.c
  39. 31 0
      vendor/bossay/Digital_tube/SOURCE_Digital_tube/iic_my.h
  40. 45 0
      vendor/bossay/Digital_tube/SOURCE_Digital_tube/main_entry.c
  41. 100 0
      vendor/bossay/Digital_tube/SOURCE_Digital_tube/tm1637.c
  42. 30 0
      vendor/bossay/Digital_tube/SOURCE_Digital_tube/tm1637.h
  43. 95 0
      vendor/bossay/Digital_tube/config.json
  44. 20 0
      vendor/bossay/Digital_tube/hals/utils/sys_param/BUILD.gn
  45. 200 0
      vendor/bossay/Digital_tube/hals/utils/sys_param/hal_sys_param.c
  46. 22 0
      vendor/bossay/Digital_tube/hals/utils/token/BUILD.gn
  47. 104 0
      vendor/bossay/Digital_tube/hals/utils/token/hal_token.c
  48. 8 0
      vendor/bossay/EMATRIX/BUILD.gn
  49. 10 0
      vendor/bossay/EMATRIX/SOURCE_EMATRIX/BUILD.gn
  50. 129 0
      vendor/bossay/EMATRIX/SOURCE_EMATRIX/main_entry.c
  51. 95 0
      vendor/bossay/EMATRIX/config.json
  52. 20 0
      vendor/bossay/EMATRIX/hals/utils/sys_param/BUILD.gn
  53. 200 0
      vendor/bossay/EMATRIX/hals/utils/sys_param/hal_sys_param.c
  54. 22 0
      vendor/bossay/EMATRIX/hals/utils/token/BUILD.gn
  55. 104 0
      vendor/bossay/EMATRIX/hals/utils/token/hal_token.c
  56. 8 0
      vendor/bossay/Electronic_scale/BUILD.gn
  57. 10 0
      vendor/bossay/Electronic_scale/SOURCE_Electronic_scale/BUILD.gn
  58. 132 0
      vendor/bossay/Electronic_scale/SOURCE_Electronic_scale/main_entry.c
  59. 95 0
      vendor/bossay/Electronic_scale/config.json
  60. 20 0
      vendor/bossay/Electronic_scale/hals/utils/sys_param/BUILD.gn
  61. 200 0
      vendor/bossay/Electronic_scale/hals/utils/sys_param/hal_sys_param.c
  62. 22 0
      vendor/bossay/Electronic_scale/hals/utils/token/BUILD.gn
  63. 104 0
      vendor/bossay/Electronic_scale/hals/utils/token/hal_token.c
  64. 10 0
      vendor/bossay/Five-pointed star/BUILD.gn
  65. 8 0
      vendor/bossay/Five-pointed star/SOURCE_Five-pointed star/BUILD.gn
  66. 17 0
      vendor/bossay/Five-pointed star/SOURCE_Five-pointed star/main_entry.c
  67. 96 0
      vendor/bossay/Five-pointed star/config.json
  68. 20 0
      vendor/bossay/Five-pointed star/hals/utils/sys_param/BUILD.gn
  69. 200 0
      vendor/bossay/Five-pointed star/hals/utils/sys_param/hal_sys_param.c
  70. 22 0
      vendor/bossay/Five-pointed star/hals/utils/token/BUILD.gn
  71. 104 0
      vendor/bossay/Five-pointed star/hals/utils/token/hal_token.c
  72. 8 0
      vendor/bossay/Helloworld/BUILD.gn
  73. 104 0
      vendor/bossay/Helloworld/config.json
  74. 14 0
      vendor/bossay/Helloworld/demo_helloworld/BUILD.gn
  75. 8 0
      vendor/bossay/Helloworld/demo_helloworld/Helloworld.c
  76. 4 0
      vendor/bossay/LED/BUILD.gn
  77. 95 0
      vendor/bossay/LED/config.json
  78. 17 0
      vendor/bossay/LED/demo_LED/BUILD.gn
  79. 19 0
      vendor/bossay/LED/demo_LED/LED.c
  80. 4 0
      vendor/bossay/LEDPWM/BUILD.gn
  81. 95 0
      vendor/bossay/LEDPWM/config.json
  82. 18 0
      vendor/bossay/LEDPWM/demo_LEDPWM/BUILD.gn
  83. 119 0
      vendor/bossay/LEDPWM/demo_LEDPWM/LEDPWM.c
  84. 82 0
      vendor/bossay/NFC_Demo/A08_NFC/A08_NFC_example.c
  85. 26 0
      vendor/bossay/NFC_Demo/A08_NFC/BUILD.gn
  86. 81 0
      vendor/bossay/NFC_Demo/A08_NFC/include/MPU6050.h
  87. 277 0
      vendor/bossay/NFC_Demo/A08_NFC/include/pn532.h
  88. 48 0
      vendor/bossay/NFC_Demo/A08_NFC/include/pn532_hi3861.h
  89. 381 0
      vendor/bossay/NFC_Demo/A08_NFC/src/MPU6050.c
  90. 498 0
      vendor/bossay/NFC_Demo/A08_NFC/src/pn532.c
  91. 172 0
      vendor/bossay/NFC_Demo/A08_NFC/src/pn532_hi3861.c
  92. 10 0
      vendor/bossay/NFC_Demo/BUILD.gn
  93. 96 0
      vendor/bossay/NFC_Demo/config.json
  94. 10 0
      vendor/bossay/PM2_5_Monitoring/BUILD.gn
  95. 95 0
      vendor/bossay/PM2_5_Monitoring/config.json
  96. 32 0
      vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/BUILD.gn
  97. 20 0
      vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/BUILD.gn
  98. 14 0
      vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/OLED_DisplayTask.c
  99. 44 0
      vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/include/OLED_I2C.h
  100. 281 0
      vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/include/codetab.h

+ 19 - 0
vendor/bossay/.vscode/c_cpp_properties.json

@@ -0,0 +1,19 @@
+{
+    "configurations": [
+        {
+            "name": "Win32",
+            "includePath": [
+                "${workspaceFolder}/**"
+            ],
+            "defines": [
+                "_DEBUG",
+                "UNICODE",
+                "_UNICODE"
+            ],
+            "cStandard": "c17",
+            "cppStandard": "c++17",
+            "intelliSenseMode": "windows-msvc-x64"
+        }
+    ],
+    "version": 4
+}

+ 10 - 0
vendor/bossay/CH2O_Monitoring/BUILD.gn

@@ -0,0 +1,10 @@
+# Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
+
+group("CH2O_Monitoring") {
+    deps = [
+        "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+        "../common/iot_wifi:iot_wifi",
+        # "//applications/sample/app:app",
+        "demo_CH2O_Monitoring:bossay_hi3861_l0_CH2O_Monitoring",
+    ]
+}

+ 95 - 0
vendor/bossay/CH2O_Monitoring/config.json

@@ -0,0 +1,95 @@
+{
+    "product_name": "CH2O_Monitoring",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 32 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/BUILD.gn

@@ -0,0 +1,32 @@
+static_library("bossay_hi3861_l0_CH2O_Monitoring") {
+    sources = [
+        "main_entry.c",
+    ]
+    
+    cflags = [ "-Wno-unused-variable" ]
+    cflags += [ "-Wno-unused-but-set-variable" ]
+    cflags += [ "-Wno-unused-parameter" ]
+    
+    include_dirs = [
+        "./sensor/inc",
+        "../../common/inc",
+        "cloud_connect/inc",
+        "//third_party/cJSON",
+        "./OLED/include"
+        
+    ]
+
+    deps = [ 
+         "../../common/iot_sntp:iot_sntp",
+         "../../common/iot_wifi:iot_wifi",
+         "../../common/iot_schedule:iot_schedule",
+         #"../../common/iot_nfc:iot_nfc",
+         "../../common/iot_cloud:iot_cloud",
+         #"../../common/iot_boardled:iot_boardled",
+         #"../../common/iot_boardbutton:iot_boardbutton",
+         "cloud_connect:cloud_connect",
+         "sensor:bossay_hi3861_l0_sensor",
+         "OLED:bossay_hi3816l0_OLED",
+    ]
+
+}

+ 20 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/BUILD.gn

@@ -0,0 +1,20 @@
+static_library("bossay_hi3816l0_OLED"){
+
+    cflags = [ "-Wno-unused-variable" ]
+    cflags += [ "-Wno-unused-but-set-variable" ]
+    cflags += [ "-Wno-unused-parameter" ]
+
+    include_dirs = [
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "//device/bossay/hi3861_l0/sdk_liteos/include",
+        "include",
+    ]
+    sources = [
+        "src/OLED_I2C.c",
+        "OLED_DisplayTask.c",
+    ]
+}
+
+

+ 14 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/OLED_DisplayTask.c

@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */

+ 44 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/include/OLED_I2C.h

@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+#ifndef __OLED_I2C_H
+#define	__OLED_I2C_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include "iot_gpio.h"
+
+#define OLED_ADDRESS	0x3D //通过调整0R电阻,屏可以0x3C和0x3D两个地址 -- 默认0x3C
+#define KEY_GPIO 11
+
+void initKey(GpioIsrCallbackFunc func);
+bool isKeyON(void);
+
+
+
+void OLED_BoardInit(void);
+void I2C_WriteByte(uint8_t addr,uint8_t data);
+void WriteCmd(unsigned char I2C_Command);
+void WriteDat(unsigned char I2C_Data);
+void OLED_Init(void);
+void OLED_SetPos(unsigned char x, unsigned char y);
+void OLED_Fill(unsigned char fill_Data);
+void OLED_CLS(void);
+void OLED_ON(void);
+void OLED_OFF(void);
+void OLED_ShowStr(unsigned char x, unsigned char y, unsigned char ch[], unsigned char TextSize);
+void OLED_ShowCN(unsigned char x, unsigned char y, unsigned char N);
+void OLED_DrawBMP(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1,unsigned char BMP[]);
+
+#endif

+ 281 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/include/codetab.h

@@ -0,0 +1,281 @@
+#ifndef __CODETAB_H
+#define	__CODETAB_H
+
+
+/***************************16*16的点阵字体取模方式:共阴——列行式——逆向输出*********/
+unsigned char F16x16[] =
+
+{	0x24,0x24,0xA4,0xFE,0xA3,0x22,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
+	0x08,0x06,0x01,0xFF,0x00,0x01,0x04,0x04,0x04,0x04,0x04,0xFF,0x02,0x02,0x02,0x00,/*"科",0*/
+
+	0x10,0x10,0x10,0xFF,0x10,0x90,0x08,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x08,0x00,
+	0x04,0x44,0x82,0x7F,0x01,0x80,0x80,0x40,0x43,0x2C,0x10,0x28,0x46,0x81,0x80,0x00/*"技",1*/
+};
+
+
+/************************************6*8的点阵************************************/
+const unsigned char F6x8[][6] =
+{
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp
+	0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !
+	0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "
+	0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14,// #
+	0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12,// $
+	0x00, 0x62, 0x64, 0x08, 0x13, 0x23,// %
+	0x00, 0x36, 0x49, 0x55, 0x22, 0x50,// &
+	0x00, 0x00, 0x05, 0x03, 0x00, 0x00,// '
+	0x00, 0x00, 0x1c, 0x22, 0x41, 0x00,// (
+	0x00, 0x00, 0x41, 0x22, 0x1c, 0x00,// )
+	0x00, 0x14, 0x08, 0x3E, 0x08, 0x14,// *
+	0x00, 0x08, 0x08, 0x3E, 0x08, 0x08,// +
+	0x00, 0x00, 0x00, 0xA0, 0x60, 0x00,// ,
+	0x00, 0x08, 0x08, 0x08, 0x08, 0x08,// -
+	0x00, 0x00, 0x60, 0x60, 0x00, 0x00,// .
+	0x00, 0x20, 0x10, 0x08, 0x04, 0x02,// /
+	0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
+	0x00, 0x00, 0x42, 0x7F, 0x40, 0x00,// 1
+	0x00, 0x42, 0x61, 0x51, 0x49, 0x46,// 2
+	0x00, 0x21, 0x41, 0x45, 0x4B, 0x31,// 3
+	0x00, 0x18, 0x14, 0x12, 0x7F, 0x10,// 4
+	0x00, 0x27, 0x45, 0x45, 0x45, 0x39,// 5
+	0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
+	0x00, 0x01, 0x71, 0x09, 0x05, 0x03,// 7
+	0x00, 0x36, 0x49, 0x49, 0x49, 0x36,// 8
+	0x00, 0x06, 0x49, 0x49, 0x29, 0x1E,// 9
+	0x00, 0x00, 0x36, 0x36, 0x00, 0x00,// :
+	0x00, 0x00, 0x56, 0x36, 0x00, 0x00,// ;
+	0x00, 0x08, 0x14, 0x22, 0x41, 0x00,// <
+	0x00, 0x14, 0x14, 0x14, 0x14, 0x14,// =
+	0x00, 0x00, 0x41, 0x22, 0x14, 0x08,// >
+	0x00, 0x02, 0x01, 0x51, 0x09, 0x06,// ?
+	0x00, 0x32, 0x49, 0x59, 0x51, 0x3E,// @
+	0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C,// A
+	0x00, 0x7F, 0x49, 0x49, 0x49, 0x36,// B
+	0x00, 0x3E, 0x41, 0x41, 0x41, 0x22,// C
+	0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C,// D
+	0x00, 0x7F, 0x49, 0x49, 0x49, 0x41,// E
+	0x00, 0x7F, 0x09, 0x09, 0x09, 0x01,// F
+	0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A,// G
+	0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F,// H
+	0x00, 0x00, 0x41, 0x7F, 0x41, 0x00,// I
+	0x00, 0x20, 0x40, 0x41, 0x3F, 0x01,// J
+	0x00, 0x7F, 0x08, 0x14, 0x22, 0x41,// K
+	0x00, 0x7F, 0x40, 0x40, 0x40, 0x40,// L
+	0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F,// M
+	0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F,// N
+	0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E,// O
+	0x00, 0x7F, 0x09, 0x09, 0x09, 0x06,// P
+	0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
+	0x00, 0x7F, 0x09, 0x19, 0x29, 0x46,// R
+	0x00, 0x46, 0x49, 0x49, 0x49, 0x31,// S
+	0x00, 0x01, 0x01, 0x7F, 0x01, 0x01,// T
+	0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F,// U
+	0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F,// V
+	0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F,// W
+	0x00, 0x63, 0x14, 0x08, 0x14, 0x63,// X
+	0x00, 0x07, 0x08, 0x70, 0x08, 0x07,// Y
+	0x00, 0x61, 0x51, 0x49, 0x45, 0x43,// Z
+	0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// [
+	0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55,// 55
+	0x00, 0x00, 0x41, 0x41, 0x7F, 0x00,// ]
+	0x00, 0x04, 0x02, 0x01, 0x02, 0x04,// ^
+	0x00, 0x40, 0x40, 0x40, 0x40, 0x40,// _
+	0x00, 0x00, 0x01, 0x02, 0x04, 0x00,// '
+	0x00, 0x20, 0x54, 0x54, 0x54, 0x78,// a
+	0x00, 0x7F, 0x48, 0x44, 0x44, 0x38,// b
+	0x00, 0x38, 0x44, 0x44, 0x44, 0x20,// c
+	0x00, 0x38, 0x44, 0x44, 0x48, 0x7F,// d
+	0x00, 0x38, 0x54, 0x54, 0x54, 0x18,// e
+	0x00, 0x08, 0x7E, 0x09, 0x01, 0x02,// f
+	0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C,// g
+	0x00, 0x7F, 0x08, 0x04, 0x04, 0x78,// h
+	0x00, 0x00, 0x44, 0x7D, 0x40, 0x00,// i
+	0x00, 0x40, 0x80, 0x84, 0x7D, 0x00,// j
+	0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,// k
+	0x00, 0x00, 0x41, 0x7F, 0x40, 0x00,// l
+	0x00, 0x7C, 0x04, 0x18, 0x04, 0x78,// m
+	0x00, 0x7C, 0x08, 0x04, 0x04, 0x78,// n
+	0x00, 0x38, 0x44, 0x44, 0x44, 0x38,// o
+	0x00, 0xFC, 0x24, 0x24, 0x24, 0x18,// p
+	0x00, 0x18, 0x24, 0x24, 0x18, 0xFC,// q
+	0x00, 0x7C, 0x08, 0x04, 0x04, 0x08,// r
+	0x00, 0x48, 0x54, 0x54, 0x54, 0x20,// s
+	0x00, 0x04, 0x3F, 0x44, 0x40, 0x20,// t
+	0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C,// u
+	0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C,// v
+	0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C,// w
+	0x00, 0x44, 0x28, 0x10, 0x28, 0x44,// x
+	0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C,// y
+	0x00, 0x44, 0x64, 0x54, 0x4C, 0x44,// z
+	0x14, 0x14, 0x14, 0x14, 0x14, 0x14,// horiz lines
+};
+/****************************************8*16的点阵************************************/
+const unsigned char F8X16[]=	  
+{
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
+  0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 1
+  0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 2
+  0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 3
+  0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 4
+  0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 5
+  0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 6
+  0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 7
+  0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 8
+  0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 9
+  0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 10
+  0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 11
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 12
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 13
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 14
+  0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 15
+  0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 16
+  0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 17
+  0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 18
+  0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 19
+  0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 20
+  0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 21
+  0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 22
+  0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 23
+  0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 24
+  0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 25
+  0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 26
+  0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 27
+  0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 28
+  0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 29
+  0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 30
+  0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 31
+  0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 32
+  0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 33
+  0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 34
+  0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 35
+  0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 36
+  0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 37
+  0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 38
+  0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 39
+  0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 40
+  0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 41
+  0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 42
+  0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 43
+  0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 44
+  0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 45
+  0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 46
+  0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 47
+  0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 48
+  0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 49
+  0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 50
+  0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 51
+  0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 52
+  0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 53
+  0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 54
+  0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 55
+  0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 56
+  0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 57
+  0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 58
+  0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 59
+  0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 60
+  0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 61
+  0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 62
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 63
+  0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 64
+  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 65
+  0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 66
+  0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 67
+  0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 68
+  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 69
+  0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 70
+  0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 71
+  0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 72
+  0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 73
+  0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 74
+  0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 75
+  0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 76
+  0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 77
+  0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 78
+  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 79
+  0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 80
+  0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 81
+  0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 82
+  0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 83
+  0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 84
+  0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 85
+  0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 86
+  0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 87
+  0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 88
+  0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 89
+  0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 90
+  0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 91
+  0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 92
+  0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 93
+  0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
+};
+
+unsigned char BMP1[] =
+{
+	0x00,0x03,0x05,0x09,0x11,0xFF,0x11,0x89,0x05,0xC3,0x00,0xE0,0x00,0xF0,0x00,0xF8,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x28,0xFF,0x11,0xAA,0x44,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x01,0x38,0x44,0x82,0x92,
+	0x92,0x74,0x01,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x44,0xC7,0x01,0x7D,
+	0x7D,0x7D,0x7D,0x01,0x7D,0x7D,0x7D,0x7D,0x01,0x7D,0x7D,0x7D,0x7D,0x01,0xFF,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,
+	0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00,
+	0x6D,0x6D,0x6D,0x6D,0x6D,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x40,0x40,
+	0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,
+	0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDB,0xDB,
+	0xDB,0xDB,0xDB,0x00,0x00,0xDA,0xDA,0xDA,0xDA,0xDA,0x00,0x00,0xD8,0xD8,0xD8,0xD8,
+	0xD8,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,
+	0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x80,
+	0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,
+	0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,
+	0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0xE6,0x66,0x20,0x00,0x06,0x06,0x86,0x06,
+	0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x86,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,
+	0x00,0x86,0x86,0x86,0x86,0x86,0x80,0x80,0x86,0x86,0x06,0x86,0x86,0xC0,0xC0,0x86,
+	0x86,0x86,0x06,0x06,0xD0,0x30,0x76,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,
+	0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,
+	0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x1C,0x00,0xFE,0x00,0x01,
+	0x02,0x00,0xC4,0x18,0x20,0x02,0x9E,0x63,0xB2,0x0E,0x00,0xFF,0x81,0x81,0xFF,0x00,
+	0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0xFF,0x00,0x23,0xEA,0xAA,0xBF,0xAA,
+	0xEA,0x03,0x3F,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x0C,0x08,0x00,0x00,0x01,0x01,0x01,
+	0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x81,0x80,0x80,0x81,0x80,
+	0x81,0x80,0x80,0x80,0x80,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
+	0x01,0x00,0x01,0x01,0x09,0x0C,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
+	0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,
+	0x00,0x1E,0x21,0x40,0x40,0x50,0x21,0x5E,0x00,0x1E,0x21,0x40,0x40,0x50,0x21,0x5E,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xC1,0xC1,0xFF,
+	0xFF,0xC1,0xC1,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x80,0xFC,0xF3,0xEF,0xF3,0xFC,
+	0x80,0xFF,0x80,0xEE,0xEE,0xEE,0xF5,0xFB,0xFF,0x9C,0xBE,0xB6,0xB6,0x88,0xFF,0x00,/*"D:\DreamSpark\OLED\MP3_UI.bmp",0*/
+};
+
+
+#endif

+ 228 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/include/iot_gpio.h

@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+/**
+ * @addtogroup IotHardware
+ * @{
+ *
+ * @brief Provides APIs for operating devices,
+ * including flash, GPIO, I2C, PWM, UART, and watchdog APIs.
+ *
+ *
+ *
+ * @since 2.2
+ * @version 2.2
+ */
+
+/**
+ * @file iot_gpio.h
+ *
+ * @brief Declares functions for operating GPIO devices.
+ *
+ * These functions are used for GPIO initialization, input/output settings, and level settings. \n
+ *
+ * @since 2.2
+ * @version 2.2
+ */
+#ifndef IOT_GPIO_H
+#define IOT_GPIO_H
+
+/**
+ * @brief Enumerates GPIO level values.
+ */
+typedef enum {
+    /** Low GPIO level */
+    IOT_GPIO_VALUE0 = 0,
+    /** High GPIO level */
+    IOT_GPIO_VALUE1
+} IotGpioValue;
+
+/**
+ * @brief Enumerates GPIO directions.
+ */
+typedef enum {
+    /** Input */
+    IOT_GPIO_DIR_IN = 0,
+    /** Output */
+    IOT_GPIO_DIR_OUT
+} IotGpioDir;
+
+/**
+ * @brief Enumerates GPIO interrupt trigger modes.
+ */
+typedef enum {
+    /** Level-sensitive interrupt */
+    IOT_INT_TYPE_LEVEL = 0,
+    /** Edge-sensitive interrupt */
+    IOT_INT_TYPE_EDGE
+} IotGpioIntType;
+
+/**
+ * @brief Enumerates I/O interrupt polarities.
+ */
+typedef enum {
+    /** Interrupt at a low level or falling edge */
+    IOT_GPIO_EDGE_FALL_LEVEL_LOW = 0,
+    /** Interrupt at a high level or rising edge */
+    IOT_GPIO_EDGE_RISE_LEVEL_HIGH
+} IotGpioIntPolarity;
+
+/**
+ * @brief Indicates the GPIO interrupt callback.
+ *
+ */
+typedef void (*GpioIsrCallbackFunc) (char *arg);
+
+/**
+ * @brief Initializes a GPIO device.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @return Returns {@link IOT_SUCCESS} if the GPIO device is initialized;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioInit(unsigned int id);
+
+/**
+ * @brief Deinitializes a GPIO device.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @return Returns {@link IOT_SUCCESS} if the GPIO device is deinitialized;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioDeinit(unsigned int id);
+
+/**
+ * @brief Sets the direction for a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param dir Indicates the GPIO input/output direction.
+ * @return Returns {@link IOT_SUCCESS} if the direction is set;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioSetDir(unsigned int id, IotGpioDir dir);
+
+/**
+ * @brief Obtains the direction for a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param dir Indicates the pointer to the GPIO input/output direction.
+ * @return Returns {@link IOT_SUCCESS} if the direction is obtained;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioGetDir(unsigned int id, IotGpioDir *dir);
+
+/**
+ * @brief Sets the output level value for a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param val Indicates the output level value.
+ * @return Returns {@link IOT_SUCCESS} if the output level value is set;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioSetOutputVal(unsigned int id, IotGpioValue val);
+
+/**
+ * @brief Obtains the output level value of a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param val Indicates the pointer to the output level value.
+ * @return Returns {@link IOT_SUCCESS} if the output level value is obtained;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioGetOutputVal(unsigned int id, IotGpioValue *val);
+
+/**
+ * @brief Obtains the input level value of a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param val Indicates the pointer to the input level value.
+ * @return Returns {@link IOT_SUCCESS} if the input level value is obtained;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioGetInputVal(unsigned int id, IotGpioValue *val);
+
+/**
+ * @brief Enables the interrupt feature for a GPIO pin.
+ *
+ * This function can be used to set the interrupt type, interrupt polarity, and interrupt callback for a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param intType Indicates the interrupt type.
+ * @param intPolarity Indicates the interrupt polarity.
+ * @param func Indicates the interrupt callback function.
+ * @param arg Indicates the pointer to the argument used in the interrupt callback function.
+ * @return Returns {@link IOT_SUCCESS} if the interrupt feature is enabled;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioRegisterIsrFunc(unsigned int id, IotGpioIntType intType, IotGpioIntPolarity intPolarity,
+                                    GpioIsrCallbackFunc func, char *arg);
+
+/**
+ * @brief Disables the interrupt feature for a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @return Returns {@link IOT_SUCCESS} if the interrupt feature is disabled;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioUnregisterIsrFunc(unsigned int id);
+
+/**
+ * @brief Masks the interrupt feature for a GPIO pin.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param mask Indicates whether the interrupt function is masked.
+ * The value <b>1</b> means to mask the interrupt function, and <b>0</b> means not to mask the interrupt function.
+ * @return Returns {@link IOT_SUCCESS} if the interrupt feature is masked;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioSetIsrMask(unsigned int id, unsigned char mask);
+
+/**
+ * @brief Sets the interrupt trigger mode of a GPIO pin.
+ *
+ * This function configures a GPIO pin based on the interrupt type and interrupt polarity.
+ *
+ * @param id Indicates the GPIO pin number.
+ * @param intType Indicates the interrupt type.
+ * @param intPolarity Indicates the interrupt polarity.
+ * @return Returns {@link IOT_SUCCESS} if the interrupt trigger mode is set;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 2.2
+ * @version 2.2
+ */
+unsigned int IoTGpioSetIsrMode(unsigned int id, IotGpioIntType intType, IotGpioIntPolarity intPolarity);
+
+#endif
+/** @} */

+ 311 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/OLED/src/OLED_I2C.c

@@ -0,0 +1,311 @@
+#include "OLED_I2C.h"
+#include "codetab.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "iot_i2c.h"
+#include "iot_i2c_ex.h"
+#include <cmsis_os2.h>
+
+#define I2C1_SDA_GPIO 10
+#define I2C1_SCL_GPIO 9
+#define IOT_GPIO_FUNC_GPIO_0_I2C1_SDA  6
+#define IOT_GPIO_FUNC_GPIO_1_I2C1_SCL 6
+#define WIFI_IOT_I2C_IDX_1 0
+
+#define BEEP_GPIO 12
+
+
+
+void initKey(GpioIsrCallbackFunc func)
+{    
+    IoTGpioInit(KEY_GPIO);
+    IoTGpioSetFunc(KEY_GPIO, IOT_GPIO_FUNC_GPIO_11_GPIO);
+    IoTGpioSetDir(KEY_GPIO, IOT_GPIO_DIR_IN);
+	IoTGpioSetPull(KEY_GPIO, IOT_GPIO_PULL_UP);
+    IoTGpioRegisterIsrFunc(KEY_GPIO, IOT_INT_TYPE_EDGE, IOT_GPIO_EDGE_FALL_LEVEL_LOW, func, NULL);
+}
+
+
+
+
+bool isKeyON(void)
+{
+    IotGpioValue temp;
+    IoTGpioGetInputVal(KEY_GPIO,&temp);
+    return !temp;
+}
+
+void OLED_BoardInit(void)
+{   
+    IoTGpioInit(BEEP_GPIO);
+    IoTGpioSetFunc(BEEP_GPIO, IOT_GPIO_FUNC_GPIO_12_GPIO);
+    IoTGpioSetDir(BEEP_GPIO, IOT_GPIO_DIR_OUT); // 设置GPIO_14为输出模式
+
+    IoTGpioSetOutputVal(BEEP_GPIO, 1); // 设置输出高电平打开蜂鸣器
+
+    //GPIO_0复用为I2C1_SDA
+    IoTGpioInit(I2C1_SDA_GPIO);
+    IoTGpioSetFunc(I2C1_SDA_GPIO, IOT_GPIO_FUNC_GPIO_10_I2C0_SDA);
+
+    //GPIO_1复用为I2C1_SCL
+    IoTGpioInit(I2C1_SCL_GPIO);
+    IoTGpioSetFunc(I2C1_SCL_GPIO, IOT_GPIO_FUNC_GPIO_9_I2C0_SCL);
+
+    //baudrate: 400kbps
+    IoTI2cInit(WIFI_IOT_I2C_IDX_1, 400000);
+
+}
+
+ /**
+  * @brief  I2C_WriteByte,向OLED寄存器地址写一个byte的数据
+  * @param  addr:寄存器地址
+	*					data:要写入的数据
+  * @retval 无
+  */
+void I2C_WriteByte(uint8_t addr,uint8_t data)
+{
+    uint32_t ret;
+    uint8_t send_data[2] = {addr, data};
+    ret = IoTI2cWrite(WIFI_IOT_I2C_IDX_1, (OLED_ADDRESS << 1) | 0x00, send_data, 2);
+    if (ret != 0) {
+        printf("===== Error: I2C write ret = 0x%x! =====\r\n", ret);
+        return -1;
+    }
+    return 0;
+}
+
+
+ /**
+  * @brief  WriteCmd,向OLED写入命令
+  * @param  I2C_Command:命令代码
+  * @retval 无
+  */
+void WriteCmd(unsigned char I2C_Command)//写命令
+{
+	I2C_WriteByte(0x00, I2C_Command);
+}
+
+
+ /**
+  * @brief  WriteDat,向OLED写入数据
+  * @param  I2C_Data:数据
+  * @retval 无
+  */
+void WriteDat(unsigned char I2C_Data)//写数据
+{
+	I2C_WriteByte(0x40, I2C_Data);
+}
+
+
+ /**
+  * @brief  OLED_Init,初始化OLED
+  * @param  无
+  * @retval 无
+  */
+void OLED_Init(void)
+{
+	osDelay(100); //这里的延时很重要
+	
+	WriteCmd(0xAE); //display off
+	WriteCmd(0x20);	//Set Memory Addressing Mode	
+	WriteCmd(0x10);	//00,Horizontal Addressing Mode;01,Vertical Addressing Mode;10,Page Addressing Mode (RESET);11,Invalid
+	WriteCmd(0xb0);	//Set Page Start Address for Page Addressing Mode,0-7
+	WriteCmd(0xc8);	//Set COM Output Scan Direction
+	WriteCmd(0x00); //---set low column address
+	WriteCmd(0x10); //---set high column address
+	WriteCmd(0x40); //--set start line address
+	WriteCmd(0x81); //--set contrast control register
+	WriteCmd(0xff); //亮度调节 0x00~0xff
+	WriteCmd(0xa1); //--set segment re-map 0 to 127
+	WriteCmd(0xa6); //--set normal display
+	WriteCmd(0xa8); //--set multiplex ratio(1 to 64)
+	WriteCmd(0x3F); //
+	WriteCmd(0xa4); //0xa4,Output follows RAM content;0xa5,Output ignores RAM content
+	WriteCmd(0xd3); //-set display offset
+	WriteCmd(0x00); //-not offset
+	WriteCmd(0xd5); //--set display clock divide ratio/oscillator frequency
+	WriteCmd(0xf0); //--set divide ratio
+	WriteCmd(0xd9); //--set pre-charge period
+	WriteCmd(0x22); //
+	WriteCmd(0xda); //--set com pins hardware configuration
+	WriteCmd(0x12);
+	WriteCmd(0xdb); //--set vcomh
+	WriteCmd(0x20); //0x20,0.77xVcc
+	WriteCmd(0x8d); //--set DC-DC enable
+	WriteCmd(0x14); //
+	WriteCmd(0xaf); //--turn on oled panel
+}
+
+
+ /**
+  * @brief  OLED_SetPos,设置光标
+  * @param  x,光标x位置
+	*					y,光标y位置
+  * @retval 无
+  */
+void OLED_SetPos(unsigned char x, unsigned char y) //设置起始点坐标
+{ 
+	WriteCmd(0xb0+y);
+	WriteCmd(((x&0xf0)>>4)|0x10);
+	WriteCmd((x&0x0f)|0x01);
+}
+
+ /**
+  * @brief  OLED_Fill,填充整个屏幕
+  * @param  fill_Data:要填充的数据
+	* @retval 无
+  */
+void OLED_Fill(unsigned char fill_Data)//全屏填充
+{
+	unsigned char m,n;
+	for(m=0;m<8;m++)
+	{
+		WriteCmd(0xb0+m);		//page0-page1
+		WriteCmd(0x00);		//low column start address
+		WriteCmd(0x10);		//high column start address
+		for(n=0;n<128;n++)
+			{
+				WriteDat(fill_Data);
+			}
+	}
+}
+
+ /**
+  * @brief  OLED_CLS,清屏
+  * @param  无
+	* @retval 无
+  */
+void OLED_CLS(void)//清屏
+{
+	OLED_Fill(0x00);
+}
+
+
+ /**
+  * @brief  OLED_ON,将OLED从休眠中唤醒
+  * @param  无
+	* @retval 无
+  */
+void OLED_ON(void)
+{
+	WriteCmd(0X8D);  //设置电荷泵
+	WriteCmd(0X14);  //开启电荷泵
+	WriteCmd(0XAF);  //OLED唤醒
+}
+
+
+ /**
+  * @brief  OLED_OFF,让OLED休眠 -- 休眠模式下,OLED功耗不到10uA
+  * @param  无
+	* @retval 无
+  */
+void OLED_OFF(void)
+{
+	WriteCmd(0X8D);  //设置电荷泵
+	WriteCmd(0X10);  //关闭电荷泵
+	WriteCmd(0XAE);  //OLED休眠
+}
+
+
+ /**
+  * @brief  OLED_ShowStr,显示codetab.h中的ASCII字符,有6*8和8*16可选择
+  * @param  x,y : 起始点坐标(x:0~127, y:0~7);
+	*					ch[] :- 要显示的字符串; 
+	*					TextSize : 字符大小(1:6*8 ; 2:8*16)
+	* @retval 无
+  */
+void OLED_ShowStr(unsigned char x, unsigned char y, unsigned char ch[], unsigned char TextSize)
+{
+	unsigned char c = 0,i = 0,j = 0;
+	switch(TextSize)
+	{
+		case 1:
+		{
+			while(ch[j] != '\0')
+			{
+				c = ch[j] - 32;
+				if(x > 126)
+				{
+					x = 0;
+					y++;
+				}
+				OLED_SetPos(x,y);
+				for(i=0;i<6;i++)
+					WriteDat(F6x8[c][i]);
+				x += 6;
+				j++;
+			}
+		}break;
+		case 2:
+		{
+			while(ch[j] != '\0')
+			{
+				c = ch[j] - 32;
+				if(x > 120)
+				{
+					x = 0;
+					y++;
+				}
+				OLED_SetPos(x,y);
+				for(i=0;i<8;i++)
+					WriteDat(F8X16[c*16+i]);
+				OLED_SetPos(x,y+1);
+				for(i=0;i<8;i++)
+					WriteDat(F8X16[c*16+i+8]);
+				x += 8;
+				j++;
+			}
+		}break;
+	}
+}
+
+ /**
+  * @brief  OLED_ShowCN,显示codetab.h中的汉字,16*16点阵
+  * @param  x,y: 起始点坐标(x:0~127, y:0~7); 
+	*					N:汉字在codetab.h中的索引
+	* @retval 无
+  */
+void OLED_ShowCN(unsigned char x, unsigned char y, unsigned char N)
+{
+	unsigned char wm=0;
+	unsigned int  adder=32*N;
+	OLED_SetPos(x , y);
+	for(wm = 0;wm < 16;wm++)
+	{
+		WriteDat(F16x16[adder]);
+		adder += 1;
+	}
+	OLED_SetPos(x,y + 1);
+	for(wm = 0;wm < 16;wm++)
+	{
+		WriteDat(F16x16[adder]);
+		adder += 1;
+	}
+}
+
+
+
+ /**
+  * @brief  OLED_DrawBMP,显示BMP位图
+  * @param  x0,y0 :起始点坐标(x0:0~127, y0:0~7);
+	*					x1,y1 : 起点对角线(结束点)的坐标(x1:1~128,y1:1~8)
+	* @retval 无
+  */
+void OLED_DrawBMP(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1,unsigned char BMP[])
+{
+	unsigned int j=0;
+	unsigned char x,y;
+
+  if(y1%8==0)
+		y = y1/8;
+  else
+		y = y1/8 + 1;
+	for(y=y0;y<y1;y++)
+	{
+		OLED_SetPos(x0,y);
+    for(x=x0;x<x1;x++)
+		{
+			WriteDat(BMP[j++]);
+		}
+	}
+}

+ 25 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/BUILD.gn

@@ -0,0 +1,25 @@
+static_library("cloud_connect") {
+    sources = [
+        "src/cloud_communicate.c",
+        "src/cloud_schedule.c",
+    ]
+    
+    cflags = [ "-Wno-unused-variable" ]
+    cflags += [ "-Wno-unused-but-set-variable" ]
+    cflags += [ "-Wno-unused-parameter" ]
+    
+    include_dirs = [
+        "inc",
+        "../../../common/inc",
+        "//third_party/cJSON",
+        "//utils/native/lite/include/",
+    ]
+
+    deps = [ 
+        "../../../common/iot_schedule:iot_schedule",
+        "../../../common/iot_cloud:iot_cloud",
+        "../../../common/iot_wifi:iot_wifi",
+        "../../../common/iot_sntp:iot_sntp",
+    ]
+
+}

+ 172 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/inc/cloud_communicate.h

@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+
+
+/*
+    Standard information upload:
+    format:
+    serviceID
+        |-- proprety_01
+        |    |-- status
+        |-- proprety_02
+             |-- status
+
+        status:
+        typedef enum {
+            IOT_PROFILE_KEY_DATATYPE_INT = 0,
+            IOT_PROFILE_KEY_DATATYPE_LONG,
+            IOT_PROFILE_KEY_DATATYPE_FLOAT,
+            IOT_PROFILE_KEY_DATATYPE_DOUBLE,
+            IOT_PROFILE_KEY_DATATYPE_STRING,
+            IOT_PROFILE_KEY_DATATYPE_LAST,
+        }IotProfileDataType;
+
+    so we just construct a struct named InforUplod:
+    struct InforService
+    {
+        serviceIDName;
+        nextProtrety;
+    };
+    struct InforProprety
+    {
+        propretyType;
+        propretyName;
+        value;
+        nextProtrety;
+    };
+
+    IotProfileService service = createService("serviceID");
+    createProprety(&service,"propretyName",propretyType);
+    deleteProprety(&service,"propretyName",propretyType);
+    uploadService(&service);
+*/
+
+#ifndef __CLOUD_COMMUNICATE_H__
+#define __CLOUD_COMMUNICATE_H__
+
+#include "iot_cloud.h"
+#include <cmsis_os2.h>
+#include <stdbool.h>
+#include "cJSON.h"
+
+#define CLOUD_MALLOC_ENABEL true
+
+#define CLOUD_COMMAND_NAME "command_name"
+#define CLOUD_PARA_NAME "paras"
+#define WIFI_SSID_MAX_LEN_ 256
+#define WIFI_PWD_MAX_LEN_ 256
+#define KV_STORE_SSID_ID "ssid"
+#define KV_STORE_PWD_ID "pwd"
+#define NAN_WIFI_AP_SSID "CH20166"
+
+//#define NAN_WIFI_AP_SSID "bossay"
+
+#define MAX_STRING_VALUE_LEN 30
+#define MAX_CMD_NAME_LEN 30
+#define MAX_CMD_PARA_NAME_LEN 30
+
+
+typedef union 
+{
+    /* data */
+    int valueInt;
+    double valueDouble;
+    char valueString[MAX_STRING_VALUE_LEN];
+}CmdValue;
+
+typedef enum
+{
+    Cloud_Int,
+    Cloud_Double,
+    Cloud_String,
+}ValueType;
+
+typedef struct{
+    CmdValue value;
+    ValueType type;
+}FuncValue_t;
+
+typedef int (*cmdFuncCallback)(FuncValue_t value);
+
+typedef struct 
+{
+    /* data */
+    char name[MAX_CMD_PARA_NAME_LEN];
+    ValueType type;
+    cmdFuncCallback func;
+    struct CmdParam *nxt;
+}CmdParam;
+
+
+typedef struct {
+//    CmdValue value;
+    char name[MAX_CMD_NAME_LEN];
+    CmdParam* params;
+    struct cmdNode *nxt;
+}CmdNode;
+
+
+typedef struct{
+    char ssid[WIFI_SSID_MAX_LEN_];
+    char pwd[WIFI_PWD_MAX_LEN_];
+}WIFI_ssid_pwd;
+
+
+
+int getStoredWifiInfo(WIFI_ssid_pwd* wifi);
+int setStoredWifiInfo(WIFI_ssid_pwd* wifi);
+int NanWifiConnect(bool restartNan);
+int cloud_CloudInit(const char *deviceID, const char *devicePwd, \
+    const char *serverIP, const char *serverPort);
+
+// this .h file has the 'namespace' cloud, all the variables has the prefix cloud or CLOD
+/*---------------------- The lower is uploadind message to the cloud ------------------------*/
+typedef IotProfileService   Cloud_Servic;
+typedef IotProfileKV        Cloud_Proprety;
+typedef IotProfileDataType  Cloud_DataType;
+
+
+
+#if CLOUD_MALLOC_ENABEL == true
+
+Cloud_Servic* cloud_createService(const char* name,const char * event);
+int cloud_createAndAppendProprety(Cloud_Servic *service,const char *name,Cloud_DataType type,void* value);
+void cloud_deleteService(Cloud_Servic *service);
+
+CmdNode* cloud_createCmd(char* name);
+CmdParam* cloud_createAndAppendPara(CmdNode* cmd,const char* name,ValueType type,cmdFuncCallback func);
+void cloud_deleteCmd();
+#endif
+
+#if CLOUD_MALLOC_ENABEL == false
+
+void cloud_initService(Cloud_Servic *service,const char* name,const char * event);
+void cloud_initAndAppendProprety(Cloud_Servic *service,Cloud_Proprety *proprety,const char *name,Cloud_DataType type,void* value);
+
+void cloud_initCmd(CmdNode* nextNode,char* name);
+void cloud_initAndAppendPara(CmdNode* cmd,CmdParam* para,const char* name,ValueType type,cmdFuncCallback func);
+
+#endif
+
+int cloud_uploadService(Cloud_Servic *service);
+
+/*----------------------- The lower is download message from cloud -------------------------*/
+bool cloud_isCommandName(cJSON* root,char* name);
+
+
+
+#define cloud_Connect CLOUD_Connect
+
+#endif

+ 78 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/inc/cloud_schedule.h

@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+
+#ifndef __CLOUD_SCHEDULE_H__
+#define __CLOUD_SCHEDULE_H__
+
+#include "iot_schedule.h"
+#include "cloud_communicate.h"
+
+#include <stdbool.h>
+#include <time.h>
+
+#define CN_MAX_WEEKDAY 7
+#define CN_MAX_SCHID 30
+
+
+// #define CLOUD_SCHEDULE_MALLOC_EN true
+// #if CLOUD_SCHEDULE_MALLOC_EN
+#define CLOUD_SCHEDULE_NAME_LEN 15
+// #else
+// #define CLOUD_SCHEDULE_NAME_LEN 30
+// #endif
+
+typedef struct tm TIME;
+
+typedef enum{
+    SCHE_UPDATE = 0,
+    SCHE_ADD,
+    SCHE_DELELTE,
+}SheduleUpdateOption;
+
+typedef struct{
+    CmdParam* param;
+    CmdValue value;
+}CmdControl;
+
+typedef struct {
+    uint8_t Days;         // the day which has 1001100 format
+    uint8_t startHour;   // less than 24
+    uint8_t startMinute; // less than 60
+    uint8_t startSeconds;
+    uint16_t duration;    // less than 1440
+    CmdControl ctrl;
+    char id[CLOUD_SCHEDULE_NAME_LEN];
+    struct ScheduleCtrl_t* nxt;
+}ScheduleCtrl_t;
+
+
+
+
+void bindingScheduleToCmd(ScheduleCtrl_t* schedule,CmdNode* cmd,const char* name,ValueType type,cmdFuncCallback func);
+
+void ScheduleInit();
+
+void updataSchedule(ScheduleCtrl_t* shedule,SheduleUpdateOption option);
+
+
+ScheduleCtrl_t* cloud_createSchedule(char* id,uint8_t wdays,uint8_t start_hour,uint8_t start_min,\
+                                    uint8_t start_sec,uint16_t dur, CmdControl ctrl);
+int cloud_updateSchedule(char* id,uint8_t wdays,uint8_t start_hour,uint8_t start_min,\
+                                    uint8_t start_sec,uint16_t dur);
+int cloud_deleteScheduleByID(const char* id);
+
+
+
+#endif

+ 527 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/src/cloud_communicate.c

@@ -0,0 +1,527 @@
+/*
+ * @Author: bearpi_gdtr
+ * @Date: 2022-03-18 17:32:25
+ * @LastEditTime: 2022-03-26 10:43:49
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: \v3_0_2\vendor\bossay\smart_door\demo_smartdoor\cloud_command\src\cloud_commuinate.c
+ */
+#include "cloud_communicate.h"
+#include "network_config_service.h"
+#include "iot_wifi.h"
+#include "kv_store.h"
+#include <stdio.h>
+#include <string.h>
+
+
+static CmdNode cmdNodeFirst = {
+    .nxt = NULL,
+    .params = NULL,
+    .name = NULL,
+    //.value.valueU64 = 0,
+};
+
+/**
+ * @description: get wifi inforamtion from kvstore
+ * @param {WIFI_ssid_pwd*} wifi
+ * @return {*}
+ */
+int getStoredWifiInfo(WIFI_ssid_pwd* wifi)
+{
+    int ret = -1;
+    ret = UtilsGetValue(KV_STORE_SSID_ID,wifi->ssid,WIFI_SSID_MAX_LEN_);
+    if(ret != 0){
+        RaiseLog(LOG_LEVEL_DEBUG,"Can't get the wifi ssid from kV store");
+        return ret;
+    }
+    ret = UtilsGetValue(KV_STORE_PWD_ID,wifi->pwd,WIFI_PWD_MAX_LEN_);
+    if(ret != 0){
+        RaiseLog(LOG_LEVEL_DEBUG,"Can't get the wifi pwd from kV store");
+        return ret;
+    }
+    RaiseLog(LOG_LEVEL_INFO, "get wifi success! \n");
+    RaiseLog(LOG_LEVEL_INFO,"Wifi ssid: %s",wifi->ssid);
+    RaiseLog(LOG_LEVEL_INFO,"Wifi pwd: %s",wifi->pwd);
+    return ret;
+}
+
+/**
+ * @description: store the wifi
+ * @param {WIFI_ssid_pwd*} wifi
+ * @return {*}
+ */
+int setStoredWifiInfo(WIFI_ssid_pwd* wifi)
+{
+    int ret = -1;
+    ret = UtilsSetValue(KV_STORE_SSID_ID,wifi->ssid);
+    if(ret != 0){
+        RaiseLog(LOG_LEVEL_DEBUG,"Can't store the wifi ssid to the kV store");
+        return ret;
+    }
+    ret = UtilsSetValue(KV_STORE_PWD_ID,wifi->pwd);
+    if(ret != 0){
+        RaiseLog(LOG_LEVEL_DEBUG,"Can't store the wifi pwd to the kV store");
+        return ret;
+    }
+    RaiseLog(LOG_LEVEL_INFO, "Store wifi success! \n");
+    return ret;
+}
+
+/**
+ * @description: initialize the cloud
+ * @param {*}
+ * @return {*}
+ */
+int cloud_CloudInit(const char *deviceID, const char *devicePwd, \
+    const char *serverIP, const char *serverPort)
+{
+    if (CLOUD_Init() != 0) {
+        RaiseLog(LOG_LEVEL_DEBUG,"Cloud init failed");
+        return -1;
+    }
+    if (CLOUD_Connect(deviceID, devicePwd,\
+            serverIP, serverPort) != 0) {
+        RaiseLog(LOG_LEVEL_DEBUG,"Cloud connect failed");
+        return -1;
+    }
+    return 0;
+}
+
+/**
+ * @description: NAN connect the wifi
+ * @param {WIFI_ssid_pwd} *wifi
+ * @return {*}
+ */
+int NanWifiConnect(bool restartNan)
+{
+    WIFI_ssid_pwd wifi;
+    printf("--------------- NAN --------------------%d\n",sizeof(wifi.ssid));
+    if(restartNan){
+        goto CLOUD_START_NAN;
+    }
+    if(getStoredWifiInfo(&wifi) == 0){
+        goto CLOUD_CONNECT_WIFI;
+    }
+    // goto CLOUD_CONNECT_WIFI;   //新增语句
+CLOUD_START_NAN:
+
+    RaiseLog(LOG_LEVEL_INFO,"Try to get the wifi info by NAN network....");
+    int ret;
+    ret = BOARD_NAN_NetCfgStartConfig(NAN_WIFI_AP_SSID,wifi.ssid,sizeof(wifi.ssid),\
+                                        wifi.pwd,sizeof(wifi.pwd));
+    if(ret != 0){
+        RaiseLog(LOG_LEVEL_INFO,"NAN network get wifi info failed");
+        return ret;
+    }
+    RaiseLog(LOG_LEVEL_INFO,"NAN network get wifi info success");
+    RaiseLog(LOG_LEVEL_INFO,"Wifi ssid: %s",wifi.ssid);
+    RaiseLog(LOG_LEVEL_INFO,"Wifi pwd: %s",wifi.pwd);
+
+CLOUD_CONNECT_WIFI:
+
+    BOARD_InitWifi();
+    ret = BOARD_ConnectWifi(wifi.ssid, wifi.pwd);
+    // ret = BOARD_ConnectWifi("Bossay", "Bossay@123");   //新增语句
+
+    if (ret != 0) {
+        RaiseLog(LOG_LEVEL_ERR, "Connect to wifi failed! \n");
+        NotifyNetCfgResult(NETCFG_DEV_INFO_INVALID);
+        return ret;
+    }
+    NotifyNetCfgResult(NETCFG_OK);
+    StopNetCfg();
+    ret = setStoredWifiInfo(&wifi);
+    if(ret != 0){
+        RaiseLog(LOG_LEVEL_ERR,"Wifi info store failed!");
+    }
+    return ret;
+}
+
+
+
+/**
+ * @description: cloud_createService: create one service
+ * @param {char*} name: serviceID's name.
+ * @param {char *} event: The event time of service,which cloud be the NULL
+ * @return {*}
+ */
+Cloud_Servic* cloud_createService(const char* name,const char * event)
+{
+    Cloud_Servic* service = malloc(sizeof(Cloud_Servic));
+    if(service == NULL){
+        RaiseLog(LOG_LEVEL_DEBUG,"malloc Cloud_Proprety failed!");
+        return;
+    }
+    service->serviceID = name;
+    service->propertyLst = NULL;
+    service->nxt = NULL;
+    service->eventTime = NULL;
+    return service;
+}
+
+/**
+ * @description: cloud_appendProprety : append one proprety to service
+ * @param {Cloud_Servic} *service : .....
+ * @param {char} *name : proprety's name
+ * @param {Cloud_DataType} type: proprety's type.
+ * @param {void*} value: proprety's value
+ * @return {*}
+ */
+int cloud_createAndAppendProprety(Cloud_Servic *service,const char *name,Cloud_DataType type,void* value)
+{   
+    Cloud_Proprety* tempPrp;
+    Cloud_Servic* tempService;
+    Cloud_Proprety* prpty = malloc(sizeof(Cloud_Proprety));
+    if(prpty == NULL){
+        RaiseLog(LOG_LEVEL_DEBUG,"malloc Cloud_Proprety failed!");
+        return -1;
+    }
+    prpty->nxt = NULL;
+    prpty->type = type;
+    prpty->value = value;
+    prpty->key = name;
+    tempPrp = service->propertyLst;
+    if(tempPrp == NULL){
+        service->propertyLst = prpty;
+    }else{
+        while(tempPrp->nxt != NULL){
+            tempPrp = tempPrp->nxt;
+        }
+        tempPrp->nxt = prpty;
+    }
+    return 0;
+}
+
+/**
+ * @description: cloud_appendPropretyAndUpload :
+ *               upload the service to the cloud,
+ * @param {Cloud_Servic} *service : .....
+ * @param {char} *name : proprety's name
+ * @param {Cloud_DataType} type: proprety's type.
+ * @param {void*} value: proprety's value
+ * @return {*}
+ */
+int cloud_uploadService(Cloud_Servic *service)
+{
+    cJSON* jsonString;
+    int ret;
+    jsonString = IoTProfilePackage(service);
+    if (NULL != jsonString) {
+        RaiseLog(LOG_LEVEL_INFO, "jsonString:%s", jsonString);
+        ret = CLOUD_ReportMsg(jsonString);
+        free(jsonString);
+        return ret;
+    }
+    return -1;
+}
+
+
+/**
+ * @description: delete the Service
+ * @param {Cloud_Servic} *service
+ * @return {*}
+ */
+void cloud_deleteService(Cloud_Servic *service)
+{
+    Cloud_Proprety* tempPrp;
+    Cloud_Servic* tempService;
+        // free the service and it's propreties.
+    tempService = service;
+    while(tempService != NULL){
+        tempPrp = tempService->propertyLst;
+        while(tempPrp != NULL){
+            Cloud_Proprety* prp = tempPrp;
+            tempPrp = tempPrp->nxt;
+            free(prp);
+        }
+        Cloud_Servic* svc;
+        tempService = tempService->nxt;
+        free(svc);
+    }
+}
+
+/**
+ * @description: 
+ * @param {Cloud_Servic} *service
+ * @param {char*} name
+ * @param {char *} event
+ * @return {*}
+ */
+void cloud_initService(Cloud_Servic *service,const char* name,const char * event)
+{
+    service->serviceID = name;
+    service->propertyLst = NULL;
+    service->nxt = NULL;
+    service->eventTime = NULL;
+    return service;
+}
+
+/**
+ * @description: 
+ * @param {Cloud_Servic} *service
+ * @param {Cloud_Proprety} *prpty
+ * @param {char} *name
+ * @param {Cloud_DataType} type
+ * @param {void*} value
+ * @return {*}
+ */
+void cloud_initAndAppendProprety(Cloud_Servic *service,Cloud_Proprety *prpty,const char *name,Cloud_DataType type,void* value)
+{
+    Cloud_Proprety* tempPrp;
+    Cloud_Servic* tempService;
+    prpty->nxt = NULL;
+    prpty->type = type;
+    prpty->value = value;
+    prpty->key = name;
+    tempPrp = service->propertyLst;
+    if(tempPrp == NULL){
+        service->propertyLst = prpty;
+    }else{
+        while(tempPrp->nxt != NULL){
+            tempPrp = tempPrp->nxt;
+        }
+        tempPrp->nxt = prpty;
+    }
+}
+
+/**
+ * @description: create Para for cmd
+ * @param {CmdNode*} cmd
+ * @param {ValueType} type
+ * @param {cmdFuncCallback} func
+ * @return {CmdParam*}
+ */
+CmdParam* cloud_createAndAppendPara(CmdNode* cmd,const char* name,ValueType type,cmdFuncCallback func)
+{
+    CmdParam* para = malloc(sizeof(CmdParam));
+    if(para == NULL){
+        RaiseLog(LOG_LEVEL_DEBUG,"Malloc CmdParam failed!");
+        return para;
+    }
+    strcpy(para->name,name);
+    para->nxt = NULL;
+    para->func = func;
+    para->type = type;
+
+    if(cmd->params == NULL){
+        cmd->params = para;
+        return para;
+    }
+
+    CmdParam* pTemp = cmd->params;
+    while (pTemp->nxt != NULL){
+        pTemp = pTemp->nxt;
+    }
+    pTemp->nxt = para;
+    return para;
+}
+
+/**
+ * @description: create cmd add to the cmd list cmdNodeFirst which static defined in this file
+ * @param {char*} name
+ * @return {*}
+ */
+CmdNode* cloud_createCmd(char* name)
+{
+    CmdNode* cmd = malloc(sizeof(CmdNode));
+    if(cmd == NULL){
+        RaiseLog(LOG_LEVEL_ERR,"Malloc CmdBode failed!");
+        return -1;
+    }
+    strcpy(cmd->name,name);
+    cmd->nxt = NULL;
+    cmd->params = NULL;
+
+    CmdNode* pTemp = &cmdNodeFirst;
+    while (pTemp->nxt != NULL){
+        pTemp = pTemp->nxt;
+    }
+    pTemp->nxt = cmd;
+    return cmd;
+}
+
+/**
+ * @description: free all the cmd and their paras except cmdNodeFirst
+ * @param {*}
+ * @return {*}
+ */
+void cloud_deleteCmd()
+{
+    CmdNode* pCmd = cmdNodeFirst.nxt;
+    CmdParam* pPara;
+    while (pCmd != NULL)
+    {
+        pPara = pCmd->params;
+        while (pPara != NULL){
+           CmdParam* tempP = pPara;
+           pPara = pPara->nxt;
+           free(tempP);
+        }
+        CmdNode* tempC = pCmd;
+        pCmd = pCmd->nxt;
+        free(tempC);
+    }
+}
+
+
+/**
+ * @description: init one cmd
+ * @param {CmdNode*} cmd
+ * @param {char*} name
+ * @return {*}
+ */
+void cloud_initCmd(CmdNode* cmd,char* name)
+{
+    strcpy(cmd->name,name);
+    cmd->nxt = NULL;
+    cmd->params = NULL;
+
+    CmdNode* pTemp = &cmdNodeFirst;
+    while (pTemp->nxt != NULL){
+        pTemp = pTemp->nxt;
+    }
+    pTemp->nxt = cmd;
+}
+
+
+/**
+ * @description: init one cmdparam and append it to the end of cmd
+ * @param {CmdNode*} cmd
+ * @param {CmdParam*} para
+ * @param {char*} name
+ * @param {ValueType} type
+ * @param {cmdFuncCallback} func
+ * @return {*}
+ */
+void cloud_initAndAppendPara(CmdNode* cmd,CmdParam* para,const char* name,ValueType type,cmdFuncCallback func)
+{
+    strcpy(para->name,name);
+    para->nxt = NULL;
+    para->func = func;
+    para->type = type;
+    if(cmd->params == NULL){
+        cmd->params = para;
+        return 0;
+    }
+
+    CmdParam* pTemp = cmd->params;
+    while (pTemp->nxt != NULL){
+        pTemp = pTemp->nxt;
+    }
+    pTemp->nxt = para;
+    return 0;
+}
+
+/**
+ * @description: cloud_isCommandName: Determine if Parameters has the json object named objName
+ * @param {cJSON*} root
+ * @param {char*} objName
+ * @param {cJSON*} retObj
+ * @return {*}
+ */
+bool cloud_isCommandName(cJSON* root,char* name)
+{
+    cJSON* obj = cJSON_GetObjectItem(root,CLOUD_COMMAND_NAME);
+    if(obj==NULL){
+        RaiseLog(LOG_LEVEL_DEBUG,"root json don't has json object named 'command_name'.");
+        return false;
+    }
+    if(0 == strcmp(cJSON_GetStringValue(obj),name)){
+        return true;
+        
+    }
+    return false;
+}
+
+
+/**
+ * @description: check the cmd list and execute the callback functions of paras
+ * @param {*}
+ * @return {*}
+ */
+int cloud_checkCmdListAndExec(cJSON* root)
+{
+    CmdNode* cmd = cmdNodeFirst.nxt;
+    while (cmd != NULL)
+    {
+        CmdParam* para = cmd->params;
+        if(cloud_isCommandName(root,cmd->name))
+        {
+            while (para != NULL)
+            {
+                cJSON* paraObj = NULL;
+                CmdValue value;
+
+                cJSON* objParas = cJSON_GetObjectItem(root,CLOUD_PARA_NAME);
+                if(objParas==NULL){
+                    RaiseLog(LOG_LEVEL_DEBUG,"Root json don't has json object named 'paras'.");
+                    return -1;
+                }
+                paraObj = cJSON_GetObjectItem(objParas,para->name);
+                if(paraObj==NULL){
+                    RaiseLog(LOG_LEVEL_DEBUG,"paras don't has json object named %s",para->name);
+                    para = para->nxt;
+                    continue;
+                }
+                // if the paras object has parameter named para->name
+                FuncValue_t fValue;
+                switch(para->type)
+                {
+                    case Cloud_Int:
+                        value.valueInt = cJSON_GetNumberValue(paraObj);
+                        fValue.type = Cloud_Int;
+                        fValue.value = value;
+                        para->func(fValue);
+                        break;
+                    case Cloud_Double:
+                        value.valueDouble = cJSON_GetNumberValue(paraObj);
+                        fValue.type = Cloud_Double;
+                        fValue.value = value;
+                        para->func(fValue);
+                        break;
+                    case Cloud_String:
+                        strcpy(value.valueString,cJSON_GetStringValue(paraObj));
+                        fValue.type = Cloud_String;
+                        fValue.value = value;
+                        para->func(fValue);
+                        break;
+                    default: 
+                        break;
+                }
+                para = para->nxt;
+            }
+            return 0;
+        }
+        cmd = cmd->nxt;
+    }
+    return -1;
+}
+
+
+/**
+ * @description: The cloud call back function
+ * @param {char} *jsonString
+ * @return {*}
+ */
+int CLOUD_CommandCallBack(const char *jsonString)
+{
+    cJSON* root = NULL;
+    cJSON* obj = NULL;
+    int ret = -1;
+    if(jsonString == NULL){
+        RaiseLog(LOG_LEVEL_DEBUG,"Received none data from cloud!");
+        return ret;
+    }
+    root = cJSON_Parse(jsonString);
+    if(root == NULL){
+        RaiseLog(LOG_LEVEL_DEBUG,"No data parsed from json string!");
+        return ret;
+    }
+    ret = cloud_checkCmdListAndExec(root);
+    free(root);
+    return ret;
+}
+
+
+
+

+ 300 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/cloud_connect/src/cloud_schedule.c

@@ -0,0 +1,300 @@
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+
+#include "cloud_schedule.h"
+#include "iot_demo_def.h"
+#include "ohos_init.h"
+#include <time.h>
+#include <stdbool.h>
+#include "iot_sntp.h"
+
+
+#define TIMER_PERIOD 1      // [s]
+#define SCHEDULE_TASK_SIZE 1024*6
+#define SCHEDULE_TASK_PRIOR 25
+#define CONFIG_LOCAL_TIMEZONE  8
+#define ONE_MINUITE_SECONDS 60
+#define ONE_HOUR_SECONDS 3600
+#define ONE_DAY_SECOND_SECONDS 86400
+#define SNTP_TIME_YEAR_OFFSET 1900
+#define CONFIG_TASK_SCHEDULE_SIZE 0x1000
+#define CONFIG_TASK_SCHEDULE_PRIOR 31
+
+
+static time_t currentTime = 0;
+static osTimerId_t osTimer_ID;
+static ScheduleCtrl_t scheduleFirstNode = {
+    .nxt = NULL,
+};
+static int oneHourSeconds = TIMER_PERIOD * 3600;
+static int quarterMinuSeconds = TIMER_PERIOD * 15;
+
+/**
+ * @description: Bind the schedule to the command which is defined in cloud communicate
+ * @param {ScheduleCtrl_t*} schedule
+ * @param {CmdNode*} cmd
+ * @param {char*} name
+ * @param {ValueType} type
+ * @param {cmdFuncCallback} func
+ * @return {*}
+ */
+void bindingScheduleToCmd(ScheduleCtrl_t* schedule,CmdNode* cmd,const char* name,ValueType type,cmdFuncCallback func)
+{
+    CmdParam* para = &schedule->ctrl;
+    strcpy(para->name,name);
+    para->nxt = NULL;
+    para->func = func;
+    para->type = type;
+
+    if(cmd->params == NULL){
+        cmd->params = para;
+        return para;
+    }
+
+    CmdParam* pTemp = cmd->params;
+    while (pTemp->nxt != NULL){
+        pTemp = pTemp->nxt;
+    }
+    pTemp->nxt = para;
+    return para;
+}
+
+/**
+ * @description: Get current time by sntp and up sync the local time
+ * @param {*}
+ * @return {*}
+ */
+TIME getAndUpdateCurrentTm()
+{
+    TIME time;
+    if(SntpGetRtcTime(CONFIG_LOCAL_TIMEZONE, &time) != 0){
+        RaiseLog(LOG_LEVEL_DEBUG,"Sync the time failed!");
+                return *localtime(&currentTime);
+    }
+    currentTime = mktime(&time);
+    return time;
+}
+/**
+ * @description: Get start seconds in one day  interval: (0,86400)
+ * @param {ScheduleCtrl_t*} schedule
+ * @return {*}
+ */
+uint32_t getStartSecondsInDay(const ScheduleCtrl_t* schedule)
+{
+    return schedule->startHour * ONE_HOUR_SECONDS + schedule->startMinute * ONE_MINUITE_SECONDS + schedule->startSeconds;
+}
+
+/**
+ * @description: Get end seconds in one day  interval: (0,86400)
+ * @param {ScheduleCtrl_t*} schedule
+ * @return {*}
+ */
+uint32_t getEndSecondsInDay(const ScheduleCtrl_t* schedule)
+{
+    return getStartSecondsInDay(schedule) + schedule->duration;
+}
+
+
+/**
+ * @description: determine whether current time is in the time period of schedule
+ * @param {ScheduleCtrl_t*} schedule
+ * @return {*}
+ */
+bool isTimeToStartSchedule(const ScheduleCtrl_t* schedule)
+{
+    TIME ctime = getAndUpdateCurrentTm();
+    uint8_t days = schedule->Days;
+
+    uint8_t cday = ctime.tm_wday;
+    uint8_t chour = ctime.tm_hour;
+    uint8_t cmin = ctime.tm_min;
+    uint8_t csec = ctime.tm_sec;
+    RaiseLog(LOG_LEVEL_INFO,"%d%d%d%d",cday,chour,cmin,csec);
+    uint32_t currentSecondInday = chour*ONE_HOUR_SECONDS + cmin*ONE_MINUITE_SECONDS + csec;
+    //gdtr_TODO: check the format of tm_wday and change it
+    if((days >> (cday)) & 0x01){ // today is in schedule
+        if(currentSecondInday >= getStartSecondsInDay(schedule) &&\
+         currentSecondInday <= getEndSecondsInDay(schedule)){
+             RaiseLog(LOG_LEVEL_INFO,"is execute time of schedule");
+             return true;
+         }
+    }
+    RaiseLog(LOG_LEVEL_INFO," is not execute time of schedule");
+    return false;
+}
+
+/**
+ * @description: The local timer callback every a quarter minuite
+ * @param {void*} argument
+ * @return {*}
+ */
+void scheduleTimeCallback(void* argument)
+{
+    currentTime++;
+    quarterMinuSeconds -= TIMER_PERIOD;
+}
+
+void scheduleThreadCallback(void* arguement)
+{
+    for(;;)
+    {
+        if(quarterMinuSeconds <= 0){
+            ScheduleCtrl_t* ptr = scheduleFirstNode.nxt;
+            FuncValue_t value;
+            RaiseLog(LOG_LEVEL_INFO,"---------------------");
+            while (ptr != NULL)
+            {
+                if(isTimeToStartSchedule(ptr)){
+                    RaiseLog(LOG_LEVEL_INFO,"Start the schedule%s",ptr->id);
+                    value.type = ptr->ctrl.param->type;
+                    value.value = ptr->ctrl.value;
+                    ptr->ctrl.param->func(value);
+                }        
+                ptr = ptr->nxt;
+            }
+            quarterMinuSeconds = 15*TIMER_PERIOD;
+        }
+        osDelay(40);
+    }
+}
+
+/**
+ * @description: Schedule initilize function
+ * @param {ScheduleCtrl_t*} schedule
+ * @return {*}
+ */
+void ScheduleInit()
+{
+    int ret;
+    TIME time;
+    SntpGetRtcTime(CONFIG_LOCAL_TIMEZONE, &time);
+    if(ret != 0){
+        RaiseLog(LOG_LEVEL_DEBUG,"Get Simple Network Time Protocol failed!");
+        return;
+    }
+    currentTime = mktime(&time);
+    
+    RaiseLog(LOG_LEVEL_DEBUG,"Current time is:%d",currentTime);
+    RaiseLog(LOG_LEVEL_INFO,"%4d.%2d.%2d %2d:%2d:%2d",time.tm_yday + SNTP_TIME_YEAR_OFFSET,time.tm_mon,time.tm_mday,\
+                time.tm_hour,time.tm_min,time.tm_sec);
+    osTimerAttr_t attr_timer;
+    attr_timer.name = "scheduleTimer";
+    attr_timer.cb_mem = NULL;
+    attr_timer.cb_size = NULL;
+    osTimer_ID = osTimerNew(scheduleTimeCallback,osTimerPeriodic,NULL,&attr_timer);
+    osTimerStart(osTimer_ID,TIMER_PERIOD * 100);
+
+    osThreadAttr_t attr_thread;
+    attr_thread.attr_bits = 0U;
+    attr_thread.cb_mem = NULL;
+    attr_thread.cb_size = 0U;
+    attr_thread.stack_mem = NULL;
+    attr_thread.stack_size = CONFIG_TASK_SCHEDULE_SIZE;
+    attr_thread.priority = CONFIG_TASK_SCHEDULE_PRIOR;
+    attr_thread.name = "IoTMain";
+    (void) osThreadNew((osThreadFunc_t)scheduleThreadCallback, NULL, (const osThreadAttr_t *)&attr_thread);
+
+    return;
+}
+
+/**
+ * @description: Create one schedule and put it to the scheduleFirstNode static variable which defined in this file
+ * @param {*}
+ * @return {*}
+ */
+ScheduleCtrl_t* cloud_createSchedule(char* id,uint8_t wdays,uint8_t start_hour,uint8_t start_min,\
+                                    uint8_t start_sec,uint16_t dur, CmdControl ctrl)
+{
+    if(start_hour > 24 || start_min > 60 || start_sec > 60 || dur > 1440){
+        RaiseLog(LOG_LEVEL_DEBUG,"Wrong format of schedule");
+        return NULL;
+    }
+
+    ScheduleCtrl_t* schedule = malloc(sizeof(ScheduleCtrl_t));
+    if(schedule == NULL){
+        RaiseLog(LOG_LEVEL_ERR,"Malloc Schedule failed!");
+        return schedule;
+    }
+    
+    strcpy(schedule->id,id);
+    schedule->ctrl = ctrl;
+    schedule->Days  = wdays;
+    schedule->startHour = start_hour;
+    schedule->startMinute = start_min;
+    schedule->startSeconds = start_sec;
+    schedule->duration = dur;
+    schedule->nxt = NULL;
+
+    ScheduleCtrl_t* ptr = &scheduleFirstNode;
+    while (ptr->nxt != NULL){
+        ptr = ptr->nxt;
+    }
+    ptr->nxt = schedule;
+    return schedule;
+}
+
+/**
+ * @description: Delete the schedule
+ * @param {char*} id
+ * @return {*}
+ */
+int cloud_deleteScheduleByID(const char* id)
+{
+    ScheduleCtrl_t* ptr = &scheduleFirstNode;
+    ScheduleCtrl_t* temp;
+    while (ptr->nxt != NULL)
+    { 
+        temp = ptr->nxt;
+        if(strcmp(temp->id,id) == 0){
+            ptr = temp->nxt;
+            free(temp);
+            return 0;
+        }
+        ptr = ptr->nxt;
+    }
+    RaiseLog(LOG_LEVEL_DEBUG,"No %s in the schedule list",id);
+    return -1;
+}
+
+/**
+ * @description: update the schedule
+ * @param {*}
+ * @return {*}
+ */
+int cloud_updateSchedule(char* id,uint8_t wdays,uint8_t start_hour,uint8_t start_min,\
+                                    uint8_t start_sec,uint16_t dur)
+{
+    ScheduleCtrl_t* ptr = scheduleFirstNode.nxt;
+    while (ptr != NULL)
+    {
+        if(strcmp(ptr->id,id) == 0){
+            ptr->Days = wdays;
+            ptr->startHour = start_hour;
+            ptr->startMinute = start_min;
+            ptr->startSeconds = start_sec;
+            ptr->duration = dur;
+            return 0;
+        }
+        ptr = ptr->nxt;
+    }
+    RaiseLog(LOG_LEVEL_DEBUG,"No %s in the schedule list",id);
+    return -1;
+}
+
+
+
+
+
+

+ 224 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/main_entry.c

@@ -0,0 +1,224 @@
+
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+
+
+
+#include "iot_cloud.h"
+#include "iot_boardled.h"
+#include "iot_boardbutton.h"
+#include "iot_wifi.h"
+#include "iot_netcfg.h"
+#include "iot_sntp.h"
+#include "ohos_init.h"
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <cmsis_os2.h>
+#include <stdbool.h>
+#include "kv_store.h"
+#include "iot_schedule.h"
+#include "network_config_service.h"
+#include "iot_netcfg_nan.h"
+
+#include "hi_reset.h"
+#include "cloud_communicate.h"
+#include "cloud_schedule.h"
+#include "CH2O.h"
+#include "OLED_I2C.h"
+
+#define CONFIG_TASK_MAIN_STACKSIZE 0x2000
+#define CONFIG_TASK_MAIN_PRIOR 25
+
+#define CONFIG_CLOUD_DEFAULT_SERVERIP "121.36.42.100"   // Huawei cloud service ip
+#define CONFIG_CLOUD_DEFAULT_SERVERPORT "1883"          // // Huawei cloud service port
+//#define CLOUD_DEVICE_ID "62b6baa44c7c4e3646b781cb_Lamp01"   // user need to change it according to the device id in cloud
+#define CLOUD_DEVICE_ID "6380926de0dd6929d6d9ffd0_CH20166" 
+#define CLOUD_DEVICE_PWD "12345678"  // user need to change it according to the device pwd in cloud
+
+#define NFC_DEVICE_ID_LEN 50
+#define NFC_DEVICE_PWD_LEN 50
+
+typedef struct{
+    char* nfc_dev_id[NFC_DEVICE_ID_LEN];
+    char* nfc_dev_pwd[NFC_DEVICE_PWD_LEN];
+    ScheduleCtrl_t schedule;
+    osTimerId_t timeID;
+}AppCtrl_t;
+
+
+static bool keyStatus = false;
+
+//新增开始
+static int cmdBeepStatus;
+static float threshold;
+static float CH2ODensity;
+int cmdBeepCallback(FuncValue_t ret)
+{
+    RaiseLog(LOG_LEVEL_INFO,"Beep Status Cmd:%s",ret.value.valueString); 
+    if((strcmp(ret.value.valueString,"ON"))==0){
+        cmdBeepStatus = ON;
+    }else{
+        cmdBeepStatus = OFF;
+        //CH2ODensity = 0;
+    }
+    return 0;
+}
+
+
+int cmdThresholdCallback(FuncValue_t ret)
+{   
+    RaiseLog(LOG_LEVEL_INFO,"Threshold is :%f",ret.value.valueDouble);
+    threshold=ret.value.valueDouble;
+    printf("$$$$$$$&&&&&&& threshold is :%f\r\n", threshold);
+    // if(cmdBeepStatus==OFF){
+    //     threshold=0;
+    // }
+    return 0;
+    
+    // RaiseLog(LOG_LEVEL_INFO,"Threshold:%d",ret.value.valueInt);
+    // threshold=ret.value.valueInt;
+    // printf("$$$$$$$&&&&&&& threshold is :%f\r\n", threshold);
+    // return 0;
+}
+//新增结束
+
+
+void keycallback(char* arg){
+    keyStatus = true;
+    return;
+}
+
+void IotMainTaskEntry(void* argument)
+{
+    // uint8_t ret;
+    // float  ppm;
+
+    int ret;
+
+    BoardInit();
+    usleep(1000000);
+    //usleep(100);
+    MQ2PPMCalibration();  
+    //LedSafeStatusSet(ON);
+
+    initKey(keycallback);
+    IOT_ScheduleInit();
+    BOARD_InitWifi();
+    osDelay(300);
+    NanWifiConnect(keyStatus);
+    cloud_CloudInit(CLOUD_DEVICE_ID,CLOUD_DEVICE_PWD,CONFIG_CLOUD_DEFAULT_SERVERIP,CONFIG_CLOUD_DEFAULT_SERVERPORT);
+
+    // Cloud_Servic* service = cloud_createService("CH2O_Monitoring",NULL);
+    // cloud_createAndAppendProprety(service,"CH2O_status",IOT_PROFILE_KEY_DATATYPE_INT,(void*)&ppm);
+
+    Cloud_Servic* service = cloud_createService("CH2ODetection",NULL);
+    cloud_createAndAppendProprety(service,"CH2ODensity",IOT_PROFILE_KEY_DATATYPE_FLOAT,(void*)&CH2ODensity);   
+    cloud_createAndAppendProprety(service,"Threshold",IOT_PROFILE_KEY_DATATYPE_FLOAT,(void*)&threshold);   
+    cloud_createAndAppendProprety(service,"BeepStatus",IOT_PROFILE_KEY_DATATYPE_INT,(void*)&cmdBeepStatus);  
+
+    CmdNode* cmdBeepCtrl = cloud_createCmd("SetBeepStatus");
+    CmdParam* paraBeep = cloud_createAndAppendPara(cmdBeepCtrl,"BeepStatus",Cloud_String,cmdBeepCallback);
+    printf("******----&&*******%s,%s*********--***\r\n",*cmdBeepCtrl,*paraBeep);
+
+
+    CmdNode* cmdThresholdCtrl = cloud_createCmd("SetThreshold");   
+    CmdParam* paraThreshold = cloud_createAndAppendPara(cmdThresholdCtrl,"Threshold",Cloud_Double,cmdThresholdCallback);   
+    printf("**********+++****%s,%s**********++***\r\n",*cmdThresholdCtrl,*paraThreshold);   
+
+    printf("=================================================\r\n");
+    printf("************* CH2O_Monitoring_example ***********\r\n");
+    printf("=================================================\r\n");
+    for(;;)
+    // {
+    //     ret = GetMQ2PPM(&ppm);
+    //     if (ret != 0) {
+    //         printf("ADC Read Fail\n");
+    //         continue;
+    //     }
+    //     RaiseLog(LOG_LEVEL_INFO,"CH2O is  %d",ppm);
+    //     if (ppm > 20) {
+    //         BeepStatusSet(ON);
+    //         LedSafeStatusSet(OFF);
+    //         LedWarnStatusSet(ON);
+    //     } else {
+    //         BeepStatusSet(OFF);
+    //         LedSafeStatusSet(ON);
+    //         LedWarnStatusSet(OFF);
+    //     }
+    //     cloud_uploadService(service);
+    //     osDelay(100);
+    // }
+
+    {        
+
+        ret = GetMQ2PPM(&CH2ODensity);
+        if (ret != 0) {
+            printf("ADC Read Fail\n");
+            continue;
+            //return ;
+        }
+        printf("+++***@@@ CH2ODensity is :%.3f \n", CH2ODensity);
+        printf("+++***@@@ threshold is %f\r\n",threshold);
+
+        //if (CH2ODensity > 20) {
+        if (CH2ODensity > threshold) {
+            cmdBeepStatus = ON;
+            printf("cmdBeepStatusON is %d\r\n",cmdBeepStatus);
+            BeepStatusSet(cmdBeepStatus);
+            LedSafeStatusSet(OFF);
+            LedWarnStatusSet(ON);
+        } else {
+            cmdBeepStatus = OFF;
+            printf("cmdBeepStatusOFF is %d\r\n",cmdBeepStatus);
+            BeepStatusSet(cmdBeepStatus);
+            LedSafeStatusSet(ON);
+            LedWarnStatusSet(OFF);
+        }
+
+        printf("cmdBeepStatus is %d\r\n",cmdBeepStatus);
+        printf("threshold is %f\r\n",threshold);
+        osDelay(100);
+
+        cloud_uploadService(service);
+        osDelay(100);
+    }
+
+
+
+}
+
+static void EntryMain(void)
+{
+    osThreadAttr_t attr;
+    RaiseLog(LOG_LEVEL_INFO, "DATA:%s Time:%s \r\n", __FUNCTION__, __DATE__, __TIME__);
+    // Create the IoT Main task
+    attr.attr_bits = 0U;
+    attr.cb_mem = NULL;
+    attr.cb_size = 0U;
+    attr.stack_mem = NULL;
+    attr.stack_size = CONFIG_TASK_MAIN_STACKSIZE;
+    attr.priority = CONFIG_TASK_MAIN_PRIOR;
+    attr.name = "IoTMain";
+    (void) osThreadNew((osThreadFunc_t)IotMainTaskEntry, NULL, (const osThreadAttr_t *)&attr);
+
+    return;
+}
+APP_FEATURE_INIT(EntryMain);
+
+
+

+ 23 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/sensor/BUILD.gn

@@ -0,0 +1,23 @@
+static_library("bossay_hi3861_l0_sensor") {
+    sources = [
+        "src/CH2O.c"
+    ]
+    
+    cflags = [ "-Wno-unused-variable" ]
+    cflags += [ "-Wno-unused-but-set-variable" ]
+    cflags += [ "-Wno-unused-parameter" ]
+    
+    include_dirs = [
+        "inc",
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "//device/bossay/hi3861_l0/sdk_liteos/include",
+    ]
+
+    deps = [ 
+
+    ]
+
+}
+
+

+ 33 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/sensor/inc/CH2O.h

@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2020  Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+
+#ifndef __E53_SF1_H__
+#define __E53_SF1_H__
+
+typedef enum
+{
+	OFF = 0,
+	ON
+} SwitchStatus;
+
+void BoardInit(void);
+void MQ2PPMCalibration(void);
+int GetMQ2PPM(float *ppm);
+void BeepStatusSet(SwitchStatus status);
+void LedSafeStatusSet(SwitchStatus status);
+void LedWarnStatusSet(SwitchStatus status);	
+
+#endif /* __E53_SF1_H__ */
+

+ 169 - 0
vendor/bossay/CH2O_Monitoring/demo_CH2O_Monitoring/sensor/src/CH2O.c

@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2020  Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+
+#include "CH2O.h"
+#include "iot_adc.h"
+#include "iot_errno.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "iot_pwm.h"
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#define CAL_PPM 20 //校准环境中PPM值
+#define RL 1       // RL阻值
+
+#define WIFI_IOT_IO_NAME_GPIO_8 8
+#define WIFI_IOT_PWM_PORT_PWM1 1
+#define WIFI_IOT_IO_FUNC_GPIO_8_PWM1_OUT 5
+
+#define SAFE_LED_GPIO 14
+#define WARN_LED_GPIO 7
+
+static float R0; //元件在洁净空气中的阻值
+
+/***************************************************************
+ * 函数名称: MQ2Init
+ * 说    明: 初始化MQ2Init
+ * 参    数: 无
+ * 返 回 值: 无
+ ***************************************************************/
+void BoardInit(void)
+{
+    IoTGpioInit(SAFE_LED_GPIO);
+    IoTGpioSetFunc(SAFE_LED_GPIO, IOT_GPIO_FUNC_GPIO_14_GPIO);
+    IoTGpioSetDir(SAFE_LED_GPIO, IOT_GPIO_DIR_OUT); //设置为输出模式
+
+    IoTGpioInit(WARN_LED_GPIO);
+    IoTGpioSetFunc(WARN_LED_GPIO, IOT_GPIO_FUNC_GPIO_7_GPIO);
+    IoTGpioSetDir(WARN_LED_GPIO, IOT_GPIO_DIR_OUT); //设置为输出模式
+
+    IoTGpioInit(WIFI_IOT_IO_NAME_GPIO_8);                                      //初始化GPIO_8
+    IoTGpioSetFunc(WIFI_IOT_IO_NAME_GPIO_8, WIFI_IOT_IO_FUNC_GPIO_8_PWM1_OUT); //设置GPIO_8引脚复用功能为PWM
+    IoTGpioSetDir(WIFI_IOT_IO_NAME_GPIO_8, IOT_GPIO_DIR_OUT);                  //设置GPIO_8引脚为输出模式
+    IoTPwmInit(WIFI_IOT_PWM_PORT_PWM1);                                        //初始化PWM1端口
+}
+/***************************************************************
+* 函数名称: GetVoltage
+* 说    明: 获取电压值函数
+* 参    数: 无
+*								
+* 返 回 值: 无
+***************************************************************/
+static float GetVoltage(void)
+{
+    unsigned int ret;
+    unsigned short data;
+
+    ret = IoTAdcRead(5, &data, IOT_ADC_EQU_MODEL_8, IOT_ADC_CUR_BAIS_DEFAULT, 0xff);
+    if (ret != IOT_SUCCESS)
+    {
+        printf("ADC Read Fail\n");
+    }
+    return (float)data * 1.8 * 4 / 4096.0;
+}
+/***************************************************************
+ * 函数名称: GetMQ2PPM
+ * 说    明: 获取PPM函数
+ * 参    数: ppm 烟雾浓度
+ * 返 回 值: 0 成功; -1 失败
+ ***************************************************************/
+int GetMQ2PPM(float* ppm)
+{
+    unsigned int ret;
+    unsigned short data;
+    float voltage, RS;
+
+    ret = IoTAdcRead(6, &data, IOT_ADC_EQU_MODEL_8, IOT_ADC_CUR_BAIS_DEFAULT, 0xff);
+    if (ret != 0) {
+        printf("ADC Read Fail\n");
+        return -1;
+    }
+    voltage = (float)data * 1.8 * 4 / 4096.0;
+    RS = (5 - voltage) / voltage * RL;     //计算RS
+    if(R0 != 0){
+        *ppm = 613.9f * pow(RS / R0, -2.074f); //计算ppm
+    }
+    return 0;
+}
+
+/***************************************************************
+ * 函数名称: MQ2PPMCalibration
+ * 说    明: 传感器校准函数
+ * 参    数: 无
+ * 返 回 值: 无
+ ***************************************************************/
+void MQ2PPMCalibration(void)
+{
+    float voltage = GetVoltage();
+    float RS = (5 - voltage) / voltage * RL;
+    R0 = RS / pow(CAL_PPM / 613.9f, 1 / -2.074f);
+}
+
+/***************************************************************
+ * 函数名称: BeepStatusSet
+ * 说    明: 蜂鸣器报警与否
+ * 参    数: status,ENUM枚举的数据
+ *									OFF,蜂鸣器
+ *									ON,开蜂鸣器
+ * 返 回 值: 无
+ ***************************************************************/
+void BeepStatusSet(SwitchStatus status)
+{
+    if (status == ON) {
+        IoTPwmStart(WIFI_IOT_PWM_PORT_PWM1, 50, 4000); //输出PWM波
+    }
+    if (status == OFF) {
+        IoTPwmStop(WIFI_IOT_PWM_PORT_PWM1);
+    }
+}
+/***************************************************************
+ * 函数名称: LedSafeStatusSet
+ * 说    明: LED_Safe状态设置
+ * 参    数: status,ENUM枚举的数据
+ *									OFF,关
+ *									ON,开
+ * 返 回 值: 无
+ ***************************************************************/
+void LedSafeStatusSet(SwitchStatus status)
+{
+    if (status == ON) {
+        IoTGpioSetOutputVal(SAFE_LED_GPIO, 1); // 设置GPIO_7输出高电平点亮灯
+    }
+    if (status == OFF) {
+        IoTGpioSetOutputVal(SAFE_LED_GPIO, 0); // 设置GPIO_7输出低电平关闭灯
+    }
+}
+
+/***************************************************************
+ * 函数名称: LedWarnStatusSet
+ * 说    明: LED_Warn状态设置
+ * 参    数: status,ENUM枚举的数据
+ *									OFF,关
+ *									ON,开
+ * 返 回 值: 无
+ ***************************************************************/
+void LedWarnStatusSet(SwitchStatus status)
+{
+    if (status == ON) {
+        IoTGpioSetOutputVal(WARN_LED_GPIO, 1); // 设置GPIO_14输出高电平点亮灯
+    }
+
+    if (status == OFF) {
+        IoTGpioSetOutputVal(WARN_LED_GPIO, 0); // 设置GPIO_14输出低电平关闭灯
+    }
+}

+ 27 - 0
vendor/bossay/CH2O_Monitoring/hals/utils/sys_param/BUILD.gn

@@ -0,0 +1,27 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_sysparam") {
+  sources = [ "hal_sys_param.c" ]
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+  ]
+  defines = [
+      "INCREMENTAL_VERSION=\"${ohos_version}\"",
+      "BUILD_TYPE=\"${ohos_build_type}\"",
+      "BUILD_USER=\"${ohos_build_user}\"",
+      "BUILD_TIME=\"${ohos_build_time}\"",
+      "BUILD_HOST=\"${ohos_build_host}\"",
+      "BUILD_ROOTHASH=\"${ohos_build_roothash}\"",
+    ]
+}

+ 128 - 0
vendor/bossay/CH2O_Monitoring/hals/utils/sys_param/hal_sys_param.c

@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_sys_param.h"
+
+static const char OHOS_DEVICE_TYPE[] = {"****"};
+static const char OHOS_DISPLAY_VERSION[] = {"OpenHarmony 3.0 LTS"};
+static const char OHOS_MANUFACTURE[] = {"****"};
+static const char OHOS_BRAND[] = {"****"};
+static const char OHOS_MARKET_NAME[] = {"****"};
+static const char OHOS_PRODUCT_SERIES[] = {"****"};
+static const char OHOS_PRODUCT_MODEL[] = {"****"};
+static const char OHOS_SOFTWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_PROFILE[] = {"aout:true,display:true"};
+static const char OHOS_BOOTLOADER_VERSION[] = {"bootloader"};
+static const char OHOS_ABI_LIST[] = {"****"};
+static const char OHOS_SERIAL[] = {"1234567890"};  // provided by OEM.
+static const int OHOS_FIRST_API_VERSION = 1;
+
+static const char EMPTY_STR[] = {""};
+
+const char* HalGetDeviceType(void)
+{
+    return OHOS_DEVICE_TYPE;
+}
+
+const char* HalGetManufacture(void)
+{
+    return OHOS_MANUFACTURE;
+}
+
+const char* HalGetBrand(void)
+{
+    return OHOS_BRAND;
+}
+
+const char* HalGetMarketName(void)
+{
+    return OHOS_MARKET_NAME;
+}
+
+const char* HalGetProductSeries(void)
+{
+    return OHOS_PRODUCT_SERIES;
+}
+
+const char* HalGetProductModel(void)
+{
+    return OHOS_PRODUCT_MODEL;
+}
+
+const char* HalGetSoftwareModel(void)
+{
+    return OHOS_SOFTWARE_MODEL;
+}
+
+const char* HalGetHardwareModel(void)
+{
+    return OHOS_HARDWARE_MODEL;
+}
+
+const char* HalGetHardwareProfile(void)
+{
+    return OHOS_HARDWARE_PROFILE;
+}
+
+const char* HalGetSerial(void)
+{
+    return OHOS_SERIAL;
+}
+
+const char* HalGetBootloaderVersion(void)
+{
+    return OHOS_BOOTLOADER_VERSION;
+}
+
+const char* HalGetAbiList(void)
+{
+    return OHOS_ABI_LIST;
+}
+
+const char* HalGetDisplayVersion(void)
+{
+    return OHOS_DISPLAY_VERSION;
+}
+
+const char* HalGetIncrementalVersion(void)
+{
+    return INCREMENTAL_VERSION;
+}
+
+const char* HalGetBuildType(void)
+{
+    return BUILD_TYPE;
+}
+
+const char* HalGetBuildUser(void)
+{
+    return BUILD_USER;
+}
+
+const char* HalGetBuildHost(void)
+{
+    return BUILD_HOST;
+}
+
+const char* HalGetBuildTime(void)
+{
+    return BUILD_TIME;
+}
+
+int HalGetFirstApiVersion(void)
+{
+    return OHOS_FIRST_API_VERSION;
+}

+ 22 - 0
vendor/bossay/CH2O_Monitoring/hals/utils/token/BUILD.gn

@@ -0,0 +1,22 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_token_static") {
+  sources = [ "hal_token.c" ]
+
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+  deps = []
+}

+ 104 - 0
vendor/bossay/CH2O_Monitoring/hals/utils/token/hal_token.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_token.h"
+#include "ohos_errno.h"
+#include "ohos_types.h"
+
+static int OEMReadToken(char *token, unsigned int len)
+{
+    // OEM need add here, read token from device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMWriteToken(const char *token, unsigned int len)
+{
+    // OEM need add here, write token to device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetAcKey(char *acKey, unsigned int len)
+{
+    // OEM need add here, get AcKey
+    (void)(acKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdId(char *productId, unsigned int len)
+{
+    // OEM need add here, get ProdId
+    (void)(productId);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdKey(char *productKey, unsigned int len)
+{
+    // OEM need add here, get ProdKey
+    (void)(productKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+
+int HalReadToken(char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMReadToken(token, len);
+}
+
+int HalWriteToken(const char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMWriteToken(token, len);
+}
+
+int HalGetAcKey(char *acKey, unsigned int len)
+{
+    if (acKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetAcKey(acKey, len);
+}
+
+int HalGetProdId(char *productId, unsigned int len)
+{
+    if (productId == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdId(productId, len);
+}
+
+int HalGetProdKey(char *productKey, unsigned int len)
+{
+    if (productKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdKey(productKey, len);
+}

+ 8 - 0
vendor/bossay/DCMOTOR/BUILD.gn

@@ -0,0 +1,8 @@
+group("DCMOTOR")
+ {
+    deps = [
+           "SOURCE_DCMOTOR:dcmotor",
+           "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+           "../common/iot_wifi:iot_wifi",
+          ]
+ } 

+ 10 - 0
vendor/bossay/DCMOTOR/SOURCE_DCMOTOR/BUILD.gn

@@ -0,0 +1,10 @@
+static_library("dcmotor")  
+ {
+    sources = [ "main_entry.c",  ]
+    include_dirs = [
+                 "//utils/native/lite/include", 
+                 "//base/iot_hardware/peripheral/interfaces/kits",
+                 "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+                 "//device/bossay/hi3861_l0/sdk_liteos/include"
+               ]
+ }

+ 55 - 0
vendor/bossay/DCMOTOR/SOURCE_DCMOTOR/main_entry.c

@@ -0,0 +1,55 @@
+#include <stdio.h>
+#include "ohos_init.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "cmsis_os2.h"
+unsigned char CodeArr[8] = 
+{ //2相激励
+  0xC, 0x6, 0x3, 0x9, 0xC, 0x6, 0x3, 0x9
+};
+
+void moto(void* args )
+{
+ int i;
+ printf("moto thread running...");
+ for(i=7;i<=12;i++)
+ {
+  IoTGpioInit(i);
+  IoTGpioSetDir(i,IOT_GPIO_DIR_OUT);
+  IoTGpioSetFunc(i,0);
+  IoTGpioSetOutputVal(i,0);
+ } 
+ //IoTGpioSetFunc(13,IOT_GPIO_FUNC_GPIO_13_GPIO);
+ int c = 9;
+ int idx = 0;
+ while(1)
+ {
+  unsigned char code = CodeArr[idx];
+  for(i = 9;i<=12;i++)
+   {
+    IoTGpioSetOutputVal(i,code & 0x1);
+    code = code >> 1;
+   }
+  printf("sleep");
+  usleep(1000);
+  idx = (idx+1)%8;
+ }
+}
+
+void moto_entry()
+{
+ printf("moto_entry called \n");
+ osThreadAttr_t attr;
+ attr.name = "thread_moto";
+ attr.attr_bits = 0U; // 如果为1 ,则可以使用osThreadJoin函数
+ attr.cb_mem = NULL; //控制快的指针
+ attr.cb_size = 0U;
+ attr.stack_mem = NULL; //栈内存指针
+ attr.stack_size = 1024 * 4; //栈大小
+ attr.priority = 25; //优先级
+ if (osThreadNew((osThreadFunc_t)moto, NULL, &attr) == NULL)
+  {
+   printf("Falied to create thread!\n");
+  }
+}
+APP_FEATURE_INIT(moto_entry);

+ 52 - 0
vendor/bossay/DCMOTOR/config.json

@@ -0,0 +1,52 @@
+{
+    "product_name": "DCMOTOR",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 20 - 0
vendor/bossay/DCMOTOR/hals/utils/sys_param/BUILD.gn

@@ -0,0 +1,20 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_sysparam") {
+  sources = [ "hal_sys_param.c" ]
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+}

+ 200 - 0
vendor/bossay/DCMOTOR/hals/utils/sys_param/hal_sys_param.c

@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_sys_param.h"
+#include <securec.h>
+
+static const char OHOS_PRODUCT_TYPE[] = {"****"};
+static const char OHOS_MANUFACTURE[] = {"****"};
+static const char OHOS_BRAND[] = {"****"};
+static const char OHOS_MARKET_NAME[] = {"****"};
+static const char OHOS_PRODUCT_SERIES[] = {"****"};
+static const char OHOS_PRODUCT_MODEL[] = {"****"};
+static const char OHOS_SOFTWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_PROFILE[] = {"aout:true,display:true"};
+static const char OHOS_BOOTLOADER_VERSION[] = {"bootloader"};
+static const char OHOS_SECURITY_PATCH_TAG[] = {"2023-03-31"};
+static const char OHOS_ABI_LIST[] = {"****"};
+static const char OHOS_SERIAL[] = {"1234567890"};  // provided by OEM.
+
+char* HalGetProductType(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_TYPE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_TYPE) + 1, OHOS_PRODUCT_TYPE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetManufacture(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MANUFACTURE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MANUFACTURE) + 1, OHOS_MANUFACTURE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBrand(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BRAND) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BRAND) + 1, OHOS_BRAND) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetMarketName(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MARKET_NAME) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MARKET_NAME) + 1, OHOS_MARKET_NAME) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductSeries(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_SERIES) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_SERIES) + 1, OHOS_PRODUCT_SERIES) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_MODEL) + 1, OHOS_PRODUCT_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSoftwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SOFTWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SOFTWARE_MODEL) + 1, OHOS_SOFTWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_MODEL) + 1, OHOS_HARDWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareProfile(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_PROFILE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_PROFILE) + 1, OHOS_HARDWARE_PROFILE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSerial(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SERIAL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SERIAL) + 1, OHOS_SERIAL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBootloaderVersion(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BOOTLOADER_VERSION) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BOOTLOADER_VERSION) + 1, OHOS_BOOTLOADER_VERSION) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSecurityPatchTag(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SECURITY_PATCH_TAG) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SECURITY_PATCH_TAG) + 1, OHOS_SECURITY_PATCH_TAG) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetAbiList(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_ABI_LIST) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_ABI_LIST) + 1, OHOS_ABI_LIST) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}

+ 22 - 0
vendor/bossay/DCMOTOR/hals/utils/token/BUILD.gn

@@ -0,0 +1,22 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_token_static") {
+  sources = [ "hal_token.c" ]
+
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+  deps = []
+}

+ 104 - 0
vendor/bossay/DCMOTOR/hals/utils/token/hal_token.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_token.h"
+#include "ohos_errno.h"
+#include "ohos_types.h"
+
+static int OEMReadToken(char *token, unsigned int len)
+{
+    // OEM need add here, read token from device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMWriteToken(const char *token, unsigned int len)
+{
+    // OEM need add here, write token to device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetAcKey(char *acKey, unsigned int len)
+{
+    // OEM need add here, get AcKey
+    (void)(acKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdId(char *productId, unsigned int len)
+{
+    // OEM need add here, get ProdId
+    (void)(productId);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdKey(char *productKey, unsigned int len)
+{
+    // OEM need add here, get ProdKey
+    (void)(productKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+
+int HalReadToken(char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMReadToken(token, len);
+}
+
+int HalWriteToken(const char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMWriteToken(token, len);
+}
+
+int HalGetAcKey(char *acKey, unsigned int len)
+{
+    if (acKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetAcKey(acKey, len);
+}
+
+int HalGetProdId(char *productId, unsigned int len)
+{
+    if (productId == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdId(productId, len);
+}
+
+int HalGetProdKey(char *productKey, unsigned int len)
+{
+    if (productKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdKey(productKey, len);
+}

+ 4 - 0
vendor/bossay/DHT11/BUILD.gn

@@ -0,0 +1,4 @@
+group("DHT11") {
+    deps = ["./demo_DHT11:bossay_hi3861_l0_demo_DHT11",
+            "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk"]
+}

+ 95 - 0
vendor/bossay/DHT11/config.json

@@ -0,0 +1,95 @@
+{
+  "product_name": "DHT11",
+  "ohos_version": "OpenHarmony 1.0",
+  "device_company": "bossay",
+  "board": "hi3861_l0",
+  "kernel_type": "liteos_m",
+  "kernel_version": "",
+  "subsystems": [
+    {
+      "subsystem": "applications",
+      "components": [
+        { "component": "wifi_iot_sample_app", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "iot_hardware",
+      "components": [
+        { "component": "iot_controller", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "hiviewdfx",
+      "components": [
+        { "component": "hilog_lite", "features":[] },
+        { "component": "hievent_lite", "features":[] },
+        { "component": "blackbox", "features":[] },
+        { "component": "hidumper_mini", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "distributed_schedule",
+      "components": [
+        { "component": "samgr_lite", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "security",
+      "components": [
+        { "component": "hichainsdk", "features":[] },
+        { "component": "deviceauth_lite", "features":[] },
+        { "component": "huks", "features":
+          [
+            "disable_huks_binary = false",
+            "disable_authenticate = false",
+            "huks_use_lite_storage = true",
+            "huks_use_hardware_root_key = true",
+            "huks_config_file = \"hks_config_lite.h\"",
+            "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+          ]
+        }
+      ]
+    },
+    {
+      "subsystem": "startup",
+      "components": [
+        { "component": "bootstrap_lite", "features":[] },
+        { "component": "syspara_lite", "features":
+          [
+            "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+          ]
+        }
+      ]
+    },
+    {
+      "subsystem": "communication",
+      "components": [
+        { "component": "wifi_lite", "features":[] },
+        { "component": "softbus_lite", "features":[] },
+        { "component": "wifi_aware", "features":[]}
+      ]
+    },
+    {
+      "subsystem": "update",
+      "components": [
+        { "component": "ota_lite", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "iot",
+      "components": [
+        { "component": "iot_link", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "utils",
+      "components": [
+        { "component": "file", "features":[] },
+        { "component": "kv_store", "features":[] },
+        { "component": "os_dump", "features":[] }
+      ]
+    }
+  ],
+  "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+  "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+}

+ 35 - 0
vendor/bossay/DHT11/demo_DHT11/BUILD.gn

@@ -0,0 +1,35 @@
+static_library("bossay_hi3861_l0_demo_DHT11") {
+    sources = [
+        "main_entry.c",
+    ]
+    
+    cflags = [ "-Wno-unused-variable" ]
+    cflags += [ "-Wno-unused-but-set-variable" ]
+    cflags += [ "-Wno-unused-parameter" ]
+    
+    include_dirs = [
+        "./sensor/inc",
+        "../../common/inc",
+        "cloud_connect/inc",
+        "//third_party/cJSON",
+        "./OLED/include",
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "//device/bossay/hi3861_l0/sdk_liteos/include"
+        
+    ]
+
+    deps = [ 
+         "../../common/iot_sntp:iot_sntp",
+         "../../common/iot_wifi:iot_wifi",
+         "../../common/iot_schedule:iot_schedule",
+         #"../../common/iot_nfc:iot_nfc",
+         "../../common/iot_cloud:iot_cloud",
+         #"../../common/iot_boardled:iot_boardled",
+         #"../../common/iot_boardbutton:iot_boardbutton",
+         #"cloud_connect:cloud_connect",
+         #"sensor:bossay_hi3861_l0_sensor",
+         #"OLED:bossay_hi3816l0_OLED",
+    ]
+
+}

+ 184 - 0
vendor/bossay/DHT11/demo_DHT11/main_entry.c

@@ -0,0 +1,184 @@
+#include "iot_cloud.h"
+#include "iot_boardled.h"
+#include "iot_boardbutton.h"
+#include "iot_wifi.h"
+#include "iot_netcfg.h"
+#include "iot_sntp.h"
+#include "ohos_init.h"
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <cmsis_os2.h>
+#include <stdbool.h>
+#include "kv_store.h"
+#include "iot_schedule.h"
+#include "network_config_service.h"
+#include "iot_netcfg_nan.h"
+#include "hi_time.h"
+#include "hi_reset.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+
+
+#define CONFIG_TASK_MAIN_STACKSIZE 0x2000
+#define CONFIG_TASK_MAIN_PRIOR 25
+#define DHT11_DQ_GPIO 13
+											   
+void GPIO_mode_out(void)
+{
+    IoTGpioInit(DHT11_DQ_GPIO);
+    IoTGpioSetFunc(DHT11_DQ_GPIO, IOT_GPIO_FUNC_GPIO_13_GPIO);
+    IoTGpioSetDir(DHT11_DQ_GPIO, IOT_GPIO_DIR_OUT); // 设置为输出模式
+}
+
+void GPIO_mode_in(void)
+{
+    IoTGpioInit(DHT11_DQ_GPIO);
+    IoTGpioSetFunc(DHT11_DQ_GPIO, IOT_GPIO_FUNC_GPIO_13_GPIO);
+    IoTGpioSetDir(DHT11_DQ_GPIO, IOT_GPIO_DIR_IN); // 设置为输入模式
+
+}
+
+static uint8_t DHT11_DQ_IN(void)
+{
+	IotGpioValue temp = {0};
+    IoTGpioGetInputVal(DHT11_DQ_GPIO,&temp);
+    return temp;
+}
+
+//Reset DHT11
+void DHT11_Rst(void)	   
+{                 
+    GPIO_mode_out(); 	//SET OUTPUT
+    IoTGpioSetOutputVal(DHT11_DQ_GPIO, 0); 	//GPIOA.0=0
+	printf("rst start\r \n");
+    osDelay(2);    	//Pull down Least 18ms
+    printf("rst down\r \n");
+    IoTGpioSetOutputVal(DHT11_DQ_GPIO, 1);	//GPIOA.0=1 
+    
+    hi_udelay(30);     	//Pull up 20~40us
+    printf("rst ok\r \n");
+}
+
+uint8_t DHT11_Check(void) 	   
+{   
+	uint8_t retry=0;
+	GPIO_mode_in();//SET INPUT	 
+    while (DHT11_DQ_IN()&&retry<100)//DHT11 Pull down 40~80us
+	{
+		retry++;
+		hi_udelay(1);
+	};	 
+	if(retry>=100)
+		return 1;
+	else 
+		retry=0;
+    while (!DHT11_DQ_IN()&&retry<100)//DHT11 Pull up 40~80us
+	{
+		retry++;
+		hi_udelay(1);
+	};
+	if(retry>=100)
+		return 1;//chack error	    
+	return 0;
+}
+
+uint8_t DHT11_Read_Bit(void) 			 
+{
+ 	uint8_t retry=0;
+	while(DHT11_DQ_IN()&&retry<100)//wait become Low level
+	{
+		retry++;
+		hi_udelay(1);
+	}
+	retry=0;
+	while(!DHT11_DQ_IN()&&retry<100)//wait become High level
+	{
+		retry++;
+		hi_udelay(1);
+	}
+	hi_udelay(50);//wait 40us
+	if(DHT11_DQ_IN())
+		return 1;
+	else 
+		return 0;		   
+}
+
+uint8_t DHT11_Read_Byte(void)    
+{        
+    uint8_t i,dat;
+    dat=0;
+	for (i=0;i<8;i++) 
+	{
+   		dat<<=1; 
+	    dat|=DHT11_Read_Bit();
+    }						    
+    return dat;
+}
+
+uint8_t DHT11_Read_Data(uint8_t *temperature,uint8_t *humidity)    
+{        
+ 	uint8_t buf[5];
+	uint8_t i;
+	DHT11_Rst();
+	if(DHT11_Check()==0)
+	{
+		for(i=0;i<5;i++)
+		{
+			buf[i]=DHT11_Read_Byte();
+		}
+		if((buf[0]+buf[1]+buf[2]+buf[3])==buf[4])
+		{
+			*humidity=buf[0];
+			*temperature=buf[2];
+		}
+	}
+	else 
+		return 1;
+	return 0;	    
+}
+
+
+
+static void EntryMain(void)
+{
+    
+
+    int ret;
+    uint8_t dht_temperature;
+	uint8_t dht_humidity;
+    printf("***********************DTH11 demo******************\r\n");
+    while(1){
+
+        DHT11_Read_Data(&dht_temperature,&dht_humidity);
+        RaiseLog(LOG_LEVEL_INFO,"temperature=%d\r\n",dht_temperature);
+		RaiseLog(LOG_LEVEL_INFO,"humidity=%d\r\n",dht_humidity);
+        osDelay(1000);
+    }
+}
+// static void EntryMain(void)
+// {
+//     osThreadAttr_t attr;
+//     RaiseLog(LOG_LEVEL_INFO, "DATA:%s Time:%s \r\n", __FUNCTION__, __DATE__, __TIME__);
+//     // Create the IoT Main task
+//     attr.attr_bits = 0U;
+//     attr.cb_mem = NULL;
+//     attr.cb_size = 0U;
+//     attr.stack_mem = NULL;
+//     attr.stack_size = CONFIG_TASK_MAIN_STACKSIZE;
+//     attr.priority = CONFIG_TASK_MAIN_PRIOR;
+//     attr.name = "IoTMain";
+//     (void) osThreadNew((osThreadFunc_t)IotMainTaskEntry, NULL, (const osThreadAttr_t *)&attr);
+
+//     return;
+// }
+APP_FEATURE_INIT(EntryMain);
+
+
+
+
+
+
+

+ 8 - 0
vendor/bossay/Digital_tube/BUILD.gn

@@ -0,0 +1,8 @@
+group("Digital_tube") 
+ {
+    deps = [
+           "SOURCE_Digital_tube:tube",
+           "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+           "../common/iot_wifi:iot_wifi",
+          ]
+ } 

+ 17 - 0
vendor/bossay/Digital_tube/SOURCE_Digital_tube/BUILD.gn

@@ -0,0 +1,17 @@
+static_library("tube")  {
+    sources = [
+        "main_entry.c",
+        "iic_my.c",
+        "tm1637.c",
+    ]
+    include_dirs = [
+        "//utils/native/lite/include",
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "//device/bossay/hi3861_l0/sdk_liteos/include",
+
+    ]
+}
+
+
+

+ 195 - 0
vendor/bossay/Digital_tube/SOURCE_Digital_tube/iic_my.c

@@ -0,0 +1,195 @@
+#include "iic_my.h"
+int IIC_SDA;
+int IIC_CLK;
+void IIC_SetPort(int sda,int clk)
+{
+     IIC_SDA = sda;
+     IIC_CLK = clk;
+    }
+int IIC_SdaRead(void)
+{
+     int READED;
+    //  uint8_t READED; 
+    //  IotGpioValue READED = IOT_GPIO_VALUE1;      //==定义存贮电平的变量value 枚举类型有value0-value1
+    // IoTGpioGetInputVal(KEY_TEST_GPIO,&value);  //==获取GPIO user 按键引脚电平
+     //IoTGpioGetInputVal(IIC_SDA,&READED);
+     IoTGpioGetInputVal(IIC_SDA,&READED);
+     printf("IIC_SdaRead %02x\n",READED);
+     return READED;
+    }	
+/*****************************************************************
+ * 函数名:IIC_Start
+     * 功  能:起始信号
+     * 参  数:无
+     * 返回值:无
+     * 说  明:无
+******************************************************************/
+void IIC_Start()
+{
+     printf("iic_start\n");
+     IIC_SdaModeOut();
+     IIC_SclModeOut();
+     IIC_SdaOutput_H();
+     IIC_SclOutput_H(); //初始都是高电平
+     delay_us(5);//>4.7us
+     IIC_SdaOutput_L(); //拉低SDA
+     delay_us(4);//>4us
+     IIC_SclOutput_L(); //拉低CLK
+}
+/******************************************************************
+    * 函数名:IIC_Stop
+    * 功  能:结束信号  clk高电平时存在高跳变
+    * 参  数:无
+    * 返回值:无
+    * 说  明:无
+*******************************************************************/
+void IIC_Stop(void)
+{
+     printf("IIC_Stop\n");
+     IIC_SdaModeOut();
+     IIC_SclOutput_L();
+     delay_us(5);
+     IIC_SdaOutput_L();
+     delay_us(5);
+     IIC_SclOutput_H();
+     delay_us(5);//>4us
+     IIC_SdaOutput_H();
+     delay_us(4);//>4.7us
+}
+/*****************************************************************
+ * 函数名:IIC_Ack
+     * 功  能:应答信号
+     * 参  数:无
+     * 返回值:无
+     * 说  明:无
+******************************************************************/
+void IIC_Ack(void)
+{
+      printf("IIC_Ack\n");
+      // 原代码
+      // IIC_SdaModeOut();
+      // IIC_SclOutput_L();
+      // IIC_SdaOutput_L();
+      // IIC_SclOutput_H();
+      // delay_us(4);//>4us
+      // IIC_SclOutput_L();
+      // 新代码
+      printf("IIC_Ack\n");
+      IIC_SdaModeIn();
+      IIC_SclOutput_L();
+      IIC_SclOutput_H();
+      delay_us(4);//>4us
+      int ack= 1;
+      if(ack = IIC_SdaRead())
+       { // change while to if to debug
+        printf("ACK is %d \n",ack);
+        delay_us(5);
+       }
+      printf("ACK is %d \n",ack);
+      IIC_SclOutput_L();
+      delay_us(5);
+}
+/******************************************************************
+ 函数名:IIC_NoAck
+  * 功  能:非应答信号
+  * 参  数:无
+  * 返回值:无
+  * 说  明:无
+*****************************************************************/
+void IIC_NoAck(void)
+{
+     printf("IIC_NoAck\n");
+     IIC_SdaModeOut();
+     IIC_SclOutput_L();
+     IIC_SdaOutput_H();
+     IIC_SclOutput_H();
+     delay_us(4);//>4us
+     IIC_SclOutput_L();
+}
+/******************************************************************
+  * 函数名:IIC_WaitAck
+  * 功  能:等待应答信号
+  * 参  数:无
+  * 返回值:0应答成功,1应答失败
+  * 说  明:从机把总线拉低,为应答成功
+  *******************************************************************/
+uint8_t IIC_WaitAck(void)
+{
+    printf("IIC_WaitAck\n");
+    uint8_t u8ErrCnt = 0;
+    IIC_SdaModeIn();//输入状态
+    IIC_SdaOutput_H();
+    IIC_SclOutput_H();
+    while (IIC_SdaRead() == 1)
+    {
+      u8ErrCnt++;
+      if (u8ErrCnt > 250)
+      {
+	   IIC_Stop();//发送停止信号
+	   return 1;
+      }
+    }
+     IIC_SclOutput_L();
+     return 0;
+}
+/******************************************************************
+  * 函数名:IIC_WriteByte
+  * 功  能:SDA线上输出一字节
+  * 参  数:u8Data需要写入的数据
+  * 返回值:无
+  * 说  明:无
+*******************************************************************/
+void IIC_WriteByte(uint8_t u8Data)
+{
+    printf("IIC_WriteByte %02x\n",u8Data);
+    uint8_t i;
+    uint8_t u8Temp;
+    IIC_SdaModeOut();
+    // 拉低SCL 后 设置好SDA 后 拉高SCL
+    IIC_SclOutput_L();
+    for (i = 0; i < 8; i++)
+    {
+     delay_us(2);
+     #ifdef IIC_LSB//低位在前
+       u8Temp = ((u8Data << (7 - i)) & 0x80);
+      (u8Temp == 0x80) ? (IIC_SdaOutput_H()) : (IIC_SdaOutput_L());	
+     #else//高位在前
+       u8Temp = ((u8Data >> (7 - i)) & 0x01);
+      (u8Temp == 0x01) ? (IIC_SdaOutput_H()) : (IIC_SdaOutput_L());
+     #endif	
+     delay_us(2);	
+     IIC_SclOutput_H();//时钟保持高电平
+     delay_us(2);
+     IIC_SclOutput_L();//时钟拉低,才允许SDA变化
+     delay_us(2);
+   }
+}
+/********************************************************************
+  * 函数名:IIC_ReadByte
+  * 功  能:读一字节
+  * 参  数:无
+  * 返回值:读出的数据
+  * 说  明:无
+   ******************************************************************/
+uint8_t IIC_ReadByte(void)
+{
+   uint8_t i;
+   uint8_t bit = 0;
+   uint8_t data = 0;
+   IIC_SdaModeIn();//输入状态
+   for (i = 0; i < 8; i++)
+    {
+     IIC_SclOutput_L();
+     delay_us(2);
+     IIC_SclOutput_H();
+     bit = IIC_SdaRead();//读出1位
+     #ifdef IIC_LSB//低位在前
+      data |= (bit << i);		
+     #else//高位在前
+      data = (data << 1) | bit;
+     #endif
+     delay_us(2);
+    }
+   printf("IIC_ReadByte %02x\n",data);
+   return data;
+}

+ 31 - 0
vendor/bossay/Digital_tube/SOURCE_Digital_tube/iic_my.h

@@ -0,0 +1,31 @@
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "cmsis_os2.h"
+#include "tm1637.h"
+#include "iot_errno.h"
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#define IIC_SdaModeOut()  IoTGpioSetDir(IIC_SDA,IOT_GPIO_DIR_OUT)	
+#define IIC_SdaModeIn()	  IoTGpioSetDir(IIC_SDA,IOT_GPIO_DIR_IN)
+#define IIC_SdaOutput_H() IoTGpioSetOutputVal(IIC_SDA,1)
+#define IIC_SdaOutput_L() IoTGpioSetOutputVal(IIC_SDA,0)
+#define IIC_SclModeOut()  IoTGpioSetDir(IIC_CLK,IOT_GPIO_DIR_OUT)	
+#define IIC_SclModeIn()	  IoTGpioSetDir(IIC_CLK,IOT_GPIO_DIR_IN)	
+#define IIC_SclOutput_H() IoTGpioSetOutputVal(IIC_CLK,1)
+#define IIC_SclOutput_L()  IoTGpioSetOutputVal(IIC_CLK,0)
+#define uint8_t unsigned char
+#define delay_us(v) osDelay(1);
+/*
+说明:标准IIC协议传输数据时为MSB方式,即高位在前低位在后,但有些器件为LSB方式,即低位在前,高位在后,如TM1637数码管驱动芯片。
+*/
+#define IIC_LSB//定义了则IIC在数据传输时低位在前
+void IIC_SetPort(int sda,int clk);
+int IIC_SdaRead(void);
+void IIC_Start(void);
+void IIC_Stop(void);
+void IIC_Ack(void);
+void IIC_NoAck(void);
+uint8_t IIC_WaitAck(void);
+void IIC_WriteByte(uint8_t u8Data);
+uint8_t IIC_ReadByte(void);

+ 45 - 0
vendor/bossay/Digital_tube/SOURCE_Digital_tube/main_entry.c

@@ -0,0 +1,45 @@
+#include <stdio.h>
+#include "ohos_init.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "cmsis_os2.h"
+#include "tm1637.h"
+#include "iot_errno.h"
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+int led_state = 1;
+static TM1637Tube_ts sDisplayData;
+#define OUT_GPIO13    13
+#define OUT_GPIO2    2
+void tm1637(void* args )
+{
+  //设置选择器
+  IoTGpioInit(OUT_GPIO13);
+  IoTGpioSetFunc(OUT_GPIO13, IOT_GPIO_FUNC_GPIO_13_GPIO);
+  IoTGpioSetDir(OUT_GPIO13, IOT_GPIO_DIR_OUT); //设置GPIO_0为输出模式
+  IoTGpioInit(OUT_GPIO2);
+  IoTGpioSetFunc(OUT_GPIO2, IOT_GPIO_FUNC_GPIO_2_GPIO);
+  IoTGpioSetDir(OUT_GPIO2, IOT_GPIO_DIR_OUT); // 设置为输出模式
+  IoTGpioSetOutputVal(OUT_GPIO2, 0);
+  IoTGpioSetOutputVal(OUT_GPIO13, 1);
+  printf("button thread running...\n");
+  TM1637_Init(0,1); 
+  TM1637_Switch(1);//开显示
+  TM1637_SetBrightness(0x87);//设置亮度,开显示
+  TM1637_WriteCmd(0x44);//写数据到寄存器,固定地址模式
+  int i = 0;
+  while(1)
+  {
+   //IIC_Stop();
+   sDisplayData.tube0 = i / 1000;
+   sDisplayData.tube1 = i % 1000 / 100;
+   sDisplayData.tube2 = i % 100 / 10;
+   sDisplayData.tube3 = i % 10 ;
+   //memset(&sDisplayData, 0x8, sizeof(sDisplayData));
+   TM1637_TubeDisplay(sDisplayData);
+   usleep(1000*1000);
+   i++;
+  }
+}
+APP_FEATURE_INIT(tm1637);

+ 100 - 0
vendor/bossay/Digital_tube/SOURCE_Digital_tube/tm1637.c

@@ -0,0 +1,100 @@
+/***************************************************************
+  * 文件:TM1637.c
+  * 版本:v1.0
+  * 日期:2021-11-2
+  * 说明:TM1637驱动
+****************************************************************/
+#include "tm1637.h"
+//段码表
+const uint8_t u8NumTab[] = 
+{
+   //0,	1,	2,	3,	4, 5,	6,   7,  8,  9,   A,  b,  C,   d,   E,   F,  
+0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E
+,0x79,0x71,
+  //0., 1.,	2.,	3.,	 4.,  5.,   6.,  7.,  8.,  9. Null
+  0xBF,0x86,0xDB,0xCF,0xE6,0xED,0xFD,0x87,0xFF,0xEF,0x00
+};
+//最左至最右数码管 ,依次为0-3号,对应的显示寄存器地址
+const uint8_t u8TubeAddrTab[] = 
+{ 
+   0xC0,0xC1,0xC2,0xC3
+  };
+void TM1637_Init(int sda,int clk)
+{
+   IIC_SetPort(sda,clk);
+   IoTGpioInit(sda);
+   IoTGpioSetFunc(sda,0);
+   IoTGpioInit(clk);
+   IoTGpioSetFunc(clk,0);
+}
+/**************************************************************
+  * 函数名:TM1637_WriteCmd
+  * 功  能:写命令
+  * 参  数:无
+  * 返回值:无
+  * 说  明:无
+*************************************************************/
+void TM1637_WriteCmd(uint8_t u8Cmd)
+{
+   IIC_Start();
+   IIC_WriteByte(u8Cmd);
+   IIC_Ack();
+   IIC_Stop();
+}
+/**************************************************************
+  * 函数名:TM1637_WriteData
+  * 功  能:向地址中写入数据
+  * 参  数:u8Addr地址,u8Data数据
+  * 返回值:无
+  * 说  明:用于数码管固定地址写入显示数据
+**************************************************************/
+void TM1637_WriteData(uint8_t u8Addr, uint8_t u8Data)
+{
+   IIC_Start();
+   IIC_WriteByte(u8Addr);
+   IIC_Ack();
+   IIC_WriteByte(u8Data);
+   IIC_Ack();
+   IIC_Stop();
+}
+/*************************************************************
+  * 函数名:TM1637_TubeDisplay
+  * 功  能:4个数码管显示
+  * 参  数:sData显示数据结构体
+  * 返回值:无
+  * 说  明:无
+**************************************************************/
+void TM1637_TubeDisplay(TM1637Tube_ts sData)
+{
+   uint8_t temp[4], i;
+   temp[0] = u8NumTab[sData.tube0];
+   temp[1] = u8NumTab[sData.tube1];
+   temp[2] = u8NumTab[sData.tube2];
+   temp[3] = u8NumTab[sData.tube3];
+   for (i = 0; i < 4; i++)
+   {
+    TM1637_WriteData(u8TubeAddrTab[i], temp[i]);
+   }
+}
+/*************************************************************
+  * 函数名:TM1637_SetBrightness
+  * 功  能:设置亮度
+  * 参  数:u8Brt亮度
+  * 返回值:无
+  * 说  明:0x88为开显示
+************************************************************/
+void  TM1637_SetBrightness(uint8_t u8Brt)
+{
+   TM1637_WriteCmd(0x88 | u8Brt);
+  }
+/************************************************************
+  * 函数名:TM1637_Switch
+  * 功  能:显示开关
+  * 参  数:0关,1开
+  * 返回值:无
+  * 说  明:0x88为开显示,0x80关显示
+***********************************************************/
+void  TM1637_Switch(int bState)
+{
+   bState ? TM1637_WriteCmd(0x88) : TM1637_WriteCmd(0x80);
+}

+ 30 - 0
vendor/bossay/Digital_tube/SOURCE_Digital_tube/tm1637.h

@@ -0,0 +1,30 @@
+/*******************************************************************  * 文件:TM1637.h
+  * 版本:v1.0
+  * 日期:2021-11-2
+  * 说明:TM1637驱动
+********************************************************************/
+#ifndef _TM1637_H_
+#define _TM1637_H_
+#define TUBE_DISPLAY_NULL  26  //不显示
+#define TUBE_DISPLAY_DECIMAL_PIONT_OFFSET  16  //带小数点的偏移量
+#include "iic_my.h"
+/******************************************************************
+Typedefine
+******************************************************************/
+typedef struct 
+{
+   uint8_t tube0;
+   uint8_t tube1;
+   uint8_t tube2;
+   uint8_t tube3;
+}TM1637Tube_ts;
+/******************************************************************
+Global Functions
+******************************************************************/
+void TM1637_Init(int sda,int clk);
+void TM1637_WriteCmd(uint8_t u8Cmd);
+void TM1637_WriteData(uint8_t u8Addr, uint8_t u8Data);
+void TM1637_TubeDisplay(TM1637Tube_ts sData);
+void  TM1637_SetBrightness(uint8_t u8Brt);
+void  TM1637_Switch(int bState);
+#endif

+ 95 - 0
vendor/bossay/Digital_tube/config.json

@@ -0,0 +1,95 @@
+{
+    "product_name": "Digital_tube",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 20 - 0
vendor/bossay/Digital_tube/hals/utils/sys_param/BUILD.gn

@@ -0,0 +1,20 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_sysparam") {
+  sources = [ "hal_sys_param.c" ]
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+}

+ 200 - 0
vendor/bossay/Digital_tube/hals/utils/sys_param/hal_sys_param.c

@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_sys_param.h"
+#include <securec.h>
+
+static const char OHOS_PRODUCT_TYPE[] = {"****"};
+static const char OHOS_MANUFACTURE[] = {"****"};
+static const char OHOS_BRAND[] = {"****"};
+static const char OHOS_MARKET_NAME[] = {"****"};
+static const char OHOS_PRODUCT_SERIES[] = {"****"};
+static const char OHOS_PRODUCT_MODEL[] = {"****"};
+static const char OHOS_SOFTWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_PROFILE[] = {"aout:true,display:true"};
+static const char OHOS_BOOTLOADER_VERSION[] = {"bootloader"};
+static const char OHOS_SECURITY_PATCH_TAG[] = {"2023-03-31"};
+static const char OHOS_ABI_LIST[] = {"****"};
+static const char OHOS_SERIAL[] = {"1234567890"};  // provided by OEM.
+
+char* HalGetProductType(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_TYPE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_TYPE) + 1, OHOS_PRODUCT_TYPE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetManufacture(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MANUFACTURE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MANUFACTURE) + 1, OHOS_MANUFACTURE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBrand(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BRAND) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BRAND) + 1, OHOS_BRAND) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetMarketName(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MARKET_NAME) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MARKET_NAME) + 1, OHOS_MARKET_NAME) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductSeries(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_SERIES) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_SERIES) + 1, OHOS_PRODUCT_SERIES) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_MODEL) + 1, OHOS_PRODUCT_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSoftwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SOFTWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SOFTWARE_MODEL) + 1, OHOS_SOFTWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_MODEL) + 1, OHOS_HARDWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareProfile(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_PROFILE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_PROFILE) + 1, OHOS_HARDWARE_PROFILE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSerial(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SERIAL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SERIAL) + 1, OHOS_SERIAL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBootloaderVersion(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BOOTLOADER_VERSION) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BOOTLOADER_VERSION) + 1, OHOS_BOOTLOADER_VERSION) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSecurityPatchTag(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SECURITY_PATCH_TAG) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SECURITY_PATCH_TAG) + 1, OHOS_SECURITY_PATCH_TAG) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetAbiList(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_ABI_LIST) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_ABI_LIST) + 1, OHOS_ABI_LIST) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}

+ 22 - 0
vendor/bossay/Digital_tube/hals/utils/token/BUILD.gn

@@ -0,0 +1,22 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_token_static") {
+  sources = [ "hal_token.c" ]
+
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+  deps = []
+}

+ 104 - 0
vendor/bossay/Digital_tube/hals/utils/token/hal_token.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_token.h"
+#include "ohos_errno.h"
+#include "ohos_types.h"
+
+static int OEMReadToken(char *token, unsigned int len)
+{
+    // OEM need add here, read token from device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMWriteToken(const char *token, unsigned int len)
+{
+    // OEM need add here, write token to device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetAcKey(char *acKey, unsigned int len)
+{
+    // OEM need add here, get AcKey
+    (void)(acKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdId(char *productId, unsigned int len)
+{
+    // OEM need add here, get ProdId
+    (void)(productId);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdKey(char *productKey, unsigned int len)
+{
+    // OEM need add here, get ProdKey
+    (void)(productKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+
+int HalReadToken(char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMReadToken(token, len);
+}
+
+int HalWriteToken(const char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMWriteToken(token, len);
+}
+
+int HalGetAcKey(char *acKey, unsigned int len)
+{
+    if (acKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetAcKey(acKey, len);
+}
+
+int HalGetProdId(char *productId, unsigned int len)
+{
+    if (productId == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdId(productId, len);
+}
+
+int HalGetProdKey(char *productKey, unsigned int len)
+{
+    if (productKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdKey(productKey, len);
+}

+ 8 - 0
vendor/bossay/EMATRIX/BUILD.gn

@@ -0,0 +1,8 @@
+group("EMATRIX") {
+     deps = [
+           "SOURCE_EMATRIX:ematrix",
+           "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+           "../common/iot_wifi:iot_wifi",
+          ]
+}
+

+ 10 - 0
vendor/bossay/EMATRIX/SOURCE_EMATRIX/BUILD.gn

@@ -0,0 +1,10 @@
+static_library("ematrix")  
+ {
+    sources = [ "main_entry.c",  ]
+    include_dirs = [
+                 "//utils/native/lite/include", 
+                 "//base/iot_hardware/peripheral/interfaces/kits",
+                 "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+                 "//device/bossay/hi3861_l0/sdk_liteos/include"
+               ]
+ }

+ 129 - 0
vendor/bossay/EMATRIX/SOURCE_EMATRIX/main_entry.c

@@ -0,0 +1,129 @@
+#include <stdio.h>
+#include "time.h"
+#include "los_swtmr.h"
+#include "los_sys.h"
+#include "ohos_init.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "iot_i2c.h"
+#include "cmsis_os2.h"
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#define IIC_SDA  0
+#define IIC_SCL  1 
+#define ADDR 0x27  // 0100111
+#define IIC_IDX 1
+
+/*
+Command Register
+0 Input port 0
+1 Input port 1
+2 Output port 0
+3 Output port 1
+4 Polarity Inversion port 0
+5 Polarity Inversion port 1
+6 Configuration port 0
+7 Configuration port 1
+*/
+#define CMD_CFG0 6
+#define CMD_CFG1 7
+#define CMD_OUT0 2
+#define CMD_OUT1 3
+
+UINT32 g_timerCount1 = 0;
+UINT32 g_timerCount2 = 0;
+
+int write_iic(uint8_t* data){
+    int ret = IoTI2cWrite(IIC_IDX, (ADDR << 1) | 0x00, data, 3);
+    //printf("***@@@###$$$ ret = %d\n",ret);
+
+    return ret;
+}
+
+//start 
+uint8_t CFG0[] = {CMD_CFG0,0x0,0x0}; //配置为输出
+uint8_t CFG1[] = {CMD_CFG1,0x0,0x0}; //配置为输出
+uint8_t OUT0[] = {CMD_OUT0,0x00,0x00}; // 输出
+uint8_t OUT1[] = {CMD_OUT1,0x00,0x00}; // 输出
+
+char alpha[8][9] = {
+    "11111111",
+    "11100000",
+    "11100000",
+    "11111111",
+    "11111111",
+    "11100000",
+    "11100000",
+    "11111111"
+};
+
+void write_data(char byte1,char byte2){
+    uint8_t data[3] = {CMD_OUT0,0x00,0x00};
+    data[1] = byte1;
+    data[2] = byte2;
+    write_iic(data);
+
+    data[0] = CMD_OUT1;
+    write_iic(data);
+
+}
+
+void iic(void* args )
+{
+    int i,j;
+    UINT16 id1;     // Timer1 id
+    UINT16 id2;     // Timer2 id
+    UINT32 tick;
+    printf("iic thread running...\n");
+    IoTGpioInit(IIC_SDA);
+    IoTGpioInit(IIC_SCL);
+    IoTGpioSetFunc(IIC_SDA, IOT_GPIO_FUNC_GPIO_0_I2C1_SDA);
+    IoTGpioSetFunc(IIC_SCL, IOT_GPIO_FUNC_GPIO_1_I2C1_SCL);
+    IoTI2cInit(IIC_IDX, 400000);     
+    write_iic(CFG0);
+    write_iic(CFG1);    
+    usleep(20);
+    write_iic(OUT0);
+    write_iic(OUT1);
+    //usleep(1000*1000);
+    usleep(100);
+while(1)
+{
+               
+        for(int i=0;i<8;i++){
+            unsigned char hex = 0;
+            for(int j=0;j<8;j++){
+                hex = hex <<1; 
+                if(alpha[i][j] == '1'){
+                     hex =  hex  | 0x1;
+                }
+            }
+            write_data(~(1 << i),hex);
+            for(int a=0;a<3;a++){printf("delay:%d\r\n",a);}        
+        }
+        // printf("set count :%d\r\n",a=a+1); 
+    }
+
+}
+
+void iic_entry()
+{
+    printf("iic_entry called \n");
+    osThreadAttr_t attr;
+    attr.name = "thread_iic";
+    attr.attr_bits = 0U; // 如果为1 ,则可以使用osThreadJoin函数
+    attr.cb_mem = NULL; //控制快的指针
+    attr.cb_size = 0U;
+    attr.stack_mem = NULL; //栈内存指针
+    attr.stack_size = 1024 * 4; //栈大小
+    attr.priority = 25; //优先级
+    if (osThreadNew((osThreadFunc_t)iic, NULL, &attr) == NULL)
+    {
+        printf("Fail to create thread!\n");
+    }
+}
+
+APP_FEATURE_INIT(iic_entry);

+ 95 - 0
vendor/bossay/EMATRIX/config.json

@@ -0,0 +1,95 @@
+{
+    "product_name": "EMATRIX",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 20 - 0
vendor/bossay/EMATRIX/hals/utils/sys_param/BUILD.gn

@@ -0,0 +1,20 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_sysparam") {
+  sources = [ "hal_sys_param.c" ]
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+}

+ 200 - 0
vendor/bossay/EMATRIX/hals/utils/sys_param/hal_sys_param.c

@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_sys_param.h"
+#include <securec.h>
+
+static const char OHOS_PRODUCT_TYPE[] = {"****"};
+static const char OHOS_MANUFACTURE[] = {"****"};
+static const char OHOS_BRAND[] = {"****"};
+static const char OHOS_MARKET_NAME[] = {"****"};
+static const char OHOS_PRODUCT_SERIES[] = {"****"};
+static const char OHOS_PRODUCT_MODEL[] = {"****"};
+static const char OHOS_SOFTWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_PROFILE[] = {"aout:true,display:true"};
+static const char OHOS_BOOTLOADER_VERSION[] = {"bootloader"};
+static const char OHOS_SECURITY_PATCH_TAG[] = {"2023-03-31"};
+static const char OHOS_ABI_LIST[] = {"****"};
+static const char OHOS_SERIAL[] = {"1234567890"};  // provided by OEM.
+
+char* HalGetProductType(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_TYPE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_TYPE) + 1, OHOS_PRODUCT_TYPE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetManufacture(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MANUFACTURE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MANUFACTURE) + 1, OHOS_MANUFACTURE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBrand(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BRAND) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BRAND) + 1, OHOS_BRAND) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetMarketName(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MARKET_NAME) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MARKET_NAME) + 1, OHOS_MARKET_NAME) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductSeries(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_SERIES) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_SERIES) + 1, OHOS_PRODUCT_SERIES) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_MODEL) + 1, OHOS_PRODUCT_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSoftwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SOFTWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SOFTWARE_MODEL) + 1, OHOS_SOFTWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_MODEL) + 1, OHOS_HARDWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareProfile(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_PROFILE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_PROFILE) + 1, OHOS_HARDWARE_PROFILE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSerial(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SERIAL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SERIAL) + 1, OHOS_SERIAL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBootloaderVersion(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BOOTLOADER_VERSION) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BOOTLOADER_VERSION) + 1, OHOS_BOOTLOADER_VERSION) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSecurityPatchTag(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SECURITY_PATCH_TAG) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SECURITY_PATCH_TAG) + 1, OHOS_SECURITY_PATCH_TAG) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetAbiList(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_ABI_LIST) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_ABI_LIST) + 1, OHOS_ABI_LIST) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}

+ 22 - 0
vendor/bossay/EMATRIX/hals/utils/token/BUILD.gn

@@ -0,0 +1,22 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_token_static") {
+  sources = [ "hal_token.c" ]
+
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+  deps = []
+}

+ 104 - 0
vendor/bossay/EMATRIX/hals/utils/token/hal_token.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_token.h"
+#include "ohos_errno.h"
+#include "ohos_types.h"
+
+static int OEMReadToken(char *token, unsigned int len)
+{
+    // OEM need add here, read token from device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMWriteToken(const char *token, unsigned int len)
+{
+    // OEM need add here, write token to device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetAcKey(char *acKey, unsigned int len)
+{
+    // OEM need add here, get AcKey
+    (void)(acKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdId(char *productId, unsigned int len)
+{
+    // OEM need add here, get ProdId
+    (void)(productId);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdKey(char *productKey, unsigned int len)
+{
+    // OEM need add here, get ProdKey
+    (void)(productKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+
+int HalReadToken(char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMReadToken(token, len);
+}
+
+int HalWriteToken(const char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMWriteToken(token, len);
+}
+
+int HalGetAcKey(char *acKey, unsigned int len)
+{
+    if (acKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetAcKey(acKey, len);
+}
+
+int HalGetProdId(char *productId, unsigned int len)
+{
+    if (productId == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdId(productId, len);
+}
+
+int HalGetProdKey(char *productKey, unsigned int len)
+{
+    if (productKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdKey(productKey, len);
+}

+ 8 - 0
vendor/bossay/Electronic_scale/BUILD.gn

@@ -0,0 +1,8 @@
+group("Electronic_scale")
+ {
+    deps = [
+           "SOURCE_Electronic_scale:scale",
+           "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+           "../common/iot_wifi:iot_wifi",
+          ]
+ } 

+ 10 - 0
vendor/bossay/Electronic_scale/SOURCE_Electronic_scale/BUILD.gn

@@ -0,0 +1,10 @@
+static_library("scale")  
+ {
+    sources = [ "main_entry.c",  ]
+    include_dirs = [
+                 "//utils/native/lite/include", 
+                 "//base/iot_hardware/peripheral/interfaces/kits",
+                 "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+                 "//device/bossay/hi3861_l0/sdk_liteos/include"
+               ]
+ }

+ 132 - 0
vendor/bossay/Electronic_scale/SOURCE_Electronic_scale/main_entry.c

@@ -0,0 +1,132 @@
+#include <stdio.h>
+#include "time.h"
+#include "los_swtmr.h"
+#include "los_sys.h"
+#include "ohos_init.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "iot_i2c.h"
+#include "cmsis_os2.h"
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#include<type.h>
+
+#define IIC_SDA  0
+#define IIC_SCL  1 
+#define ADDR 0x27  // 0100111
+#define IIC_IDX 1
+
+/*
+Command Register
+0 Input port 0
+1 Input port 1
+2 Output port 0
+3 Output port 1
+4 Polarity Inversion port 0
+5 Polarity Inversion port 1
+6 Configuration port 0
+7 Configuration port 1
+*/
+#define CMD_CFG0 6
+#define CMD_CFG1 7
+#define CMD_OUT0 2
+#define CMD_OUT1 3
+
+UINT32 g_timerCount1 = 0;
+UINT32 g_timerCount2 = 0;
+
+int write_iic(uint8_t* data){
+    int ret = IoTI2cWrite(IIC_IDX, (ADDR << 1) | 0x00, data, 3);
+    //printf("***@@@###$$$ ret = %d\n",ret);
+
+    return ret;
+}
+
+//start 
+uint8_t CFG0[] = {CMD_CFG0,0x0,0x0}; //配置为输出
+uint8_t CFG1[] = {CMD_CFG1,0x0,0x0}; //配置为输出
+uint8_t OUT0[] = {CMD_OUT0,0x00,0x00}; // 输出
+uint8_t OUT1[] = {CMD_OUT1,0x00,0x00}; // 输出
+
+char alpha[8][9] = {
+    "11111111",
+    "11100000",
+    "11100000",
+    "11111111",
+    "11111111",
+    "11100000",
+    "11100000",
+    "11111111"
+};
+
+void write_data(char byte1,char byte2){
+    uint8_t data[3] = {CMD_OUT0,0x00,0x00};
+    data[1] = byte1;
+    data[2] = byte2;
+    write_iic(data);
+
+    data[0] = CMD_OUT1;
+    write_iic(data);
+
+}
+
+void iic(void* args )
+{
+    int i,j;
+    UINT16 id1;     // Timer1 id
+    UINT16 id2;     // Timer2 id
+    UINT32 tick;
+    printf("iic thread running...\n");
+    IoTGpioInit(IIC_SDA);
+    IoTGpioInit(IIC_SCL);
+    IoTGpioSetFunc(IIC_SDA, IOT_GPIO_FUNC_GPIO_0_I2C1_SDA);
+    IoTGpioSetFunc(IIC_SCL, IOT_GPIO_FUNC_GPIO_1_I2C1_SCL);
+    IoTI2cInit(IIC_IDX, 400000);     
+    write_iic(CFG0);
+    write_iic(CFG1);    
+    usleep(20);
+    write_iic(OUT0);
+    write_iic(OUT1);
+    //usleep(1000*1000);
+    usleep(100);
+while(1)
+{
+               
+        for(int i=0;i<8;i++){
+            unsigned char hex = 0;
+            for(int j=0;j<8;j++){
+                hex = hex <<1; 
+                if(alpha[i][j] == '1'){
+                     hex =  hex  | 0x1;
+                }
+            }
+            write_data(~(1 << i),hex);
+            for(int a=0;a<3;a++){printf("delay:%d\r\n",a);}
+                      
+        }
+        printf("set count :%d\r\n",a=a+1); 
+    }
+
+}
+
+void iic_entry()
+{
+    printf("iic_entry called \n");
+    osThreadAttr_t attr;
+    attr.name = "thread_iic";
+    attr.attr_bits = 0U; // 如果为1 ,则可以使用osThreadJoin函数
+    attr.cb_mem = NULL; //控制快的指针
+    attr.cb_size = 0U;
+    attr.stack_mem = NULL; //栈内存指针
+    attr.stack_size = 1024 * 4; //栈大小
+    attr.priority = 25; //优先级
+    if (osThreadNew((osThreadFunc_t)iic, NULL, &attr) == NULL)
+    {
+        printf("Fail to create thread!\n");
+    }
+}
+
+APP_FEATURE_INIT(iic_entry);

+ 95 - 0
vendor/bossay/Electronic_scale/config.json

@@ -0,0 +1,95 @@
+{
+    "product_name": "Electronic_scale",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 20 - 0
vendor/bossay/Electronic_scale/hals/utils/sys_param/BUILD.gn

@@ -0,0 +1,20 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_sysparam") {
+  sources = [ "hal_sys_param.c" ]
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+}

+ 200 - 0
vendor/bossay/Electronic_scale/hals/utils/sys_param/hal_sys_param.c

@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_sys_param.h"
+#include <securec.h>
+
+static const char OHOS_PRODUCT_TYPE[] = {"****"};
+static const char OHOS_MANUFACTURE[] = {"****"};
+static const char OHOS_BRAND[] = {"****"};
+static const char OHOS_MARKET_NAME[] = {"****"};
+static const char OHOS_PRODUCT_SERIES[] = {"****"};
+static const char OHOS_PRODUCT_MODEL[] = {"****"};
+static const char OHOS_SOFTWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_PROFILE[] = {"aout:true,display:true"};
+static const char OHOS_BOOTLOADER_VERSION[] = {"bootloader"};
+static const char OHOS_SECURITY_PATCH_TAG[] = {"2023-03-31"};
+static const char OHOS_ABI_LIST[] = {"****"};
+static const char OHOS_SERIAL[] = {"1234567890"};  // provided by OEM.
+
+char* HalGetProductType(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_TYPE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_TYPE) + 1, OHOS_PRODUCT_TYPE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetManufacture(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MANUFACTURE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MANUFACTURE) + 1, OHOS_MANUFACTURE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBrand(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BRAND) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BRAND) + 1, OHOS_BRAND) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetMarketName(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MARKET_NAME) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MARKET_NAME) + 1, OHOS_MARKET_NAME) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductSeries(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_SERIES) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_SERIES) + 1, OHOS_PRODUCT_SERIES) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_MODEL) + 1, OHOS_PRODUCT_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSoftwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SOFTWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SOFTWARE_MODEL) + 1, OHOS_SOFTWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_MODEL) + 1, OHOS_HARDWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareProfile(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_PROFILE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_PROFILE) + 1, OHOS_HARDWARE_PROFILE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSerial(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SERIAL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SERIAL) + 1, OHOS_SERIAL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBootloaderVersion(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BOOTLOADER_VERSION) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BOOTLOADER_VERSION) + 1, OHOS_BOOTLOADER_VERSION) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSecurityPatchTag(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SECURITY_PATCH_TAG) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SECURITY_PATCH_TAG) + 1, OHOS_SECURITY_PATCH_TAG) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetAbiList(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_ABI_LIST) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_ABI_LIST) + 1, OHOS_ABI_LIST) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}

+ 22 - 0
vendor/bossay/Electronic_scale/hals/utils/token/BUILD.gn

@@ -0,0 +1,22 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_token_static") {
+  sources = [ "hal_token.c" ]
+
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+  deps = []
+}

+ 104 - 0
vendor/bossay/Electronic_scale/hals/utils/token/hal_token.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_token.h"
+#include "ohos_errno.h"
+#include "ohos_types.h"
+
+static int OEMReadToken(char *token, unsigned int len)
+{
+    // OEM need add here, read token from device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMWriteToken(const char *token, unsigned int len)
+{
+    // OEM need add here, write token to device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetAcKey(char *acKey, unsigned int len)
+{
+    // OEM need add here, get AcKey
+    (void)(acKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdId(char *productId, unsigned int len)
+{
+    // OEM need add here, get ProdId
+    (void)(productId);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdKey(char *productKey, unsigned int len)
+{
+    // OEM need add here, get ProdKey
+    (void)(productKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+
+int HalReadToken(char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMReadToken(token, len);
+}
+
+int HalWriteToken(const char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMWriteToken(token, len);
+}
+
+int HalGetAcKey(char *acKey, unsigned int len)
+{
+    if (acKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetAcKey(acKey, len);
+}
+
+int HalGetProdId(char *productId, unsigned int len)
+{
+    if (productId == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdId(productId, len);
+}
+
+int HalGetProdKey(char *productKey, unsigned int len)
+{
+    if (productKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdKey(productKey, len);
+}

+ 10 - 0
vendor/bossay/Five-pointed star/BUILD.gn

@@ -0,0 +1,10 @@
+
+
+group("MARQUEE") {
+    deps = [
+        "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+        "../common/iot_wifi:iot_wifi",
+        "SOURCE_MARQUEE:MARQUEE",
+        
+    ]
+}

+ 8 - 0
vendor/bossay/Five-pointed star/SOURCE_Five-pointed star/BUILD.gn

@@ -0,0 +1,8 @@
+static_library("MARQUEE")
+{
+    sources =["MARQUEE.c",]
+include_dirs =[
+"//base/iot_hardware/peripheral/interfaces/kits",
+"../../common/inc",
+]
+}

+ 17 - 0
vendor/bossay/Five-pointed star/SOURCE_Five-pointed star/main_entry.c

@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include "ohos_init.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+
+// 请使用五角星扩展板
+#define LED 9
+void led_entry(){
+    printf("led_entry called \n");
+
+    IoTGpioInit(LED);
+    IoTGpioSetDir(LED,IOT_GPIO_DIR_OUT);
+    IoTGpioSetFunc(LED,IOT_GPIO_FUNC_GPIO_7_GPIO);
+    IoTGpioSetOutputVal(LED,1);
+}
+
+APP_FEATURE_INIT(led_entry);

+ 96 - 0
vendor/bossay/Five-pointed star/config.json

@@ -0,0 +1,96 @@
+{
+    "product_name": "Five-pointed star",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }
+  

+ 20 - 0
vendor/bossay/Five-pointed star/hals/utils/sys_param/BUILD.gn

@@ -0,0 +1,20 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_sysparam") {
+  sources = [ "hal_sys_param.c" ]
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+}

+ 200 - 0
vendor/bossay/Five-pointed star/hals/utils/sys_param/hal_sys_param.c

@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_sys_param.h"
+#include <securec.h>
+
+static const char OHOS_PRODUCT_TYPE[] = {"****"};
+static const char OHOS_MANUFACTURE[] = {"****"};
+static const char OHOS_BRAND[] = {"****"};
+static const char OHOS_MARKET_NAME[] = {"****"};
+static const char OHOS_PRODUCT_SERIES[] = {"****"};
+static const char OHOS_PRODUCT_MODEL[] = {"****"};
+static const char OHOS_SOFTWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_MODEL[] = {"****"};
+static const char OHOS_HARDWARE_PROFILE[] = {"aout:true,display:true"};
+static const char OHOS_BOOTLOADER_VERSION[] = {"bootloader"};
+static const char OHOS_SECURITY_PATCH_TAG[] = {"2023-03-30"};
+static const char OHOS_ABI_LIST[] = {"****"};
+static const char OHOS_SERIAL[] = {"1234567890"};  // provided by OEM.
+
+char* HalGetProductType(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_TYPE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_TYPE) + 1, OHOS_PRODUCT_TYPE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetManufacture(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MANUFACTURE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MANUFACTURE) + 1, OHOS_MANUFACTURE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBrand(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BRAND) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BRAND) + 1, OHOS_BRAND) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetMarketName(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_MARKET_NAME) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_MARKET_NAME) + 1, OHOS_MARKET_NAME) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductSeries(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_SERIES) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_SERIES) + 1, OHOS_PRODUCT_SERIES) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetProductModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_PRODUCT_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_PRODUCT_MODEL) + 1, OHOS_PRODUCT_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSoftwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SOFTWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SOFTWARE_MODEL) + 1, OHOS_SOFTWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareModel(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_MODEL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_MODEL) + 1, OHOS_HARDWARE_MODEL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetHardwareProfile(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_HARDWARE_PROFILE) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_HARDWARE_PROFILE) + 1, OHOS_HARDWARE_PROFILE) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSerial(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SERIAL) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SERIAL) + 1, OHOS_SERIAL) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetBootloaderVersion(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_BOOTLOADER_VERSION) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_BOOTLOADER_VERSION) + 1, OHOS_BOOTLOADER_VERSION) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetSecurityPatchTag(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_SECURITY_PATCH_TAG) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_SECURITY_PATCH_TAG) + 1, OHOS_SECURITY_PATCH_TAG) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}
+
+char* HalGetAbiList(void)
+{
+    char* value = (char*)malloc(strlen(OHOS_ABI_LIST) + 1);
+    if (value == NULL) {
+        return NULL;
+    }
+    if (strcpy_s(value, strlen(OHOS_ABI_LIST) + 1, OHOS_ABI_LIST) != 0) {
+        free(value);
+        return NULL;
+    }
+    return value;
+}

+ 22 - 0
vendor/bossay/Five-pointed star/hals/utils/token/BUILD.gn

@@ -0,0 +1,22 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# 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.
+
+static_library("hal_token_static") {
+  sources = [ "hal_token.c" ]
+
+  include_dirs = [
+    "//base/startup/syspara_lite/hals",
+    "//utils/native/lite/include",
+  ]
+  deps = []
+}

+ 104 - 0
vendor/bossay/Five-pointed star/hals/utils/token/hal_token.c

@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * 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.
+ */
+
+#include "hal_token.h"
+#include "ohos_errno.h"
+#include "ohos_types.h"
+
+static int OEMReadToken(char *token, unsigned int len)
+{
+    // OEM need add here, read token from device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMWriteToken(const char *token, unsigned int len)
+{
+    // OEM need add here, write token to device
+    (void)(token);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetAcKey(char *acKey, unsigned int len)
+{
+    // OEM need add here, get AcKey
+    (void)(acKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdId(char *productId, unsigned int len)
+{
+    // OEM need add here, get ProdId
+    (void)(productId);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+static int OEMGetProdKey(char *productKey, unsigned int len)
+{
+    // OEM need add here, get ProdKey
+    (void)(productKey);
+    (void)(len);
+    return EC_SUCCESS;
+}
+
+
+int HalReadToken(char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMReadToken(token, len);
+}
+
+int HalWriteToken(const char *token, unsigned int len)
+{
+    if (token == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMWriteToken(token, len);
+}
+
+int HalGetAcKey(char *acKey, unsigned int len)
+{
+    if (acKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetAcKey(acKey, len);
+}
+
+int HalGetProdId(char *productId, unsigned int len)
+{
+    if (productId == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdId(productId, len);
+}
+
+int HalGetProdKey(char *productKey, unsigned int len)
+{
+    if (productKey == NULL) {
+        return EC_FAILURE;
+    }
+
+    return OEMGetProdKey(productKey, len);
+}

+ 8 - 0
vendor/bossay/Helloworld/BUILD.gn

@@ -0,0 +1,8 @@
+group("Helloworld") {
+    deps = [
+        
+        "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+        "demo_helloworld:bossay_hi3861_l0_Helloworld",
+        
+    ]
+}

+ 104 - 0
vendor/bossay/Helloworld/config.json

@@ -0,0 +1,104 @@
+{
+    "product_name": "Helloworld",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      },
+      {
+       "subsystem": "test",
+       "components": [
+         { "component": "xts_acts", "features":[] },
+         { "component": "xts_tools", "features":[] }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 14 - 0
vendor/bossay/Helloworld/demo_helloworld/BUILD.gn

@@ -0,0 +1,14 @@
+static_library("bossay_hi3861_l0_Helloworld") {
+    sources = [
+        "Helloworld.c",
+    ]
+
+    include_dirs = [
+        "../../common/inc",   
+    ]
+
+    deps = [    
+         "../../common/iot_wifi:iot_wifi",
+    ]
+    
+}

+ 8 - 0
vendor/bossay/Helloworld/demo_helloworld/Helloworld.c

@@ -0,0 +1,8 @@
+#include <stdio.h> 
+#include "ohos_init.h" 
+void Hello_World(void) 
+{ 
+    printf("Hello World!\r\n");
+     
+} 
+APP_FEATURE_INIT(Hello_World);

+ 4 - 0
vendor/bossay/LED/BUILD.gn

@@ -0,0 +1,4 @@
+group("LED") {
+    deps = ["demo_LED:bossay_hi3861_l0_LED",
+            "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk"]
+}

+ 95 - 0
vendor/bossay/LED/config.json

@@ -0,0 +1,95 @@
+{
+  "product_name": "LED",
+  "ohos_version": "OpenHarmony 1.0",
+  "device_company": "bossay",
+  "board": "hi3861_l0",
+  "kernel_type": "liteos_m",
+  "kernel_version": "",
+  "subsystems": [
+    {
+      "subsystem": "applications",
+      "components": [
+        { "component": "wifi_iot_sample_app", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "iot_hardware",
+      "components": [
+        { "component": "iot_controller", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "hiviewdfx",
+      "components": [
+        { "component": "hilog_lite", "features":[] },
+        { "component": "hievent_lite", "features":[] },
+        { "component": "blackbox", "features":[] },
+        { "component": "hidumper_mini", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "distributed_schedule",
+      "components": [
+        { "component": "samgr_lite", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "security",
+      "components": [
+        { "component": "hichainsdk", "features":[] },
+        { "component": "deviceauth_lite", "features":[] },
+        { "component": "huks", "features":
+          [
+            "disable_huks_binary = false",
+            "disable_authenticate = false",
+            "huks_use_lite_storage = true",
+            "huks_use_hardware_root_key = true",
+            "huks_config_file = \"hks_config_lite.h\"",
+            "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+          ]
+        }
+      ]
+    },
+    {
+      "subsystem": "startup",
+      "components": [
+        { "component": "bootstrap_lite", "features":[] },
+        { "component": "syspara_lite", "features":
+          [
+            "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+          ]
+        }
+      ]
+    },
+    {
+      "subsystem": "communication",
+      "components": [
+        { "component": "wifi_lite", "features":[] },
+        { "component": "softbus_lite", "features":[] },
+        { "component": "wifi_aware", "features":[]}
+      ]
+    },
+    {
+      "subsystem": "update",
+      "components": [
+        { "component": "ota_lite", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "iot",
+      "components": [
+        { "component": "iot_link", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "utils",
+      "components": [
+        { "component": "file", "features":[] },
+        { "component": "kv_store", "features":[] },
+        { "component": "os_dump", "features":[] }
+      ]
+    }
+  ],
+  "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+  "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+}

+ 17 - 0
vendor/bossay/LED/demo_LED/BUILD.gn

@@ -0,0 +1,17 @@
+static_library("bossay_hi3861_l0_LED") {
+    sources = [
+        "LED.c",        
+    ]
+    
+    
+    include_dirs = [
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "../../../common/inc"
+    ]
+
+    deps = [
+        "../../common/iot_wifi:iot_wifi",
+    ]
+
+}

+ 19 - 0
vendor/bossay/LED/demo_LED/LED.c

@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include "ohos_init.h"
+#include "iot_gpio_ex.h"
+#include "iot_gpio.h"
+
+#define OUT_GPIO7 7
+#define OUT_GPIO11 11
+
+static void LED(void)
+{
+    IoTGpioInit(OUT_GPIO7);
+    //初始化LED灯
+    IoTGpioSetFunc(OUT_GPIO7,IOT_GPIO_FUNC_GPIO_7_GPIO);
+    IoTGpioSetDir(OUT_GPIO7,IOT_GPIO_DIR_OUT);
+    IoTGpioSetOutputVal(OUT_GPIO7, 1);
+
+}
+
+APP_FEATURE_INIT(LED);

+ 4 - 0
vendor/bossay/LEDPWM/BUILD.gn

@@ -0,0 +1,4 @@
+group("LEDPWM") {
+    deps = ["demo_LEDPWM:bossay_hi3861_l0_LEDPWM",
+            "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk"]
+}

+ 95 - 0
vendor/bossay/LEDPWM/config.json

@@ -0,0 +1,95 @@
+{
+  "product_name": "LEDPWM",
+  "ohos_version": "OpenHarmony 1.0",
+  "device_company": "bossay",
+  "board": "hi3861_l0",
+  "kernel_type": "liteos_m",
+  "kernel_version": "",
+  "subsystems": [
+    {
+      "subsystem": "applications",
+      "components": [
+        { "component": "wifi_iot_sample_app", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "iot_hardware",
+      "components": [
+        { "component": "iot_controller", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "hiviewdfx",
+      "components": [
+        { "component": "hilog_lite", "features":[] },
+        { "component": "hievent_lite", "features":[] },
+        { "component": "blackbox", "features":[] },
+        { "component": "hidumper_mini", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "distributed_schedule",
+      "components": [
+        { "component": "samgr_lite", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "security",
+      "components": [
+        { "component": "hichainsdk", "features":[] },
+        { "component": "deviceauth_lite", "features":[] },
+        { "component": "huks", "features":
+          [
+            "disable_huks_binary = false",
+            "disable_authenticate = false",
+            "huks_use_lite_storage = true",
+            "huks_use_hardware_root_key = true",
+            "huks_config_file = \"hks_config_lite.h\"",
+            "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+          ]
+        }
+      ]
+    },
+    {
+      "subsystem": "startup",
+      "components": [
+        { "component": "bootstrap_lite", "features":[] },
+        { "component": "syspara_lite", "features":
+          [
+            "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+          ]
+        }
+      ]
+    },
+    {
+      "subsystem": "communication",
+      "components": [
+        { "component": "wifi_lite", "features":[] },
+        { "component": "softbus_lite", "features":[] },
+        { "component": "wifi_aware", "features":[]}
+      ]
+    },
+    {
+      "subsystem": "update",
+      "components": [
+        { "component": "ota_lite", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "iot",
+      "components": [
+        { "component": "iot_link", "features":[] }
+      ]
+    },
+    {
+      "subsystem": "utils",
+      "components": [
+        { "component": "file", "features":[] },
+        { "component": "kv_store", "features":[] },
+        { "component": "os_dump", "features":[] }
+      ]
+    }
+  ],
+  "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+  "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+}

+ 18 - 0
vendor/bossay/LEDPWM/demo_LEDPWM/BUILD.gn

@@ -0,0 +1,18 @@
+static_library("bossay_hi3861_l0_LEDPWM") {
+    sources = [
+        "LEDPWM.c",        
+    ]
+    
+    
+    include_dirs = [
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "../../../common/inc"
+    ]
+
+    deps = [
+        "../../common/iot_wifi:iot_wifi",
+        
+    ]
+
+}

+ 119 - 0
vendor/bossay/LEDPWM/demo_LEDPWM/LEDPWM.c

@@ -0,0 +1,119 @@
+#include <stdio.h>
+#include "ohos_init.h"
+#include "iot_errno.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "iot_i2c.h"
+#include <math.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+
+
+#include "ohos_init.h"
+#include <stdlib.h>
+
+#include <cmsis_os2.h>
+#include <stdbool.h>
+
+
+#define WIFI_IOT_IO_FUNC_GPIO_0_I2C1_SDA 6
+#define WIFI_IOT_IO_FUNC_GPIO_1_I2C1_SCL 6
+#define WIFI_IOT_I2C_IDX_1 1
+
+#define BH1750_ADDR 0x23
+
+int BoardInit(void);
+int E53SC1ReadData(float *data);
+
+static void GpioInit(void)
+{
+    printf("GPIO init...\r\n");
+    IoTGpioInit(0);
+    IoTGpioSetFunc(0, WIFI_IOT_IO_FUNC_GPIO_0_I2C1_SDA); // GPIO_0复用为I2C1_SDA
+    IoTGpioInit(1);
+    IoTGpioSetFunc(1, WIFI_IOT_IO_FUNC_GPIO_1_I2C1_SCL); // GPIO_1复用为I2C1_SCL
+    IoTI2cInit(WIFI_IOT_I2C_IDX_1, 400000);              /* baudrate: 400kbps */
+    printf("GPIO init...OK\r\n");
+}
+
+static int InitBH1750(void)
+{
+    int ret;
+    uint8_t send_data[1] = {0x01};
+    ret = IoTI2cWrite(WIFI_IOT_I2C_IDX_1, (BH1750_ADDR << 1) | 0x00, send_data, 1);
+    if (ret != 0) {
+        printf("===== Error: I2C write ret = 0x%x! =====\r\n", ret);
+        return -1;
+    }
+    return 0;
+}
+
+static int StartBH1750(void)
+{
+    int ret;
+    uint8_t send_data[1] = {0x10};
+    ret = IoTI2cWrite(WIFI_IOT_I2C_IDX_1, (BH1750_ADDR << 1) | 0x00, send_data, 1);
+    if (ret != 0) {
+        printf("===== Error: I2C write ret = 0x%x! =====\r\n", ret);
+        return -1;
+    }
+    return 0;
+}
+
+int BoardInit(void)
+{
+    int ret;
+    GpioInit();
+    ret = InitBH1750();
+    // if (ret != 0) {
+    //     return -1;
+    // }
+    return 0;
+}
+
+int BH1750ReadData(float* data)
+{
+    int ret;
+    int result;
+    ret = StartBH1750(); // 启动传感器采集数据
+    if (ret != 0) {
+        printf("Start BH1750 failed!\r\n");
+        return -1;
+    }
+    usleep(180000);
+    uint8_t recv_data[2] = {0};
+    ret = IoTI2cRead(WIFI_IOT_I2C_IDX_1, (BH1750_ADDR << 1) | 0x01, recv_data, 2); // 读取传感器数据
+    if (ret != 0) {
+        return -1;
+    }
+    printf("recevie data is :%x,%x\r\n",recv_data[0],recv_data[1]);
+    *data = (float)(((recv_data[0] << 8) + recv_data[1]) / 1.2); //合成数据,即光照数据
+    return 0;
+}
+
+static void LEDPWM(void)
+{
+    int ret;
+    int temp;
+    float Lux;
+
+    ret = BoardInit();
+    if (ret != 0) {
+        printf("Board Init failed!\r\n");
+        return;
+    }
+
+    osDelay(300);
+    temp = BH1750ReadData(&Lux);
+    if (temp != 0) {
+            printf("Read Data failed!\r\n");
+            return;
+    }
+    printf("Lux data:%.2f\r\n", Lux);
+
+}
+
+APP_FEATURE_INIT(LEDPWM);
+
+

+ 82 - 0
vendor/bossay/NFC_Demo/A08_NFC/A08_NFC_example.c

@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2020  Jinan Bosai Network Technology Co., LTD
+ * 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.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "pn532_hi3861.h"
+#include "cmsis_os2.h"
+#include "ohos_init.h"
+
+#define TASK_STACK_SIZE 1024 * 8
+#define TASK_PRIO 25
+
+static void ExampleTask(void)
+{
+    uint8_t buff[255];
+    uint8_t uid[MIFARE_UID_MAX_LENGTH];
+    int32_t uid_len = 0;
+
+    while (1)
+    {
+            /* USER CODE BEGIN 2 */
+    printf("Hello!\r\n");
+    PN532 pn532;
+    // PN532_SPI_Init(&pn532);
+    PN532_I2C_Init(&pn532);
+    PN532_GetFirmwareVersion(&pn532, buff);
+    if (PN532_GetFirmwareVersion(&pn532, buff) == PN532_STATUS_OK) {
+        printf("Found PN532 with firmware version: %d.%d\r\n", buff[1], buff[2]);
+    } else {
+        return -1;
+    }
+    // PN532_SamConfiguration(&pn532);
+    // printf("Waiting for RFID/NFC card...\r\n");
+    //     /* USER CODE END WHILE */
+
+    //     /* USER CODE BEGIN 3 */
+    //     // Check if a card is available to read
+    //     uid_len = PN532_ReadPassiveTarget(&pn532, uid, PN532_MIFARE_ISO14443A, 1000);
+    //     if (uid_len == PN532_STATUS_ERROR) {
+    //     printf(".");
+    //     } else {
+    //     printf("Found card with UID: ");
+    //     for (uint8_t i = 0; i < uid_len; i++) {
+    //         printf("%02x ", uid[i]);
+    //     }
+    //     printf("\r\n");
+    //     }
+    }
+}
+
+static void ExampleEntry(void)
+{
+    osThreadAttr_t attr;
+
+    attr.name = "ExampleTask";
+    attr.attr_bits = 0U;
+    attr.cb_mem = NULL;
+    attr.cb_size = 0U;
+    attr.stack_mem = NULL;
+    attr.stack_size = TASK_STACK_SIZE;
+    attr.priority = TASK_PRIO;
+
+    if (osThreadNew((osThreadFunc_t)ExampleTask, NULL, &attr) == NULL) {
+        printf("Failed to create ExampleTask!\n");
+    }
+}
+
+APP_FEATURE_INIT(ExampleEntry);

+ 26 - 0
vendor/bossay/NFC_Demo/A08_NFC/BUILD.gn

@@ -0,0 +1,26 @@
+# Copyright (c) 2020  Jinan Bosai Network Technology Co., LTD
+# 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.
+
+static_library("A08_NFC") {
+    sources = [
+        "src/pn532_hi3861.c",
+        "src/pn532.c",
+        "A08_NFC_example.c"
+    ]
+
+    include_dirs = [
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "include"
+    ]
+}

+ 81 - 0
vendor/bossay/NFC_Demo/A08_NFC/include/MPU6050.h

@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2020  Jinan Bosai Network Technology Co., LTD
+ * 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.
+ */
+
+#ifndef __MPU6050_H__
+#define __MPU6050_H__
+
+
+/* 宏定义 --------------------------------------------------------------------*/
+#define MPU6050_GYRO_OUT            0x43  //MPU6050陀螺仪数据寄存器地址
+#define MPU6050_ACC_OUT             0x3B  //MPU6050加速度数据寄存器地址
+#define MPU6050_SLAVE_ADDRESS       0x68  //MPU6050器件读地址
+#define MPU6050_ADDRESS_AD0_LOW     0x68 // address pin low (GND), default for InvenSense evaluation board
+#define MPU6050_RA_CONFIG           0x1A
+#define MPU6050_RA_ACCEL_CONFIG     0x1C
+#define MPU6050_RA_FF_THR           0x1D
+#define MPU6050_RA_FF_DUR           0x1E
+#define MPU6050_RA_MOT_THR          0x1F  //运动检测阀值设置寄存器
+#define MPU6050_RA_MOT_DUR          0x20  //运动检测时间阀值
+#define MPU6050_RA_ZRMOT_THR        0x21
+#define MPU6050_RA_ZRMOT_DUR        0x22
+#define MPU6050_RA_FIFO_EN          0x23
+#define MPU6050_RA_INT_PIN_CFG      0x37   //中断/旁路设置寄存器
+#define MPU6050_RA_INT_ENABLE       0x38   //中断使能寄存器
+#define MPU6050_RA_TEMP_OUT_H       0x41
+#define MPU6050_RA_USER_CTRL        0x6A
+#define MPU6050_RA_PWR_MGMT_1       0x6B
+#define MPU6050_RA_WHO_AM_I         0x75
+#define SENSOR_DATA_WIDTH_8_BIT     8 // 8 bit
+#define ACCEL_DATA_LEN              6
+#define TEMP_DATA_LEN               2
+
+typedef enum
+{
+	OFF = 0,
+	ON
+} SwitchStatus;
+
+enum AccelAxisNum {
+    ACCEL_X_AXIS = 0,
+    ACCEL_Y_AXIS = 1,
+    ACCEL_Z_AXIS = 2,
+    ACCEL_AXIS_NUM = 3,
+};
+enum AccelAxisPart {
+    ACCEL_X_AXIS_LSB = 0,
+    ACCEL_X_AXIS_MSB = 1,
+    ACCEL_Y_AXIS_LSB = 2,
+    ACCEL_Y_AXIS_MSB = 3,
+    ACCEL_Z_AXIS_LSB = 4,
+    ACCEL_Z_AXIS_MSB = 5,
+    ACCEL_AXIS_BUTT,
+};
+enum TempPart {
+    TEMP_LSB = 0,
+    TEMP_MSB = 1,
+};
+/* MPU6050传感器数据类型定义 ------------------------------------------------------------*/
+typedef struct
+{
+    short   Temperature;     
+    short   Accel[3];
+} MPU6050Data;
+
+int BoardInit(void);
+int MPU6050ReadData(MPU6050Data *ReadData);
+void LedD1StatusSet(SwitchStatus status);
+void LedD2StatusSet(SwitchStatus status);
+
+#endif 

+ 277 - 0
vendor/bossay/NFC_Demo/A08_NFC/include/pn532.h

@@ -0,0 +1,277 @@
+/**************************************************************************
+ *  @file     pn532.h
+ *  @author   Yehui from Waveshare
+ *  @license  BSD
+ *  
+ *  Header file for pn532.c
+ *  
+ *  Check out the links above for our tutorials and wiring diagrams 
+ *  These chips use SPI communicate.
+ *  
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ **************************************************************************/
+
+#ifndef PN532_H
+#define PN532_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PN532_PREAMBLE                      (0x00)
+#define PN532_STARTCODE1                    (0x00)
+#define PN532_STARTCODE2                    (0xFF)
+#define PN532_POSTAMBLE                     (0x00)
+
+#define PN532_HOSTTOPN532                   (0xD4)
+#define PN532_PN532TOHOST                   (0xD5)
+
+// PN532 Commands
+#define PN532_COMMAND_DIAGNOSE              (0x00)
+#define PN532_COMMAND_GETFIRMWAREVERSION    (0x02)
+#define PN532_COMMAND_GETGENERALSTATUS      (0x04)
+#define PN532_COMMAND_READREGISTER          (0x06)
+#define PN532_COMMAND_WRITEREGISTER         (0x08)
+#define PN532_COMMAND_READGPIO              (0x0C)
+#define PN532_COMMAND_WRITEGPIO             (0x0E)
+#define PN532_COMMAND_SETSERIALBAUDRATE     (0x10)
+#define PN532_COMMAND_SETPARAMETERS         (0x12)
+#define PN532_COMMAND_SAMCONFIGURATION      (0x14)
+#define PN532_COMMAND_POWERDOWN             (0x16)
+#define PN532_COMMAND_RFCONFIGURATION       (0x32)
+#define PN532_COMMAND_RFREGULATIONTEST      (0x58)
+#define PN532_COMMAND_INJUMPFORDEP          (0x56)
+#define PN532_COMMAND_INJUMPFORPSL          (0x46)
+#define PN532_COMMAND_INLISTPASSIVETARGET   (0x4A)
+#define PN532_COMMAND_INATR                 (0x50)
+#define PN532_COMMAND_INPSL                 (0x4E)
+#define PN532_COMMAND_INDATAEXCHANGE        (0x40)
+#define PN532_COMMAND_INCOMMUNICATETHRU     (0x42)
+#define PN532_COMMAND_INDESELECT            (0x44)
+#define PN532_COMMAND_INRELEASE             (0x52)
+#define PN532_COMMAND_INSELECT              (0x54)
+#define PN532_COMMAND_INAUTOPOLL            (0x60)
+#define PN532_COMMAND_TGINITASTARGET        (0x8C)
+#define PN532_COMMAND_TGSETGENERALBYTES     (0x92)
+#define PN532_COMMAND_TGGETDATA             (0x86)
+#define PN532_COMMAND_TGSETDATA             (0x8E)
+#define PN532_COMMAND_TGSETMETADATA         (0x94)
+#define PN532_COMMAND_TGGETINITIATORCOMMAND (0x88)
+#define PN532_COMMAND_TGRESPONSETOINITIATOR (0x90)
+#define PN532_COMMAND_TGGETTARGETSTATUS     (0x8A)
+
+#define PN532_RESPONSE_INDATAEXCHANGE       (0x41)
+#define PN532_RESPONSE_INLISTPASSIVETARGET  (0x4B)
+
+#define PN532_WAKEUP                        (0x55)
+
+#define PN532_SPI_STATREAD                  (0x02)
+#define PN532_SPI_DATAWRITE                 (0x01)
+#define PN532_SPI_DATAREAD                  (0x03)
+#define PN532_SPI_READY                     (0x01)
+
+#define PN532_I2C_ADDRESS                   (0x48 >> 1)
+#define PN532_I2C_READBIT                   (0x01)
+#define PN532_I2C_BUSY                      (0x00)
+#define PN532_I2C_READY                     (0x01)
+#define PN532_I2C_READYTIMEOUT              (20)
+
+#define PN532_MIFARE_ISO14443A              (0x00)
+
+// Mifare Commands
+#define MIFARE_CMD_AUTH_A                   (0x60)
+#define MIFARE_CMD_AUTH_B                   (0x61)
+#define MIFARE_CMD_READ                     (0x30)
+#define MIFARE_CMD_WRITE                    (0xA0)
+#define MIFARE_CMD_TRANSFER                 (0xB0)
+#define MIFARE_CMD_DECREMENT                (0xC0)
+#define MIFARE_CMD_INCREMENT                (0xC1)
+#define MIFARE_CMD_STORE                    (0xC2)
+#define MIFARE_ULTRALIGHT_CMD_WRITE         (0xA2)
+
+#define MIFARE_UID_MAX_LENGTH               MIFARE_UID_TRIPLE_LENGTH
+#define MIFARE_UID_SINGLE_LENGTH            (4)
+#define MIFARE_UID_DOUBLE_LENGTH            (7)
+#define MIFARE_UID_TRIPLE_LENGTH            (10)
+#define MIFARE_KEY_LENGTH                   (6)
+#define MIFARE_BLOCK_LENGTH                 (16)
+
+// NTAG2xx Commands
+#define NTAG2XX_BLOCK_LENGTH                (4)
+
+// Prefixes for NDEF Records (to identify record type)
+#define NDEF_URIPREFIX_NONE                 (0x00)
+#define NDEF_URIPREFIX_HTTP_WWWDOT          (0x01)
+#define NDEF_URIPREFIX_HTTPS_WWWDOT         (0x02)
+#define NDEF_URIPREFIX_HTTP                 (0x03)
+#define NDEF_URIPREFIX_HTTPS                (0x04)
+#define NDEF_URIPREFIX_TEL                  (0x05)
+#define NDEF_URIPREFIX_MAILTO               (0x06)
+#define NDEF_URIPREFIX_FTP_ANONAT           (0x07)
+#define NDEF_URIPREFIX_FTP_FTPDOT           (0x08)
+#define NDEF_URIPREFIX_FTPS                 (0x09)
+#define NDEF_URIPREFIX_SFTP                 (0x0A)
+#define NDEF_URIPREFIX_SMB                  (0x0B)
+#define NDEF_URIPREFIX_NFS                  (0x0C)
+#define NDEF_URIPREFIX_FTP                  (0x0D)
+#define NDEF_URIPREFIX_DAV                  (0x0E)
+#define NDEF_URIPREFIX_NEWS                 (0x0F)
+#define NDEF_URIPREFIX_TELNET               (0x10)
+#define NDEF_URIPREFIX_IMAP                 (0x11)
+#define NDEF_URIPREFIX_RTSP                 (0x12)
+#define NDEF_URIPREFIX_URN                  (0x13)
+#define NDEF_URIPREFIX_POP                  (0x14)
+#define NDEF_URIPREFIX_SIP                  (0x15)
+#define NDEF_URIPREFIX_SIPS                 (0x16)
+#define NDEF_URIPREFIX_TFTP                 (0x17)
+#define NDEF_URIPREFIX_BTSPP                (0x18)
+#define NDEF_URIPREFIX_BTL2CAP              (0x19)
+#define NDEF_URIPREFIX_BTGOEP               (0x1A)
+#define NDEF_URIPREFIX_TCPOBEX              (0x1B)
+#define NDEF_URIPREFIX_IRDAOBEX             (0x1C)
+#define NDEF_URIPREFIX_FILE                 (0x1D)
+#define NDEF_URIPREFIX_URN_EPC_ID           (0x1E)
+#define NDEF_URIPREFIX_URN_EPC_TAG          (0x1F)
+#define NDEF_URIPREFIX_URN_EPC_PAT          (0x20)
+#define NDEF_URIPREFIX_URN_EPC_RAW          (0x21)
+#define NDEF_URIPREFIX_URN_EPC              (0x22)
+#define NDEF_URIPREFIX_URN_NFC              (0x23)
+
+#define PN532_GPIO_VALIDATIONBIT            (0x80)
+
+/* Official PN532 Errors Definitions */
+#define PN532_ERROR_NONE                                                (0x00)
+// Time Out, the target has not answered
+#define PN532_ERROR_TIMEOUT                                             (0x01)
+// A CRC error has been detected by the CIU
+#define PN532_ERROR_CRC                                                 (0x02)
+// A Parity error has been detected by the CIU
+#define PN532_ERROR_PARITY                                              (0x03)
+// During an anti-collision/select operation (ISO/IEC14443-3 Type A and
+// ISO/IEC18092 106 kbps passive mode), an erroneous Bit Count has been
+// detected
+#define PN532_ERROR_COLLISION_BITCOUNT                                  (0x04)
+// Framing error during MIFARE operation
+#define PN532_ERROR_MIFARE_FRAMING                                      (0x05)
+// An abnormal bit-collision has been detected during bit wise
+// anti-collision at 106 kbps
+#define PN532_ERROR_COLLISION_BITCOLLISION                              (0x06)
+// Communication buffer size insufficien
+#define PN532_ERROR_NOBUFS                                              (0x07)
+// RF Buffer overflow has been detected by the CI
+#define PN532_ERROR_RFNOBUFS                                            (0x09)
+// In active communication mode, the RF field has not been switched on
+// in time by the counterpart (as defined in NFCIP-1 standard
+#define PN532_ERROR_ACTIVE_TOOSLOW                                      (0x0a)
+// RF Protocol error
+#define PN532_ERROR_RFPROTO                                             (0x0b)
+// Temperature error: the internal temperature sensor has detected
+// overheating, and therefore has automatically switched off the
+// antenna drivers
+#define PN532_ERROR_TOOHOT                                              (0x0d)
+// Internal buffer overflow
+#define PN532_ERROR_INTERNAL_NOBUFS                                     (0x0e)
+// Invalid parameter (range, format...)
+#define PN532_ERROR_INVAL                                               (0x10)
+// DEP Protocol: The PN533 configured in target mode does not support
+// the command received from the initiator (the command received is not
+// one of the following: ATR_REQ, WUP_REQ, PSL_REQ, DEP_REQ, DSL_REQ,
+// RLS_REQ)
+#define PN532_ERROR_DEP_INVALID_COMMAND                                 (0x12)
+// DEP Protocol, MIFARE or ISO/IEC14443-4: The data format does not
+// match to the specification.  Depending on the RF protocol used, it
+// can be: Bad length of RF received frame, Incorrect value of PCB or
+// PFB, Invalid or unexpected RF received frame, NAD or DID incoherence.
+#define PN532_ERROR_DEP_BADDATA                                         (0x13)
+// MIFARE: Authentication error
+#define PN532_ERROR_MIFARE_AUTH                                         (0x14)
+// Target or Initiator does not support NFC Secur
+#define PN532_ERROR_NOSECURE                                            (0x18)
+// I2C bus line is Busy. A TDA transaction is on going
+#define PN532_ERROR_I2CBUSY                                             (0x19)
+// ISO/IEC14443-3: UID Check byte is wrong
+#define PN532_ERROR_UIDCHECKSUM                                         (0x23)
+// DEP Protocol: Invalid device state, the system is in a state which
+// does not allow the operation
+#define PN532_ERROR_DEPSTATE                                            (0x25)
+// Operation not allowed in this configuration (host controller
+// interface)
+#define PN532_ERROR_HCIINVAL                                            (0x26)
+// This command is not acceptable due to the current context of the
+// PN533 (Initiator vs. Target, unknown target number, Target not in the
+// good state, ...)
+#define PN532_ERROR_CONTEXT                                             (0x27)
+// The PN533 configured as target has been released by its initiator
+#define PN532_ERROR_RELEASED                                            (0x29)
+// PN533 and ISO/IEC14443-3B only: the ID of the card does not match,
+// meaning that the expected card has been exchanged with another one.
+#define PN532_ERROR_CARDSWAPPED                                         (0x2a)
+// PN533 and ISO/IEC14443-3B only: the card previously activated has
+// disappeared.
+#define PN532_ERROR_NOCARD                                              (0x2b)
+// Mismatch between the NFCID3 initiator and the NFCID3 target in DEP
+// 212/424 kbps passive.
+#define PN532_ERROR_MISMATCH                                            (0x2c)
+// An over-current event has been detected
+#define PN532_ERROR_OVERCURRENT                                         (0x2d)
+// NAD missing in DEP frame
+#define PN532_ERROR_NONAD                                               (0x2e)
+/* End: Official PN532 Errors Definitions */
+
+// Other Error Definitions
+#define PN532_STATUS_ERROR                                              (-1)
+#define PN532_STATUS_OK                                                 (0)
+
+typedef struct _PN532 {
+    int (*reset)(void);
+    int (*read_data)(uint8_t* data, uint16_t count);
+    int (*write_data)(uint8_t *data, uint16_t count);
+    bool (*wait_ready)(uint32_t timeout);
+    int (*wakeup)(void);
+    void (*log)(const char* log);
+} PN532;
+
+
+int PN532_WriteFrame(PN532* pn532, uint8_t* data, uint16_t length);
+int PN532_ReadFrame(PN532* pn532, uint8_t* buff, uint16_t length);
+int PN532_CallFunction(PN532* pn532, uint8_t command, uint8_t* response, uint16_t response_length, uint8_t* params, uint16_t params_length, uint32_t timeout);
+int PN532_GetFirmwareVersion(PN532* pn532, uint8_t* version);
+int PN532_SamConfiguration(PN532* pn532);
+int PN532_ReadPassiveTarget(PN532* pn532, uint8_t* response, uint8_t card_baud, uint32_t timeout);
+int PN532_MifareClassicAuthenticateBlock(PN532* pn532, uint8_t* uid, uint8_t uid_length, uint16_t block_number, uint16_t key_number, uint8_t* key);
+int PN532_MifareClassicReadBlock(PN532* pn532, uint8_t* response, uint16_t block_number);
+int PN532_MifareClassicWriteBlock(PN532* pn532, uint8_t* data, uint16_t block_number);
+int PN532_Ntag2xxReadBlock(PN532* pn532, uint8_t* response, uint16_t block_number);
+int PN532_Ntag2xxWriteBlock(PN532* pn532, uint8_t* data, uint16_t block_number);
+int PN532_ReadGpio(PN532* pn532, uint8_t* pins_state);
+bool PN532_ReadGpioP(PN532* pn532, uint8_t pin_number);
+bool PN532_ReadGpioI(PN532* pn532, uint8_t pin_number);
+int PN532_WriteGpio(PN532* pn532, uint8_t* pins_state);
+int PN532_WriteGpioP(PN532* pn532, uint8_t pin_number, bool pin_state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* PN532_H */
+
+/* End of file */

+ 48 - 0
vendor/bossay/NFC_Demo/A08_NFC/include/pn532_hi3861.h

@@ -0,0 +1,48 @@
+/**************************************************************************
+ *  @file     pn532_stm32f1.h
+ *  @author   Yehui from Waveshare
+ *  @license  BSD
+ *  
+ *  Header file for pn532_stm32f1.c
+ *  
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ **************************************************************************/
+
+#ifndef PN532_STM32F1
+#define PN532_STM32F1
+
+#include "pn532.h"
+
+void PN532_Init(PN532* dev);
+int PN532_Reset(void);
+void PN532_Log(const char* log);
+
+int PN532_SPI_ReadData(uint8_t* data, uint16_t count);
+int PN532_SPI_WriteData(uint8_t *data, uint16_t count);
+bool PN532_SPI_WaitReady(uint32_t timeout);
+int PN532_SPI_Wakeup(void);
+void PN532_SPI_Init(PN532* dev);
+
+int PN532_I2C_ReadData(uint8_t* data, uint16_t count);
+int PN532_I2C_WriteData(uint8_t *data, uint16_t count);
+bool PN532_I2C_WaitReady(uint32_t timeout);
+int PN532_I2C_Wakeup(void);
+void PN532_I2C_Init(PN532* dev);
+
+#endif  /* PN532_STM32F1 */

+ 381 - 0
vendor/bossay/NFC_Demo/A08_NFC/src/MPU6050.c

@@ -0,0 +1,381 @@
+/*
+ * Copyright (c) 2020  Jinan Bosai Network Technology Co., LTD
+ * 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.
+ */
+
+#include "MPU6050.h"
+#include "cmsis_os2.h"
+#include "iot_errno.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "iot_i2c.h"
+#include "iot_i2c_ex.h"
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#define WIFI_IOT_IO_FUNC_GPIO_0_I2C1_SDA 6
+#define WIFI_IOT_IO_FUNC_GPIO_1_I2C1_SCL 6
+#define WIFI_IOT_IO_FUNC_GPIO_8_GPIO 0
+#define WIFI_IOT_IO_FUNC_GPIO_7_GPIO 0
+#define WIFI_IOT_I2C_IDX_1 1
+#define WIFI_IOT_IO_NAME_GPIO_7 7
+#define WIFI_IOT_IO_NAME_GPIO_8 8
+#define WIFI_IOT_IO_NAME_GPIO_0 0
+#define WIFI_IOT_IO_NAME_GPIO_1 1
+#define RESET_DELAY_US 20000
+#define READ_DATA_DELAY_US 50000
+
+/***************************************************************
+ * 函数名称: GpioInit
+ * 说    明:  GPIO初始化
+ * 参    数: 无
+ * 返 回 值: 无
+ ***************************************************************/
+static void GpioInit(void)
+{
+    IoTGpioInit(WIFI_IOT_IO_NAME_GPIO_8);
+    IoTGpioSetFunc(WIFI_IOT_IO_NAME_GPIO_8, WIFI_IOT_IO_FUNC_GPIO_8_GPIO);
+    IoTGpioSetDir(WIFI_IOT_IO_NAME_GPIO_8, IOT_GPIO_DIR_OUT); // 设置GPIO_8为输出模式
+
+    IoTGpioInit(WIFI_IOT_IO_NAME_GPIO_7);
+    IoTGpioSetFunc(WIFI_IOT_IO_NAME_GPIO_7, WIFI_IOT_IO_FUNC_GPIO_7_GPIO);
+    IoTGpioSetDir(WIFI_IOT_IO_NAME_GPIO_7, IOT_GPIO_DIR_OUT); // 设置GPIO_7为输出模式
+
+    IoTGpioInit(WIFI_IOT_IO_NAME_GPIO_0);
+    IoTGpioSetFunc(WIFI_IOT_IO_NAME_GPIO_0, WIFI_IOT_IO_FUNC_GPIO_0_I2C1_SDA); // GPIO_0复用为I2C1_SDA
+    IoTGpioInit(WIFI_IOT_IO_NAME_GPIO_1);
+    IoTGpioSetFunc(WIFI_IOT_IO_NAME_GPIO_1, WIFI_IOT_IO_FUNC_GPIO_1_I2C1_SCL); // GPIO_1复用为I2C1_SCL
+    IoTI2cInit(WIFI_IOT_I2C_IDX_1, 400000);              /* baudrate: 400kbps */
+}
+/***************************************************************
+ * 函数功能: 通过I2C写入一个值到指定寄存器内
+ * 输入参数: Addr:I2C设备地址
+ *           Reg:目标寄存器
+ *           Value:值
+ * 返 回 值: 无
+ * 说    明: 无
+ **************************************************************/
+static int MPU6050WriteData(uint8_t Reg, uint8_t Value)
+{
+    uint32_t ret;
+    uint8_t send_data[2] = {Reg, Value};
+    ret = IoTI2cWrite(WIFI_IOT_I2C_IDX_1, (MPU6050_SLAVE_ADDRESS << 1) | 0x00, send_data, 2);
+    if (ret != 0) {
+        printf("===== Error: I2C write ret = 0x%x! =====\r\n", ret);
+        return -1;
+    }
+    return 0;
+}
+/***************************************************************
+ * 函数功能: 通过I2C写入一段数据到指定寄存器内
+ * 输入参数: Addr:I2C设备地址
+ *           Reg:目标寄存器
+ *           RegSize:寄存器尺寸(8位或者16位)
+ *           pBuffer:缓冲区指针
+ *           Length:缓冲区长度
+ * 返 回 值: HAL_StatusTypeDef:操作结果
+ * 说    明: 在循环调用是需加一定延时时间
+ **************************************************************/
+static int MPU6050WriteBuffer(uint8_t Reg, uint8_t* pBuffer, uint16_t Length)
+{
+    uint32_t ret = 0;
+    uint8_t send_data[256] = {0};
+
+    send_data[0] = Reg;
+    for (int j = 0; j < Length; j++) {
+        send_data[j + 1] = pBuffer[j];
+    }
+
+    ret = IoTI2cWrite(WIFI_IOT_I2C_IDX_1, (MPU6050_SLAVE_ADDRESS << 1) | 0x00, send_data, Length + 1);
+    if (ret != 0) {
+        printf("===== Error: I2C write ret = 0x%x! =====\r\n", ret);
+        return -1;
+    }
+    return 0;
+}
+
+/***************************************************************
+ * 函数功能: 通过I2C读取一段寄存器内容存放到指定的缓冲区内
+ * 输入参数: Addr:I2C设备地址
+ *           Reg:目标寄存器
+ *           RegSize:寄存器尺寸(8位或者16位)
+ *           pBuffer:缓冲区指针
+ *           Length:缓冲区长度
+ * 返 回 值: HAL_StatusTypeDef:操作结果
+ * 说    明: 无
+ **************************************************************/
+static int MPU6050ReadBuffer(uint8_t Reg, uint8_t* pBuffer, uint16_t Length)
+{
+    uint32_t ret = 0;
+    IotI2cData mpu6050_i2c_data = {0};
+    uint8_t buffer[1] = {Reg};
+    mpu6050_i2c_data.sendBuf = buffer;
+    mpu6050_i2c_data.sendLen = 1;
+    mpu6050_i2c_data.receiveBuf = pBuffer;
+    mpu6050_i2c_data.receiveLen = Length;
+    ret = IoTI2cWriteread(WIFI_IOT_I2C_IDX_1, (MPU6050_SLAVE_ADDRESS << 1) | 0x00, &mpu6050_i2c_data);
+    if (ret != 0) {
+        printf("===== Error: I2C writeread ret = 0x%x! =====\r\n", ret);
+        return -1;
+    }
+    return 0;
+}
+/***************************************************************
+ * 函数功能: 写数据到MPU6050寄存器
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ ***************************************************************/
+static void MPU6050WriteReg(uint8_t reg_add, uint8_t reg_dat)
+{
+    MPU6050WriteData(reg_add, reg_dat);
+}
+
+/***************************************************************
+ * 函数功能: 从MPU6050寄存器读取数据
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ ***************************************************************/
+static int MPU6050Read(uint8_t reg_add, unsigned char* read, uint8_t num)
+{
+    return MPU6050ReadBuffer(reg_add, read, num);
+}
+
+/***************************************************************
+ * 函数功能: 读取MPU6050的加速度数据
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ ***************************************************************/
+static int MPU6050ReadAcc(short* accData)
+{
+    int ret;
+    uint8_t buf[ACCEL_DATA_LEN];
+    ret = MPU6050Read(MPU6050_ACC_OUT, buf, ACCEL_DATA_LEN);
+    if (ret != 0) {
+        return -1;
+    }
+    accData[ACCEL_X_AXIS] = (buf[ACCEL_X_AXIS_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[ACCEL_X_AXIS_MSB];
+    accData[ACCEL_Y_AXIS] = (buf[ACCEL_Y_AXIS_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[ACCEL_Y_AXIS_MSB];
+    accData[ACCEL_Z_AXIS] = (buf[ACCEL_Z_AXIS_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[ACCEL_Z_AXIS_MSB];
+    return 0;
+}
+
+/***************************************************************
+ * 函数功能: 读取MPU6050的角速度数据
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ ***************************************************************/
+static int MPU6050ReadGyro(short* gyroData)
+{
+    int ret;
+    uint8_t buf[ACCEL_DATA_LEN];
+    ret = MPU6050Read(MPU6050_GYRO_OUT, buf, ACCEL_DATA_LEN);
+    if (ret != 0) {
+        return -1;
+    }
+    gyroData[ACCEL_X_AXIS] = (buf[ACCEL_X_AXIS_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[ACCEL_X_AXIS_MSB];
+    gyroData[ACCEL_Y_AXIS] = (buf[ACCEL_Y_AXIS_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[ACCEL_Y_AXIS_MSB];
+    gyroData[ACCEL_Z_AXIS] = (buf[ACCEL_Z_AXIS_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[ACCEL_Z_AXIS_MSB];
+    return 0;
+}
+
+/***************************************************************
+ * 函数功能: 读取MPU6050的原始温度数据
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ ***************************************************************/
+static int MPU6050ReadTemp(short* tempData)
+{
+    int ret;
+    uint8_t buf[TEMP_DATA_LEN];
+    ret = MPU6050Read(MPU6050_RA_TEMP_OUT_H, buf, TEMP_DATA_LEN); // 读取温度值
+    if (ret != 0) {
+        return -1;
+    }
+    *tempData = (buf[TEMP_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[TEMP_MSB];
+    return 0;
+}
+
+/***************************************************************
+ * 函数功能: 读取MPU6050的温度数据,转化成摄氏度
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ **************************************************************/
+static int MPU6050ReturnTemp(short* Temperature)
+{
+    int ret;
+    short temp3;
+    uint8_t buf[TEMP_DATA_LEN];
+
+    ret = MPU6050Read(MPU6050_RA_TEMP_OUT_H, buf, TEMP_DATA_LEN); // 读取温度值
+    if (ret != 0) {
+        return -1;
+    }
+    temp3 = (buf[TEMP_LSB] << SENSOR_DATA_WIDTH_8_BIT) | buf[TEMP_MSB];
+    *Temperature = (((double)(temp3 + 13200)) / 280) - 13;
+    return 0;
+}
+
+/***************************************************************
+ * 函数功能: 自由落体中断
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ **************************************************************/
+void FreeFallInterrupt(void) // 自由落体中断
+{
+    MPU6050WriteReg(MPU6050_RA_FF_THR, 0x01); // 自由落体阈值
+    MPU6050WriteReg(MPU6050_RA_FF_DUR, 0x01); // 自由落体检测时间20ms 单位1ms 寄存器0X20
+}
+void MotionInterrupt(void) // 运动中断
+{
+    MPU6050WriteReg(MPU6050_RA_MOT_THR, 0x03); // 运动阈值
+    MPU6050WriteReg(MPU6050_RA_MOT_DUR, 0x14); // 检测时间20ms 单位1ms 寄存器0X20
+}
+void ZeroMotionInterrupt(void) // 静止中断
+{
+    MPU6050WriteReg(MPU6050_RA_ZRMOT_THR, 0x20); // 静止阈值
+    MPU6050WriteReg(MPU6050_RA_ZRMOT_DUR, 0x20); // 静止检测时间20ms 单位1ms 寄存器0X20
+}
+
+/***************************************************************
+ * 函数功能: 初始化MPU6050芯片
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ ***************************************************************/
+void MPU6050Init(void)
+{
+    MPU6050WriteReg(MPU6050_RA_PWR_MGMT_1, 0X80); // 复位MPU6050
+    usleep(RESET_DELAY_US);
+    MPU6050WriteReg(MPU6050_RA_PWR_MGMT_1, 0X00); // 唤醒MPU6050
+    MPU6050WriteReg(MPU6050_RA_INT_ENABLE, 0X00); // 关闭所有中断
+    MPU6050WriteReg(MPU6050_RA_USER_CTRL, 0X00);  // I2C主模式关闭
+    MPU6050WriteReg(MPU6050_RA_FIFO_EN, 0X00);    // 关闭FIFO
+    MPU6050WriteReg(MPU6050_RA_INT_PIN_CFG,
+                    0X80); // 中断的逻辑电平模式,设置为0,中断信号为高电;设置为1,中断信号为低电平时。
+    MotionInterrupt();                              // 运动中断
+    MPU6050WriteReg(MPU6050_RA_CONFIG, 0x04);       // 配置外部引脚采样和DLPF数字低通滤波器
+    MPU6050WriteReg(MPU6050_RA_ACCEL_CONFIG, 0x1C); // 加速度传感器量程和高通滤波器配置
+    MPU6050WriteReg(MPU6050_RA_INT_PIN_CFG, 0X1C);  // INT引脚低电平平时
+    MPU6050WriteReg(MPU6050_RA_INT_ENABLE, 0x40);   // 中断使能寄存器
+}
+
+/***************************************************************
+ * 函数功能: 读取MPU6050的ID
+ * 输入参数: 无
+ * 返 回 值: 无
+ * 说    明: 无
+ ***************************************************************/
+int MPU6050ReadID(void)
+{
+    unsigned char Re = 0;
+    MPU6050Read(MPU6050_RA_WHO_AM_I, &Re, 1); // 读器件地址
+    if (Re != 0x68) {
+        printf("MPU6050 dectected error!\r\n");
+        return -1;
+    } else {
+        return 0;
+    }
+}
+/***************************************************************
+ * 函数名称: BoardInit
+ * 说    明: 初始化扩展板
+ * 参    数: 无
+ * 返 回 值: 无
+ ***************************************************************/
+int BoardInit(void)
+{
+    uint32_t ret = 0;
+    GpioInit();
+    MPU6050Init();
+    ret = MPU6050ReadID();
+    if (ret != 0) {
+        return -1;
+    }
+    osDelay(100);
+    return 0;
+}
+/***************************************************************
+ * 函数名称: MPU6050ReadData
+ * 说    明: 读取数据
+ * 参    数: 无
+ * 返 回 值: 无
+ ***************************************************************/
+int MPU6050ReadData(MPU6050Data* ReadData)
+{
+    int ret;
+    short Accel[3];
+    short Temp;
+    if (MPU6050ReadID() != 0) {
+        return -1;
+    }
+    ret = MPU6050ReadAcc(Accel);
+    if (ret != 0) {
+        return -1;
+    }
+
+    ret = MPU6050ReturnTemp(&Temp);
+    if (ret != 0) {
+        return -1;
+    }
+    ReadData->Temperature = Temp;
+    ReadData->Accel[ACCEL_X_AXIS] = Accel[ACCEL_X_AXIS];
+    ReadData->Accel[ACCEL_Y_AXIS] = Accel[ACCEL_Y_AXIS];
+    ReadData->Accel[ACCEL_Z_AXIS] = Accel[ACCEL_Z_AXIS];
+    usleep(READ_DATA_DELAY_US);
+    return 0;
+}
+/***************************************************************
+ * 函数名称: LedD1StatusSet
+ * 说    明: LED_D1状态设置
+ * 参    数: status,ENUM枚举的数据
+ *									OFF,关
+ *									ON,开
+ * 返 回 值: 无
+ ***************************************************************/
+void LedD1StatusSet(SwitchStatus status)
+{
+    if (status == ON) {
+        IoTGpioSetOutputVal(7, 1); // 设置GPIO_7输出高电平点亮灯
+    }
+    if (status == OFF) {
+        IoTGpioSetOutputVal(7, 0); // 设置GPIO_7输出低电平关闭灯
+    }
+}
+
+/***************************************************************
+ * 函数名称: LedD2StatusSet
+ * 说    明: LED_D2状态设置
+ * 参    数: status,ENUM枚举的数据
+ *									OFF,关
+ *									ON,开
+ * 返 回 值: 无
+ ***************************************************************/
+void LedD2StatusSet(SwitchStatus status)
+{
+    if (status == ON) {
+        IoTGpioSetOutputVal(8, 1); // 设置GPIO_8输出高电平点亮灯
+    }
+
+    if (status == OFF) {
+        IoTGpioSetOutputVal(8, 0); // 设置GPIO_8输出低电平关闭灯
+    }
+}

+ 498 - 0
vendor/bossay/NFC_Demo/A08_NFC/src/pn532.c

@@ -0,0 +1,498 @@
+/**************************************************************************
+ *  @file     pn532.c
+ *  @author   Yehui from Waveshare
+ *  @license  BSD
+ *  
+ *  This is a library for the Waveshare PN532 NFC modules
+ *  
+ *  Check out the links above for our tutorials and wiring diagrams 
+ *  These chips use SPI communicate.
+ *  
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ **************************************************************************/
+
+#include <stdio.h>
+#include "pn532.h"
+
+const uint8_t PN532_ACK[] = {0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00};
+const uint8_t PN532_FRAME_START[] = {0x00, 0x00, 0xFF};
+
+#define PN532_FRAME_MAX_LENGTH              255
+#define PN532_DEFAULT_TIMEOUT               1000
+
+/**
+  * @brief: Write a frame to the PN532 of at most length bytes in size.
+  *     Note that less than length bytes might be returned!
+  * @retval: Returns -1 if there is an error parsing the frame.  
+  */
+int PN532_WriteFrame(PN532* pn532, uint8_t* data, uint16_t length) {
+    if (length > PN532_FRAME_MAX_LENGTH || length < 1) {
+        return PN532_STATUS_ERROR; // Data must be array of 1 to 255 bytes.
+    }
+    // Build frame to send as:
+    // - Preamble (0x00)
+    // - Start code  (0x00, 0xFF)
+    // - Command length (1 byte)
+    // - Command length checksum
+    // - Command bytes
+    // - Checksum
+    // - Postamble (0x00)
+
+    uint8_t frame[PN532_FRAME_MAX_LENGTH + 7];
+    uint8_t checksum = 0;
+    frame[0] = PN532_PREAMBLE;
+    frame[1] = PN532_STARTCODE1;
+    frame[2] = PN532_STARTCODE2;
+    for (uint8_t i = 0; i < 3; i++) {
+        checksum += frame[i];
+    }
+    frame[3] = length & 0xFF;
+    frame[4] = (~length + 1) & 0xFF;
+    for (uint8_t i = 0; i < length; i++) {
+        frame[5 + i] = data[i];
+        checksum += data[i];
+    }
+    frame[length + 5] = ~checksum & 0xFF;
+    frame[length + 6] = PN532_POSTAMBLE;
+    if (pn532->write_data(frame, length + 7) != PN532_STATUS_OK) {
+        return PN532_STATUS_ERROR;
+    }
+    return PN532_STATUS_OK;
+}
+
+/**
+  * @brief: Read a response frame from the PN532 of at most length bytes in size.
+  *     Note that less than length bytes might be returned!
+  * @retval: Returns frame length or -1 if there is an error parsing the frame.  
+  */
+int PN532_ReadFrame(PN532* pn532, uint8_t* response, uint16_t length) {
+    uint8_t buff[PN532_FRAME_MAX_LENGTH + 7];
+    uint8_t checksum = 0;
+    // Read frame with expected length of data.
+    pn532->read_data(buff, length + 7);
+    // Swallow all the 0x00 values that preceed 0xFF.
+    uint8_t offset = 0;
+    while (buff[offset] == 0x00) {
+        offset += 1;
+        if (offset >= length + 8){
+            pn532->log("Response frame preamble does not contain 0x00FF!");
+            return PN532_STATUS_ERROR;
+        }
+    }
+    if (buff[offset] != 0xFF) {
+        pn532->log("Response frame preamble does not contain 0x00FF!");
+        return PN532_STATUS_ERROR;
+    }
+    offset += 1;
+    if (offset >= length + 8) {
+        pn532->log("Response contains no data!");
+        return PN532_STATUS_ERROR;
+    }
+    // Check length & length checksum match.
+    uint8_t frame_len = buff[offset];
+    if (((frame_len + buff[offset+1]) & 0xFF) != 0) {
+        pn532->log("Response length checksum did not match length!");
+        return PN532_STATUS_ERROR;
+    }
+    // Check frame checksum value matches bytes.
+    for (uint8_t i = 0; i < frame_len + 1; i++) {
+        checksum += buff[offset + 2 + i];
+    }
+    checksum &= 0xFF;
+    if (checksum != 0) {
+        pn532->log("Response checksum did not match expected checksum");
+        return PN532_STATUS_ERROR;
+    }
+    // Return frame data.
+    for (uint8_t i = 0; i < frame_len; i++) {
+        response[i] = buff[offset + 2 + i];
+    }
+    return frame_len;
+}
+
+/**
+  * @brief: Send specified command to the PN532 and expect up to response_length.
+  *     Will wait up to timeout seconds for a response and read a bytearray into
+  *     response buffer.
+  * @param pn532: PN532 handler
+  * @param command: command to send
+  * @param response: buffer returned
+  * @param response_length: expected response length
+  * @param params: can optionally specify an array of bytes to send as parameters
+  *     to the function call, or NULL if there is no need to send parameters.
+  * @param params_length: length of the argument params
+  * @param timeout: timout of systick
+  * @retval: Returns the length of response or -1 if error.
+  */
+int PN532_CallFunction(
+    PN532* pn532,
+    uint8_t command,
+    uint8_t* response,
+    uint16_t response_length,
+    uint8_t* params,
+    uint16_t params_length,
+    uint32_t timeout
+) {
+    // Build frame data with command and parameters.
+    uint8_t buff[PN532_FRAME_MAX_LENGTH];
+    buff[0] = PN532_HOSTTOPN532;
+    buff[1] = command & 0xFF;
+    for (uint8_t i = 0; i < params_length; i++) {
+        buff[2 + i] = params[i];
+    }
+    // Send frame and wait for response.
+    if (PN532_WriteFrame(pn532, buff, params_length + 2) != PN532_STATUS_OK) {
+        pn532->wakeup();
+        pn532->log("Trying to wakeup");
+        return PN532_STATUS_ERROR;
+    }
+    if (!pn532->wait_ready(timeout)) {
+        return PN532_STATUS_ERROR;
+    }
+    // Verify ACK response and wait to be ready for function response.
+    pn532->read_data(buff, sizeof(PN532_ACK));
+    for (uint8_t i = 0; i < sizeof(PN532_ACK); i++) {
+        if (PN532_ACK[i] != buff[i]) {
+            pn532->log("Did not receive expected ACK from PN532!");
+            return PN532_STATUS_ERROR;
+        }
+    }
+    if (!pn532->wait_ready(timeout)) {
+        return PN532_STATUS_ERROR;
+    }
+    // Read response bytes.
+    int frame_len = PN532_ReadFrame(pn532, buff, response_length + 2);
+
+    // Check that response is for the called function.
+    if (! ((buff[0] == PN532_PN532TOHOST) && (buff[1] == (command+1)))) {
+        pn532->log("Received unexpected command response!");
+        return PN532_STATUS_ERROR;
+    }
+    // Return response data.
+    for (uint8_t i = 0; i < response_length; i++) {
+        response[i] = buff[i + 2];
+    }
+    // The the number of bytes read
+    return frame_len - 2;
+}
+
+/**
+  * @brief: Call PN532 GetFirmwareVersion function and return a buff with the IC,
+  *  Ver, Rev, and Support values.
+  */
+int PN532_GetFirmwareVersion(PN532* pn532, uint8_t* version) {
+    // length of version: 4
+    if (PN532_CallFunction(pn532, PN532_COMMAND_GETFIRMWAREVERSION,
+                           version, 4, NULL, 0, 500) == PN532_STATUS_ERROR) {
+        pn532->log("Failed to detect the PN532");
+        return PN532_STATUS_ERROR;
+    }
+    return PN532_STATUS_OK;
+}
+
+/**
+  * @brief: Configure the PN532 to read MiFare cards.
+  */
+int PN532_SamConfiguration(PN532* pn532) {
+    // Send SAM configuration command with configuration for:
+    // - 0x01, normal mode
+    // - 0x14, timeout 50ms * 20 = 1 second
+    // - 0x01, use IRQ pin
+    // Note that no other verification is necessary as call_function will
+    // check the command was executed as expected.
+    uint8_t params[] = {0x01, 0x14, 0x01};
+    PN532_CallFunction(pn532, PN532_COMMAND_SAMCONFIGURATION,
+                       NULL, 0, params, sizeof(params), PN532_DEFAULT_TIMEOUT);
+    return PN532_STATUS_OK;
+}
+
+/**
+  * @brief: Wait for a MiFare card to be available and return its UID when found.
+  *     Will wait up to timeout seconds and return None if no card is found,
+  *     otherwise a bytearray with the UID of the found card is returned.
+  * @retval: Length of UID, or -1 if error.
+  */
+int PN532_ReadPassiveTarget(
+    PN532* pn532,
+    uint8_t* response,
+    uint8_t card_baud,
+    uint32_t timeout
+) {
+    // Send passive read command for 1 card.  Expect at most a 7 byte UUID.
+    uint8_t params[] = {0x01, card_baud};
+    uint8_t buff[19];
+    int length = PN532_CallFunction(pn532, PN532_COMMAND_INLISTPASSIVETARGET,
+                        buff, sizeof(buff), params, sizeof(params), timeout);
+    if (length < 0) {
+        return PN532_STATUS_ERROR; // No card found
+    }
+    // Check only 1 card with up to a 7 byte UID is present.
+    if (buff[0] != 0x01) {
+        pn532->log("More than one card detected!");
+        return PN532_STATUS_ERROR;
+    }
+    if (buff[5] > 7) {
+        pn532->log("Found card with unexpectedly long UID!");
+        return PN532_STATUS_ERROR;
+    }
+    for (uint8_t i = 0; i < buff[5]; i++) {
+        response[i] = buff[6 + i];
+    }
+    return buff[5];
+}
+
+/**
+  * @brief: Authenticate specified block number for a MiFare classic card.
+  * @param uid: A byte array with the UID of the card.
+  * @param uid_length: Length of the UID of the card.
+  * @param block_number: The block to authenticate.
+  * @param key_number: The key type (like MIFARE_CMD_AUTH_A or MIFARE_CMD_AUTH_B).
+  * @param key: A byte array with the key data.
+  * @retval: true if the block was authenticated, or false if not authenticated.
+  * @retval: PN532 error code.
+  */
+int PN532_MifareClassicAuthenticateBlock(
+    PN532* pn532,
+    uint8_t* uid,
+    uint8_t uid_length,
+    uint16_t block_number,
+    uint16_t key_number,
+    uint8_t* key
+) {
+    // Build parameters for InDataExchange command to authenticate MiFare card.
+    uint8_t response[1] = {0xFF};
+    uint8_t params[3 + MIFARE_UID_MAX_LENGTH + MIFARE_KEY_LENGTH];
+    params[0] = 0x01;
+    params[1] = key_number & 0xFF;
+    params[2] = block_number & 0xFF;
+    // params[3:3+keylen] = key
+    for (uint8_t i = 0; i < MIFARE_KEY_LENGTH; i++) {
+        params[3 + i] = key[i];
+    }
+    // params[3+keylen:] = uid
+    for (uint8_t i = 0; i < uid_length; i++) {
+        params[3 + MIFARE_KEY_LENGTH + i] = uid[i];
+    }
+    // Send InDataExchange request
+    PN532_CallFunction(pn532, PN532_COMMAND_INDATAEXCHANGE, response, sizeof(response),
+                       params, 3 + MIFARE_KEY_LENGTH + uid_length, PN532_DEFAULT_TIMEOUT);
+    return response[0];
+}
+
+/**
+  * @brief: Read a block of data from the card. Block number should be the block
+  *     to read.
+  * @param response: buffer of length 16 returned if the block is successfully read.
+  * @param block_number: specify a block to read.
+  * @retval: PN532 error code.
+  */
+int PN532_MifareClassicReadBlock(PN532* pn532, uint8_t* response, uint16_t block_number) {
+    uint8_t params[] = {0x01, MIFARE_CMD_READ, block_number & 0xFF};
+    uint8_t buff[MIFARE_BLOCK_LENGTH + 1];
+    // Send InDataExchange request to read block of MiFare data.
+    PN532_CallFunction(pn532, PN532_COMMAND_INDATAEXCHANGE, buff, sizeof(buff),
+                       params, sizeof(params), PN532_DEFAULT_TIMEOUT);
+    // Check first response is 0x00 to show success.
+    if (buff[0] != PN532_ERROR_NONE) {
+        return buff[0];
+    }
+    for (uint8_t i = 0; i < MIFARE_BLOCK_LENGTH; i++) {
+        response[i] = buff[i + 1];
+    }
+    return buff[0];
+}
+
+/**
+  * @brief: Write a block of data to the card.  Block number should be the block
+  *     to write and data should be a byte array of length 16 with the data to
+  *     write.
+  * @param data: data to write.
+  * @param block_number: specify a block to write.
+  * @retval: PN532 error code.
+  */
+int PN532_MifareClassicWriteBlock(PN532* pn532, uint8_t* data, uint16_t block_number) {
+    uint8_t params[MIFARE_BLOCK_LENGTH + 3];
+    uint8_t response[1];
+    params[0] = 0x01;  // Max card numbers
+    params[1] = MIFARE_CMD_WRITE;
+    params[2] = block_number & 0xFF;
+    for (uint8_t i = 0; i < MIFARE_BLOCK_LENGTH; i++) {
+        params[3 + i] = data[i];
+    }
+    PN532_CallFunction(pn532, PN532_COMMAND_INDATAEXCHANGE, response,
+                       sizeof(response), params, sizeof(params), PN532_DEFAULT_TIMEOUT);
+    return response[0];
+}
+
+/**
+  * @brief: Read a block of data from the card. Block number should be the block
+  *     to read.
+  * @param response: buffer of length 4 returned if the block is successfully read.
+  * @param block_number: specify a block to read.
+  * @retval: PN532 error code.
+  */
+int PN532_Ntag2xxReadBlock(PN532* pn532, uint8_t* response, uint16_t block_number) {
+    uint8_t params[] = {0x01, MIFARE_CMD_READ, block_number & 0xFF};
+    // The response length of NTAG2xx is same as Mifare's
+    uint8_t buff[MIFARE_BLOCK_LENGTH + 1];
+    // Send InDataExchange request to read block of MiFare data.
+    PN532_CallFunction(pn532, PN532_COMMAND_INDATAEXCHANGE, buff, sizeof(buff),
+                       params, sizeof(params), PN532_DEFAULT_TIMEOUT);
+    // Check first response is 0x00 to show success.
+    if (buff[0] != PN532_ERROR_NONE) {
+        return buff[0];
+    }
+    // Although the response length of NTAG2xx is same as Mifare's,
+    // only the first 4 bytes are available
+    for (uint8_t i = 0; i < NTAG2XX_BLOCK_LENGTH; i++) {
+        response[i] = buff[i + 1];
+    }
+    return buff[0];
+}
+
+/**
+  * @brief: Write a block of data to the card.  Block number should be the block
+  *     to write and data should be a byte array of length 4 with the data to
+  *     write.
+  * @param data: data to write.
+  * @param block_number: specify a block to write.
+  * @retval: PN532 error code.
+  */
+int PN532_Ntag2xxWriteBlock(PN532* pn532, uint8_t* data, uint16_t block_number) {
+    uint8_t params[NTAG2XX_BLOCK_LENGTH + 3];
+    uint8_t response[1];
+    params[0] = 0x01;  // Max card numbers
+    params[1] = MIFARE_ULTRALIGHT_CMD_WRITE;
+    params[2] = block_number & 0xFF;
+    for (uint8_t i = 0; i < NTAG2XX_BLOCK_LENGTH; i++) {
+        params[3 + i] = data[i];
+    }
+    PN532_CallFunction(pn532, PN532_COMMAND_INDATAEXCHANGE, response,
+                       sizeof(response), params, sizeof(params), PN532_DEFAULT_TIMEOUT);
+    return response[0];
+}
+
+/**
+  * @brief: Read the GPIO states.
+  * @param pin_state: pin state buffer (3 bytes) returned.
+  * returns 3 bytes containing the pin state where:
+  *     P3[0] = P30,   P7[0] = 0,   I[0] = I0,
+  *     P3[1] = P31,   P7[1] = P71, I[1] = I1,
+  *     P3[2] = P32,   P7[2] = P72, I[2] = 0,
+  *     P3[3] = P33,   P7[3] = 0,   I[3] = 0,
+  *     P3[4] = P34,   P7[4] = 0,   I[4] = 0,
+  *     P3[5] = P35,   P7[5] = 0,   I[5] = 0,
+  *     P3[6] = 0,     P7[6] = 0,   I[6] = 0,
+  *     P3[7] = 0,     P7[7] = 0,   I[7] = 0,
+  * @retval: -1 if error
+  */
+int PN532_ReadGpio(PN532* pn532, uint8_t* pins_state) {
+    return PN532_CallFunction(pn532, PN532_COMMAND_READGPIO, pins_state, 3,
+                              NULL, 0, PN532_DEFAULT_TIMEOUT);
+}
+/**
+  * @brief: Read the GPIO state of specified pins in (P30 ... P35).
+  * @param pin_number: specify the pin to read.
+  * @retval: true if HIGH, false if LOW
+  */
+bool PN532_ReadGpioP(PN532* pn532, uint8_t pin_number) {
+    uint8_t pins_state[3];
+    PN532_CallFunction(pn532, PN532_COMMAND_READGPIO, pins_state,
+                       sizeof(pins_state), NULL, 0, PN532_DEFAULT_TIMEOUT);
+    if ((pin_number >= 30) && (pin_number <= 37)) {
+        return (pins_state[0] >> (pin_number - 30)) & 1 ? true : false;
+    }
+    if ((pin_number >= 70) && (pin_number <= 77)) {
+        return (pins_state[1] >> (pin_number - 70)) & 1 ? true : false;
+    }
+    return false;
+}
+/**
+  * @brief: Read the GPIO state of I0 or I1 pin.
+  * @param pin_number: specify the pin to read.
+  * @retval: true if HIGH, false if LOW
+  */
+bool PN532_ReadGpioI(PN532* pn532, uint8_t pin_number) {
+    uint8_t pins_state[3];
+    PN532_CallFunction(pn532, PN532_COMMAND_READGPIO, pins_state,
+                       sizeof(pins_state), NULL, 0, PN532_DEFAULT_TIMEOUT);
+    if (pin_number <= 7) {
+        return (pins_state[2] >> pin_number) & 1 ? true : false;
+    }
+    return false;
+}
+/**
+  * @brief: Write the GPIO states.
+  * @param pins_state: pin state buffer (2 bytes) to write.
+  *     no need to read pin states before write with the param pin_state
+  *         P3 = pin_state[0], P7 = pin_state[1]
+  *     bits:
+  *         P3[0] = P30,   P7[0] = 0,
+  *         P3[1] = P31,   P7[1] = P71,
+  *         P3[2] = P32,   P7[2] = P72,
+  *         P3[3] = P33,   P7[3] = nu,
+  *         P3[4] = P34,   P7[4] = nu,
+  *         P3[5] = P35,   P7[5] = nu,
+  *         P3[6] = nu,    P7[6] = nu,
+  *         P3[7] = Val,   P7[7] = Val,
+  *     For each port that is validated (bit Val = 1), all the bits are applied
+  *     simultaneously. It is not possible for example to modify the state of
+  *     the port P32 without applying a value to the ports P30, P31, P33, P34
+  *     and P35.
+  * @retval: -1 if error
+  */
+int PN532_WriteGpio(PN532* pn532, uint8_t* pins_state) {
+    uint8_t params[2];
+    // 0x80, the validation bit.
+    params[0] = 0x80 | pins_state[0];
+    params[1] = 0x80 | pins_state[1];
+    return PN532_CallFunction(pn532, PN532_COMMAND_WRITEGPIO, NULL, 0,
+                              params, sizeof(params), PN532_DEFAULT_TIMEOUT);
+}
+/**
+  * @brief: Write the specified pin with given states.
+  * @param pin_number: specify the pin to write.
+  * @param pin_state: specify the pin state. true for HIGH, false for LOW.
+  * @retval: -1 if error
+  */
+int PN532_WriteGpioP(PN532* pn532, uint8_t pin_number, bool pin_state) {
+    uint8_t pins_state[2];
+    uint8_t params[2];
+    if (PN532_ReadGpio(pn532, pins_state) == PN532_STATUS_ERROR) {
+        return PN532_STATUS_ERROR;
+    }
+    if ((pin_number >= 30) && (pin_number <= 37)) {
+        if (pin_state) {
+            params[0] = 0x80 | pins_state[0] | 1 << (pin_number - 30);
+        } else {
+            params[0] = (0x80 | pins_state[0]) & ~(1 << (pin_number - 30));
+        }
+        params[1] = 0x00;   // leave p7 unchanged
+    }
+    if ((pin_number >= 70) && (pin_number <= 77)) {
+        if (pin_state) {
+            params[1] = 0x80 | pins_state[1] | 1 << (pin_number - 70);
+        } else {
+            params[1] = (0x80 | pins_state[1]) & ~(1 << (pin_number - 70));
+        }
+        params[0] = 0x00;   // leave p3 unchanged
+    }
+    return PN532_CallFunction(pn532, PN532_COMMAND_WRITEGPIO, NULL, 0,
+                              params, sizeof(params), PN532_DEFAULT_TIMEOUT);
+}

+ 172 - 0
vendor/bossay/NFC_Demo/A08_NFC/src/pn532_hi3861.c

@@ -0,0 +1,172 @@
+/**************************************************************************
+ *  @file     pn532_stm32f1.c
+ *  @author   Yehui from Waveshare
+ *  @license  BSD
+ *  
+ *  This implements the peripheral interfaces.
+ *  
+ *  Check out the links above for our tutorials and wiring diagrams 
+ *  These chips use SPI communicate.
+ *  
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documnetation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to  whom the Software is
+ * furished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ **************************************************************************/
+
+// #include "stm32f1xx_hal.h"
+// #include "main.h"
+#include "pn532_hi3861.h"
+#include "cmsis_os2.h"
+#include "iot_errno.h"
+#include "iot_gpio.h"
+#include "iot_gpio_ex.h"
+#include "iot_i2c.h"
+#include "iot_i2c_ex.h"
+
+#define RESET_GPIO 14
+#define WIFI_IOT_I2C_IDX_1 1
+
+#define _I2C_ADDRESS                    0x48
+#define _I2C_TIMEOUT                    10
+
+#define WIFI_IOT_IO_FUNC_GPIO_0_I2C1_SDA 6
+#define WIFI_IOT_IO_FUNC_GPIO_1_I2C1_SCL 6
+#define WIFI_IOT_I2C_IDX_1 1
+#define WIFI_IOT_IO_NAME_GPIO_7 7
+#define WIFI_IOT_IO_NAME_GPIO_8 8
+#define WIFI_IOT_IO_NAME_GPIO_0 0
+#define WIFI_IOT_IO_NAME_GPIO_1 1
+#define MAX30102_INIT_GPIO 7
+/***************************************************************
+ * 函数名称: GpioInit
+ * 说    明:  GPIO初始化
+ * 参    数: 无
+ * 返 回 值: 无
+ ***************************************************************/
+void BoardInit(void)
+{
+    IoTGpioInit(RESET_GPIO);
+    IoTGpioSetFunc(RESET_GPIO, IOT_GPIO_FUNC_GPIO_14_GPIO);
+    IoTGpioSetDir(RESET_GPIO, IOT_GPIO_DIR_OUT); // 设置GPIO_8为输出模式
+
+    // IoTGpioInit(MAX30102_INIT_GPIO);
+    // IoTGpioSetFunc(MAX30102_INIT_GPIO, IOT_GPIO_FUNC_GPIO_7_GPIO);
+    // IoTGpioSetDir(MAX30102_INIT_GPIO, IOT_GPIO_DIR_IN); // 设置GPIO_7为输出模式
+
+    IoTGpioInit(WIFI_IOT_IO_NAME_GPIO_0);
+    IoTGpioSetFunc(WIFI_IOT_IO_NAME_GPIO_0, WIFI_IOT_IO_FUNC_GPIO_0_I2C1_SDA); // GPIO_0复用为I2C1_SDA
+    IoTGpioInit(WIFI_IOT_IO_NAME_GPIO_1);
+    IoTGpioSetFunc(WIFI_IOT_IO_NAME_GPIO_1, WIFI_IOT_IO_FUNC_GPIO_1_I2C1_SCL); // GPIO_1复用为I2C1_SCL
+    IoTI2cInit(WIFI_IOT_I2C_IDX_1, 400000);              /* baudrate: 400kbps */
+}
+
+/**************************************************************************
+ * Reset and Log implements
+ **************************************************************************/
+int PN532_Reset(void) {
+    IoTGpioSetOutputVal(RESET_GPIO, 1); 
+    osDelay(100);
+    IoTGpioSetOutputVal(RESET_GPIO, 0); 
+    osDelay(500);
+    IoTGpioSetOutputVal(RESET_GPIO, 1); 
+    osDelay(100);
+    return PN532_STATUS_OK;
+}
+
+void PN532_Log(const char* log) {
+    printf("%s\r\n", log);
+}
+
+/**************************************************************************
+ * End: Reset and Log implements
+ **************************************************************************/
+
+/**************************************************************************
+ * I2C
+ **************************************************************************/
+void I2cRead(uint8_t* data, uint16_t count) {
+    // HAL_I2C_Master_Receive(&hi2c1, _I2C_ADDRESS, data, count, _I2C_TIMEOUT);
+    IoTI2cRead(WIFI_IOT_I2C_IDX_1, _I2C_ADDRESS , data, count);
+
+}
+
+void I2cWrite(uint8_t* data, uint16_t count) {
+    // HAL_I2C_Master_Transmit(&hi2c1, _I2C_ADDRESS, data, count, _I2C_TIMEOUT);
+    IoTI2cWrite(WIFI_IOT_I2C_IDX_1, _I2C_ADDRESS, data, count);
+
+}
+
+int PN532_I2C_ReadData(uint8_t* data, uint16_t count) {
+    uint8_t status[] = {0x00};
+    uint8_t frame[count + 1];
+    I2cRead(status, sizeof(status));
+    if (status[0] != PN532_I2C_READY) {
+        return PN532_STATUS_ERROR;
+    }
+    I2cRead(frame, count + 1);
+    for (uint8_t i = 0; i < count; i++) {
+        data[i] = frame[i + 1];
+    }
+    return PN532_STATUS_OK;
+}
+
+int PN532_I2C_WriteData(uint8_t *data, uint16_t count) {
+    I2cWrite(data, count);
+    return PN532_STATUS_OK;
+}
+
+bool PN532_I2C_WaitReady(uint32_t timeout) {
+    uint8_t status[] = {0x00};
+    uint32_t tickstart = osKernelGetTickCount();
+    while (osKernelGetTickCount() - tickstart < timeout) {
+        I2cRead(status, sizeof(status));
+        if (status[0] == PN532_I2C_READY) {
+            return true;
+        } else {
+            osDelay(5);
+        }
+    }
+    return false;
+}
+
+int PN532_I2C_Wakeup(void) {
+    // TODO
+    // HAL_GPIO_WritePin(PN532_REQ_GPIO_Port, PN532_REQ_Pin, GPIO_PIN_SET);
+    osDelay(100);
+    // HAL_GPIO_WritePin(PN532_REQ_GPIO_Port, PN532_REQ_Pin, GPIO_PIN_RESET);
+    osDelay(100);
+    // HAL_GPIO_WritePin(PN532_REQ_GPIO_Port, PN532_REQ_Pin, GPIO_PIN_SET);
+    osDelay(500);
+    return PN532_STATUS_OK;
+}
+
+void PN532_I2C_Init(PN532* pn532) {
+    BoardInit();
+    // init the pn532 functions
+    pn532->reset =  PN532_Reset;
+    pn532->read_data = PN532_I2C_ReadData;
+    pn532->write_data = PN532_I2C_WriteData;
+    pn532->wait_ready = PN532_I2C_WaitReady;
+    pn532->wakeup = PN532_I2C_Wakeup;
+    pn532->log = PN532_Log;
+
+    // hardware wakeup
+    pn532->wakeup();
+}
+/**************************************************************************
+ * End: I2C
+ **************************************************************************/

+ 10 - 0
vendor/bossay/NFC_Demo/BUILD.gn

@@ -0,0 +1,10 @@
+# Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
+
+group("NFC_Demo") {
+    deps = [
+        "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+        "../common/iot_wifi:iot_wifi",
+        # "//applications/sample/app:app",
+        "A08_NFC:A08_NFC",
+    ]
+}

+ 96 - 0
vendor/bossay/NFC_Demo/config.json

@@ -0,0 +1,96 @@
+{
+    "product_name": "NFC_Demo",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      }
+      
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 10 - 0
vendor/bossay/PM2_5_Monitoring/BUILD.gn

@@ -0,0 +1,10 @@
+# Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
+
+group("PM2_5_Monitoring") {
+    deps = [
+        "//device/bossay/hi3861_l0/sdk_liteos:wifiiot_sdk",
+        "../common/iot_wifi:iot_wifi",
+        # "//applications/sample/app:app",
+        "demo_PM2_5_Monitoring:bossay_hi3861_l0_PM2_5_Monitoring",
+    ]
+}

+ 95 - 0
vendor/bossay/PM2_5_Monitoring/config.json

@@ -0,0 +1,95 @@
+{
+    "product_name": "PM2_5_Monitoring",
+    "ohos_version": "OpenHarmony 1.0",
+    "device_company": "bossay",
+    "board": "hi3861_l0",
+    "kernel_type": "liteos_m",
+    "kernel_version": "",
+    "subsystems": [
+      {
+        "subsystem": "applications",
+        "components": [
+          { "component": "wifi_iot_sample_app", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot_hardware",
+        "components": [
+          { "component": "iot_controller", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "hiviewdfx",
+        "components": [
+          { "component": "hilog_lite", "features":[] },
+          { "component": "hievent_lite", "features":[] },
+          { "component": "blackbox", "features":[] },
+          { "component": "hidumper_mini", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "distributed_schedule",
+        "components": [
+          { "component": "samgr_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "security",
+        "components": [
+          { "component": "hichainsdk", "features":[] },
+          { "component": "deviceauth_lite", "features":[] },
+          { "component": "huks", "features":
+            [
+              "disable_huks_binary = false",
+              "disable_authenticate = false",
+              "huks_use_lite_storage = true",
+              "huks_use_hardware_root_key = true",
+              "huks_config_file = \"hks_config_lite.h\"",
+              "huks_mbedtls_path = \"//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls/include/\""
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "startup",
+        "components": [
+          { "component": "bootstrap_lite", "features":[] },
+          { "component": "syspara_lite", "features":
+            [
+              "enable_ohos_startup_syspara_lite_use_thirdparty_mbedtls = false"
+            ]
+          }
+        ]
+      },
+      {
+        "subsystem": "communication",
+        "components": [
+          { "component": "wifi_lite", "features":[] },
+          { "component": "softbus_lite", "features":[] },
+          { "component": "wifi_aware", "features":[]}
+        ]
+      },
+      {
+        "subsystem": "update",
+        "components": [
+          { "component": "ota_lite", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "iot",
+        "components": [
+          { "component": "iot_link", "features":[] }
+        ]
+      },
+      {
+        "subsystem": "utils",
+        "components": [
+          { "component": "file", "features":[] },
+          { "component": "kv_store", "features":[] },
+          { "component": "os_dump", "features":[] }
+        ]
+      }
+    ],
+    "third_party_dir": "//device/bossay/hi3861_l0/sdk_liteos/third_party",
+    "product_adapter_dir": "//vendor/bossay/hi3861_l0/hals"
+  }

+ 32 - 0
vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/BUILD.gn

@@ -0,0 +1,32 @@
+static_library("bossay_hi3861_l0_PM2_5_Monitoring") {
+    sources = [
+        "main_entry.c",
+    ]
+    
+    cflags = [ "-Wno-unused-variable" ]
+    cflags += [ "-Wno-unused-but-set-variable" ]
+    cflags += [ "-Wno-unused-parameter" ]
+    
+    include_dirs = [
+        "./sensor/inc",
+        "../../common/inc",
+        "cloud_connect/inc",
+        "//third_party/cJSON",
+        "./OLED/include"
+        
+    ]
+
+    deps = [ 
+         "../../common/iot_sntp:iot_sntp",
+         "../../common/iot_wifi:iot_wifi",
+         "../../common/iot_schedule:iot_schedule",
+         #"../../common/iot_nfc:iot_nfc",
+         "../../common/iot_cloud:iot_cloud",
+         #"../../common/iot_boardled:iot_boardled",
+         #"../../common/iot_boardbutton:iot_boardbutton",
+         "cloud_connect:cloud_connect",
+         "sensor:bossay_hi3861_l0_sensor",
+         "OLED:bossay_hi3816l0_OLED",
+    ]
+
+}

+ 20 - 0
vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/BUILD.gn

@@ -0,0 +1,20 @@
+static_library("bossay_hi3816l0_OLED"){
+
+    cflags = [ "-Wno-unused-variable" ]
+    cflags += [ "-Wno-unused-but-set-variable" ]
+    cflags += [ "-Wno-unused-parameter" ]
+
+    include_dirs = [
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//base/iot_hardware/peripheral/interfaces/kits",
+        "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+        "//device/bossay/hi3861_l0/sdk_liteos/include",
+        "include",
+    ]
+    sources = [
+        "src/OLED_I2C.c",
+        "OLED_DisplayTask.c",
+    ]
+}
+
+

+ 14 - 0
vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/OLED_DisplayTask.c

@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */

+ 44 - 0
vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/include/OLED_I2C.h

@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2021 Jinan Bosai Network Technology Co., Ltd.
+ * 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.
+ */
+#ifndef __OLED_I2C_H
+#define	__OLED_I2C_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include "iot_gpio.h"
+
+#define OLED_ADDRESS	0x3D //通过调整0R电阻,屏可以0x3C和0x3D两个地址 -- 默认0x3C
+#define KEY_GPIO 11
+
+void initKey(GpioIsrCallbackFunc func);
+bool isKeyON(void);
+
+
+
+void OLED_BoardInit(void);
+void I2C_WriteByte(uint8_t addr,uint8_t data);
+void WriteCmd(unsigned char I2C_Command);
+void WriteDat(unsigned char I2C_Data);
+void OLED_Init(void);
+void OLED_SetPos(unsigned char x, unsigned char y);
+void OLED_Fill(unsigned char fill_Data);
+void OLED_CLS(void);
+void OLED_ON(void);
+void OLED_OFF(void);
+void OLED_ShowStr(unsigned char x, unsigned char y, unsigned char ch[], unsigned char TextSize);
+void OLED_ShowCN(unsigned char x, unsigned char y, unsigned char N);
+void OLED_DrawBMP(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1,unsigned char BMP[]);
+
+#endif

+ 281 - 0
vendor/bossay/PM2_5_Monitoring/demo_PM2_5_Monitoring/OLED/include/codetab.h

@@ -0,0 +1,281 @@
+#ifndef __CODETAB_H
+#define	__CODETAB_H
+
+
+/***************************16*16的点阵字体取模方式:共阴——列行式——逆向输出*********/
+unsigned char F16x16[] =
+
+{	0x24,0x24,0xA4,0xFE,0xA3,0x22,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
+	0x08,0x06,0x01,0xFF,0x00,0x01,0x04,0x04,0x04,0x04,0x04,0xFF,0x02,0x02,0x02,0x00,/*"科",0*/
+
+	0x10,0x10,0x10,0xFF,0x10,0x90,0x08,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x08,0x00,
+	0x04,0x44,0x82,0x7F,0x01,0x80,0x80,0x40,0x43,0x2C,0x10,0x28,0x46,0x81,0x80,0x00/*"技",1*/
+};
+
+
+/************************************6*8的点阵************************************/
+const unsigned char F6x8[][6] =
+{
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp
+	0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !
+	0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "
+	0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14,// #
+	0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12,// $
+	0x00, 0x62, 0x64, 0x08, 0x13, 0x23,// %
+	0x00, 0x36, 0x49, 0x55, 0x22, 0x50,// &
+	0x00, 0x00, 0x05, 0x03, 0x00, 0x00,// '
+	0x00, 0x00, 0x1c, 0x22, 0x41, 0x00,// (
+	0x00, 0x00, 0x41, 0x22, 0x1c, 0x00,// )
+	0x00, 0x14, 0x08, 0x3E, 0x08, 0x14,// *
+	0x00, 0x08, 0x08, 0x3E, 0x08, 0x08,// +
+	0x00, 0x00, 0x00, 0xA0, 0x60, 0x00,// ,
+	0x00, 0x08, 0x08, 0x08, 0x08, 0x08,// -
+	0x00, 0x00, 0x60, 0x60, 0x00, 0x00,// .
+	0x00, 0x20, 0x10, 0x08, 0x04, 0x02,// /
+	0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
+	0x00, 0x00, 0x42, 0x7F, 0x40, 0x00,// 1
+	0x00, 0x42, 0x61, 0x51, 0x49, 0x46,// 2
+	0x00, 0x21, 0x41, 0x45, 0x4B, 0x31,// 3
+	0x00, 0x18, 0x14, 0x12, 0x7F, 0x10,// 4
+	0x00, 0x27, 0x45, 0x45, 0x45, 0x39,// 5
+	0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
+	0x00, 0x01, 0x71, 0x09, 0x05, 0x03,// 7
+	0x00, 0x36, 0x49, 0x49, 0x49, 0x36,// 8
+	0x00, 0x06, 0x49, 0x49, 0x29, 0x1E,// 9
+	0x00, 0x00, 0x36, 0x36, 0x00, 0x00,// :
+	0x00, 0x00, 0x56, 0x36, 0x00, 0x00,// ;
+	0x00, 0x08, 0x14, 0x22, 0x41, 0x00,// <
+	0x00, 0x14, 0x14, 0x14, 0x14, 0x14,// =
+	0x00, 0x00, 0x41, 0x22, 0x14, 0x08,// >
+	0x00, 0x02, 0x01, 0x51, 0x09, 0x06,// ?
+	0x00, 0x32, 0x49, 0x59, 0x51, 0x3E,// @
+	0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C,// A
+	0x00, 0x7F, 0x49, 0x49, 0x49, 0x36,// B
+	0x00, 0x3E, 0x41, 0x41, 0x41, 0x22,// C
+	0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C,// D
+	0x00, 0x7F, 0x49, 0x49, 0x49, 0x41,// E
+	0x00, 0x7F, 0x09, 0x09, 0x09, 0x01,// F
+	0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A,// G
+	0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F,// H
+	0x00, 0x00, 0x41, 0x7F, 0x41, 0x00,// I
+	0x00, 0x20, 0x40, 0x41, 0x3F, 0x01,// J
+	0x00, 0x7F, 0x08, 0x14, 0x22, 0x41,// K
+	0x00, 0x7F, 0x40, 0x40, 0x40, 0x40,// L
+	0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F,// M
+	0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F,// N
+	0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E,// O
+	0x00, 0x7F, 0x09, 0x09, 0x09, 0x06,// P
+	0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
+	0x00, 0x7F, 0x09, 0x19, 0x29, 0x46,// R
+	0x00, 0x46, 0x49, 0x49, 0x49, 0x31,// S
+	0x00, 0x01, 0x01, 0x7F, 0x01, 0x01,// T
+	0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F,// U
+	0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F,// V
+	0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F,// W
+	0x00, 0x63, 0x14, 0x08, 0x14, 0x63,// X
+	0x00, 0x07, 0x08, 0x70, 0x08, 0x07,// Y
+	0x00, 0x61, 0x51, 0x49, 0x45, 0x43,// Z
+	0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// [
+	0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55,// 55
+	0x00, 0x00, 0x41, 0x41, 0x7F, 0x00,// ]
+	0x00, 0x04, 0x02, 0x01, 0x02, 0x04,// ^
+	0x00, 0x40, 0x40, 0x40, 0x40, 0x40,// _
+	0x00, 0x00, 0x01, 0x02, 0x04, 0x00,// '
+	0x00, 0x20, 0x54, 0x54, 0x54, 0x78,// a
+	0x00, 0x7F, 0x48, 0x44, 0x44, 0x38,// b
+	0x00, 0x38, 0x44, 0x44, 0x44, 0x20,// c
+	0x00, 0x38, 0x44, 0x44, 0x48, 0x7F,// d
+	0x00, 0x38, 0x54, 0x54, 0x54, 0x18,// e
+	0x00, 0x08, 0x7E, 0x09, 0x01, 0x02,// f
+	0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C,// g
+	0x00, 0x7F, 0x08, 0x04, 0x04, 0x78,// h
+	0x00, 0x00, 0x44, 0x7D, 0x40, 0x00,// i
+	0x00, 0x40, 0x80, 0x84, 0x7D, 0x00,// j
+	0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,// k
+	0x00, 0x00, 0x41, 0x7F, 0x40, 0x00,// l
+	0x00, 0x7C, 0x04, 0x18, 0x04, 0x78,// m
+	0x00, 0x7C, 0x08, 0x04, 0x04, 0x78,// n
+	0x00, 0x38, 0x44, 0x44, 0x44, 0x38,// o
+	0x00, 0xFC, 0x24, 0x24, 0x24, 0x18,// p
+	0x00, 0x18, 0x24, 0x24, 0x18, 0xFC,// q
+	0x00, 0x7C, 0x08, 0x04, 0x04, 0x08,// r
+	0x00, 0x48, 0x54, 0x54, 0x54, 0x20,// s
+	0x00, 0x04, 0x3F, 0x44, 0x40, 0x20,// t
+	0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C,// u
+	0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C,// v
+	0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C,// w
+	0x00, 0x44, 0x28, 0x10, 0x28, 0x44,// x
+	0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C,// y
+	0x00, 0x44, 0x64, 0x54, 0x4C, 0x44,// z
+	0x14, 0x14, 0x14, 0x14, 0x14, 0x14,// horiz lines
+};
+/****************************************8*16的点阵************************************/
+const unsigned char F8X16[]=	  
+{
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
+  0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 1
+  0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 2
+  0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 3
+  0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 4
+  0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 5
+  0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 6
+  0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 7
+  0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 8
+  0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 9
+  0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 10
+  0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 11
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 12
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 13
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 14
+  0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 15
+  0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 16
+  0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 17
+  0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 18
+  0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 19
+  0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 20
+  0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 21
+  0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 22
+  0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 23
+  0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 24
+  0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 25
+  0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 26
+  0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 27
+  0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 28
+  0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 29
+  0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 30
+  0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 31
+  0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 32
+  0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 33
+  0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 34
+  0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 35
+  0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 36
+  0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 37
+  0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 38
+  0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 39
+  0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 40
+  0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 41
+  0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 42
+  0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 43
+  0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 44
+  0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 45
+  0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 46
+  0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 47
+  0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 48
+  0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 49
+  0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 50
+  0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 51
+  0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 52
+  0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 53
+  0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 54
+  0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 55
+  0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 56
+  0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 57
+  0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 58
+  0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 59
+  0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 60
+  0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 61
+  0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 62
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 63
+  0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 64
+  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 65
+  0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 66
+  0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 67
+  0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 68
+  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 69
+  0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 70
+  0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 71
+  0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 72
+  0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 73
+  0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 74
+  0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 75
+  0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 76
+  0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 77
+  0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 78
+  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 79
+  0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 80
+  0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 81
+  0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 82
+  0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 83
+  0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 84
+  0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 85
+  0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 86
+  0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 87
+  0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 88
+  0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 89
+  0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 90
+  0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 91
+  0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 92
+  0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 93
+  0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
+};
+
+unsigned char BMP1[] =
+{
+	0x00,0x03,0x05,0x09,0x11,0xFF,0x11,0x89,0x05,0xC3,0x00,0xE0,0x00,0xF0,0x00,0xF8,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x28,0xFF,0x11,0xAA,0x44,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x01,0x38,0x44,0x82,0x92,
+	0x92,0x74,0x01,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x44,0xC7,0x01,0x7D,
+	0x7D,0x7D,0x7D,0x01,0x7D,0x7D,0x7D,0x7D,0x01,0x7D,0x7D,0x7D,0x7D,0x01,0xFF,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,
+	0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00,
+	0x6D,0x6D,0x6D,0x6D,0x6D,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x40,0x40,
+	0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,
+	0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDB,0xDB,
+	0xDB,0xDB,0xDB,0x00,0x00,0xDA,0xDA,0xDA,0xDA,0xDA,0x00,0x00,0xD8,0xD8,0xD8,0xD8,
+	0xD8,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,
+	0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x80,
+	0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,
+	0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,
+	0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0xE6,0x66,0x20,0x00,0x06,0x06,0x86,0x06,
+	0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x86,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,
+	0x00,0x86,0x86,0x86,0x86,0x86,0x80,0x80,0x86,0x86,0x06,0x86,0x86,0xC0,0xC0,0x86,
+	0x86,0x86,0x06,0x06,0xD0,0x30,0x76,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,
+	0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,
+	0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x1C,0x00,0xFE,0x00,0x01,
+	0x02,0x00,0xC4,0x18,0x20,0x02,0x9E,0x63,0xB2,0x0E,0x00,0xFF,0x81,0x81,0xFF,0x00,
+	0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0xFF,0x00,0x23,0xEA,0xAA,0xBF,0xAA,
+	0xEA,0x03,0x3F,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x0C,0x08,0x00,0x00,0x01,0x01,0x01,
+	0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x81,0x80,0x80,0x81,0x80,
+	0x81,0x80,0x80,0x80,0x80,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
+	0x01,0x00,0x01,0x01,0x09,0x0C,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
+	0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,
+	0x00,0x1E,0x21,0x40,0x40,0x50,0x21,0x5E,0x00,0x1E,0x21,0x40,0x40,0x50,0x21,0x5E,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xC1,0xC1,0xFF,
+	0xFF,0xC1,0xC1,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x80,0xFC,0xF3,0xEF,0xF3,0xFC,
+	0x80,0xFF,0x80,0xEE,0xEE,0xEE,0xF5,0xFB,0xFF,0x9C,0xBE,0xB6,0xB6,0x88,0xFF,0x00,/*"D:\DreamSpark\OLED\MP3_UI.bmp",0*/
+};
+
+
+#endif

Деякі файли не було показано, через те що забагато файлів було змінено