From f9a16438596fb29e0cdec65fedcc230cc979a5e1 Mon Sep 17 00:00:00 2001 From: ROC Date: Fri, 4 Mar 2022 12:45:22 +0800 Subject: [PATCH] update Signed-off-by: ROC --- BUILD.gn | 1 + OAT.xml | 0 README_ZH.md | 0 dev_wifi_a/liteos_m/config.gni | 19 ++++++++------ dev_wifi_a/ohos.build | 0 hcs/BUILD.gn | 24 ++++++++++++++++++ hcs/asr582x.hcs | 18 ++++++++++++++ hcs/device_info.hcs | 44 +++++++++++++++++++++++++++++++++ hcs/gpio.hcs | 33 +++++++++++++++++++++++++ hcs/hdf.hcs | 3 +++ hcs/uart.hcs | 36 +++++++++++++++++++++++++++ image/外观功能图.png | Bin image/外观尺寸图.png | Bin image/烧录模式.png | Bin 14 files changed, 171 insertions(+), 7 deletions(-) mode change 100644 => 100755 OAT.xml mode change 100644 => 100755 README_ZH.md mode change 100644 => 100755 dev_wifi_a/liteos_m/config.gni mode change 100644 => 100755 dev_wifi_a/ohos.build create mode 100755 hcs/BUILD.gn create mode 100755 hcs/asr582x.hcs create mode 100755 hcs/device_info.hcs create mode 100755 hcs/gpio.hcs create mode 100755 hcs/hdf.hcs create mode 100755 hcs/uart.hcs mode change 100644 => 100755 image/外观功能图.png mode change 100644 => 100755 image/外观尺寸图.png mode change 100644 => 100755 image/烧录模式.png diff --git a/BUILD.gn b/BUILD.gn index 256060d..9a3ab0e 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -18,6 +18,7 @@ if (ohos_kernel_type == "liteos_m") { modules = [ "dev_wifi_a", "shields", + "hcs", ] } } diff --git a/OAT.xml b/OAT.xml old mode 100644 new mode 100755 diff --git a/README_ZH.md b/README_ZH.md old mode 100644 new mode 100755 diff --git a/dev_wifi_a/liteos_m/config.gni b/dev_wifi_a/liteos_m/config.gni old mode 100644 new mode 100755 index a340926..7feaf0b --- a/dev_wifi_a/liteos_m/config.gni +++ b/dev_wifi_a/liteos_m/config.gni @@ -45,6 +45,7 @@ if (product_path != "") { product_conf = read_file("${product_path}/config.json", "json") product_name = product_conf.product_name xts_list = product_conf.xts_list + tests_list = product_conf.tests_list } # Board related common compile flags. @@ -78,11 +79,16 @@ board_cflags = [ #"-DLWIP_DHCP", #"-D_POSIX_SOURCE", #"-D_GNU_SOURCE=1", + "-DCFG_NAN_CONFIG", "-D__LITEOS_M__", - #"-Wno-unused-parameter", - #"-Wno-sign-compare", + "-Wno-unused-parameter", + "-Wno-sign-compare", + "-Wno-parentheses", + "-Wno-cast-function-type", ] -board_cxx_flags = [ "-mfloat-abi=softfp" ] + +board_cxx_flags = board_cflags + board_ld_flags = [ "-mcpu=cortex-m4", "-mthumb", @@ -115,9 +121,10 @@ board_include_dirs = [ "//device/soc/asrmicro/asr582x/liteos_m/sdk/drivers/kv/include/", "//device/soc/asrmicro/asr582x/liteos_m/sdk/drivers/driver/inc/", "//device/soc/asrmicro/asr582x/liteos_m/sdk/drivers/common/", + "//device/soc/asrmicro/asr582x/liteos_m/sdk/drivers/include/", + "//device/soc/asrmicro/asr582x/liteos_m/sdk/drivers/iperf/", + "//device/soc/asrmicro/asr582x/liteos_m/sdk/config/", "//device/soc/asrmicro/asr582x/liteos_m/sdk/liteos_m/", - "//device/soc/asrmicro/asr582x/liteos_m/sdk/lwip/include/", - "//device/soc/asrmicro/asr582x/liteos_m/sdk/lwip/port/include/", "//kernel/liteos_m/kernel/arch/arm/cortex-m4/gcc/", "//kernel/liteos_m/kernel/arch/include/", "//kernel/liteos_m/utils/", @@ -133,8 +140,6 @@ board_include_dirs = [ "//third_party/openssl/include", "//third_party/openssl/crypto/include", "//third_party/openssl/crypto/ec", - "//third_party/musl/porting/liteos_m/kernel/include", - "//third_party/musl/porting/liteos_m/kernel/src/internal", ] board_include_dirs += [] diff --git a/dev_wifi_a/ohos.build b/dev_wifi_a/ohos.build old mode 100644 new mode 100755 diff --git a/hcs/BUILD.gn b/hcs/BUILD.gn new file mode 100755 index 0000000..275e9ce --- /dev/null +++ b/hcs/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright (c) 2022 ASR Microelectronics (Shanghai) Co., Ltd. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if (ohos_kernel_type == "liteos_m") { + import("//drivers/adapter/khdf/liteos_m/hdf.gni") + module_name = get_path_info(rebase_path("."), "name") + hdf_driver(module_name) { + hcs_sources = [ "asr582x.hcs" ] + visibility += [ + "$device_path", + ".", + ] + } +} diff --git a/hcs/asr582x.hcs b/hcs/asr582x.hcs new file mode 100755 index 0000000..3a83fe3 --- /dev/null +++ b/hcs/asr582x.hcs @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2022 ASR Microelectronics (Shanghai) Co., Ltd. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "hdf.hcs" + + diff --git a/hcs/device_info.hcs b/hcs/device_info.hcs new file mode 100755 index 0000000..ff70ef7 --- /dev/null +++ b/hcs/device_info.hcs @@ -0,0 +1,44 @@ +root { + module = "asrmicro,asr582x"; + device_info { + match_attr = "hdf_manager"; + template host { + hostName = ""; + priority = 100; + template device { + template deviceNode { + policy = 0; + priority = 100; + preload = 0; + permission = 0664; + moduleName = ""; + serviceName = ""; + deviceMatchAttr = ""; + } + } + } + platform :: host { + hostName = "platform_host"; + priority = 50; + device_gpio :: device { + gpio0 :: deviceNode { + policy = 0; + priority = 100; + moduleName = "ASR_GPIO_MODULE_HDF"; + serviceName = "HDF_PLATFORM_GPIO"; + deviceMatchAttr = "gpio_config"; + } + } + device_uart :: device { + device0 :: deviceNode { + policy = 1; + priority = 40; + permission = 0644; + moduleName = "HDF_PLATFORM_UART"; + serviceName = "HDF_PLATFORM_UART_0"; + deviceMatchAttr = "asr582x_uart_0"; + } + } + } + } +} \ No newline at end of file diff --git a/hcs/gpio.hcs b/hcs/gpio.hcs new file mode 100755 index 0000000..76a540f --- /dev/null +++ b/hcs/gpio.hcs @@ -0,0 +1,33 @@ +root { + platform { + gpio_config { + match_attr = "gpio_config"; + pin = [0, 1]; + // led3: GPIO9 + // user key: GPIO7 + realPin = [9, 7]; + config = [5, 1]; + pinNum = 2; + } + controller_uart0 :: uart_controller { + match_attr = "goodix_gr55xx_uart_0"; + id = 0; /* APP_UART_ID_0 */ + baudrate = 115200; + pin_tx_type = 0; /* APP_IO_TYPE_NORMAL */ + pin_tx_pin = 10; /* APP_IO_PIN_10 */ + pin_tx_mux = 2; /* APP_IO_MUX_2 */ + pin_tx_pull = 1; /* APP_IO_PULLUP */ + + pin_rx_type = 0; /* APP_IO_TYPE_NORMAL */ + pin_rx_pin = 11; /* APP_IO_PIN_11 */ + pin_rx_mux = 2; /* APP_IO_MUX_2 */ + pin_rx_pull = 1; /* APP_IO_PULLUP */ + + use_mode_type = 0; /* APP_UART_TYPE_INTERRUPT */ + use_mode_tx_dma_ch = 0; /* DMA_Channel0 */ + use_mode_rx_dma_ch = 1; /* DMA_Channel1 */ + + rx_timeout_mode = 1; /* UART_RECEIVER_TIMEOUT_ENABLE */ + } + } +} \ No newline at end of file diff --git a/hcs/hdf.hcs b/hcs/hdf.hcs new file mode 100755 index 0000000..6fdf216 --- /dev/null +++ b/hcs/hdf.hcs @@ -0,0 +1,3 @@ +#include "device_info.hcs" +#include "gpio.hcs" +#include "uart.hcs" \ No newline at end of file diff --git a/hcs/uart.hcs b/hcs/uart.hcs new file mode 100755 index 0000000..012cc62 --- /dev/null +++ b/hcs/uart.hcs @@ -0,0 +1,36 @@ +root { + platform { + template uart_controller { + match_attr = ""; + id = 0; + baudrate = 115200; + + pin_tx_type = 0; + pin_tx_pin = 0; + pin_tx_mux = 0; + pin_tx_pull = 0; + + pin_rx_type = 0; + pin_rx_pin = 0; + pin_rx_mux = 0; + pin_rx_pull = 0; + + use_mode_type = 0; + use_mode_tx_dma_ch = 0; + use_mode_rx_dma_ch = 0; + + rx_timeout_mode = 1; + } + controller_uart0 :: uart_controller { + match_attr = "asr582x_uart_0"; + port = 0; /* UART_ID_0 */ + + pin_tx_pin = 0; /* IO_PIN_10 */ + pin_tx_mux = 25; /* IO_MUX_2 */ + + pin_rx_pin = 1; /* IO_PIN_11 */ + pin_rx_mux = 25; /* IO_MUX_2 */ + tx_rx = 3; /* TX_RX MODE */ + } + } +} \ No newline at end of file diff --git a/image/外观功能图.png b/image/外观功能图.png old mode 100644 new mode 100755 diff --git a/image/外观尺寸图.png b/image/外观尺寸图.png old mode 100644 new mode 100755 diff --git a/image/烧录模式.png b/image/烧录模式.png old mode 100644 new mode 100755