diff --git a/README.md b/README.md index 7a39b4b1658a1e4657ef571588500eeadb46095e..b205e38ea7e3dc66a097495519f9d467a284f1f5 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,17 @@ ## 购买渠道 -| 名称 | 硬件资料 | 介绍 | -| :------------: | ------------------------------------------------------------ | ------------------------------- | -| V5A20002NOOJDB | [购买链接](https://www.ickey.cn/detail/1003001016603884/V5A20002NOOJDB.html#3a190c21-a8e5-40b7-8e88-b7a4b6a9d0b1) | 3061M系列解决方案 128KB QFN48 | -| V5A20002NOOJLB | [购买链接](https://www.ickey.cn/detail/1003001016603886/V5A20002NOOJLB.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 3061M系列解决方案 128KB QFN32 | -| V5A20002NOQJLB | [购买链接](https://www.ickey.cn/detail/1003001016603885/V5A20002NOQJLB.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 3061M系列解决方案 128KB QFP32 | -| V5A20002NOOJDB | [购买链接](https://www.ickey.cn/detail/1003001016603884/V5A20002NOOJDB.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 3061M系列解决方案 128KB QFN48 | -| V5A20002NOOJD9 | [购买链接](https://www.ickey.cn/detail/1003001016603888/V5A20002NOOJD9.html#d9fd2c53-3b07-4b62-ba26-cb59ae94234f) | 3061M系列解决方案 64KB QFN48 | -| V5A20002NOQJD9 | [购买链接](https://www.ickey.cn/detail/1003001016603887/V5A20002NOQJD9.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 3061M系列解决方案 64KB QFP48 | -| V5A20002NOQJL9 | [购买链接](https://www.ickey.cn/detail/1003001016603889/V5A20002NOQJL9.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 3061M系列解决方案 64KB QFP32 | -| V5A20002NOOJL9 | [购买链接](https://www.ickey.cn/detail/1003001016603890/V5A20002NOOJL9.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 3061M系列解决方案 64KB QFN32 | -| V5A20001ISQJSA | [购买链接](https://www.ickey.cn/detail/1003001016603882/V5A20001ISQJSA.html#) | 3065H系列解决方案 160KB LQFP64 | +| 名称 | 批量购买 | 少量购买 | 介绍 | +| :------------: | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------- | +| V5A20002NOQJDB | [购买链接](https://search.ickey.cn/?keyword=V5A20002NOQJDB&bom_ab=null) | 暂无 | 3061M系列解决方案 128KB QFP48 | +| V5A20002NOOJLB | [购买链接](https://www.ickey.cn/detail/1003001016603886/V5A20002NOOJLB.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | [购买链接](https://www.ickey.cn/detail/1003001021937018/V5A20002NOOJLB.html#a48f53a5-b3cf-4d3e-8254-e91505f16fae) | 3061M系列解决方案 128KB QFN32 | +| V5A20002NOQJLB | [购买链接](https://www.ickey.cn/detail/1003001016603885/V5A20002NOQJLB.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | [购买链接](https://www.ickey.cn/detail/1003001017510002/V5A20002NOQJLB.html#a48f53a5-b3cf-4d3e-8254-e91505f16fae) | 3061M系列解决方案 128KB QFP32 | +| V5A20002NOOJDB | [购买链接](https://www.ickey.cn/detail/1003001016603884/V5A20002NOOJDB.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 暂无 | 3061M系列解决方案 128KB QFN48 | +| V5A20002NOOJD9 | [购买链接](https://www.ickey.cn/detail/1003001016603888/V5A20002NOOJD9.html#d9fd2c53-3b07-4b62-ba26-cb59ae94234f) | [购买链接](https://www.ickey.cn/detail/1003001021937055/V5A20002NOOJD9.html#a48f53a5-b3cf-4d3e-8254-e91505f16fae) | 3061M系列解决方案 64KB QFN48 | +| V5A20002NOQJD9 | [购买链接](https://www.ickey.cn/detail/1003001016603887/V5A20002NOQJD9.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | 暂无 | 3061M系列解决方案 64KB QFP48 | +| V5A20002NOQJL9 | [购买链接](https://www.ickey.cn/detail/1003001016603889/V5A20002NOQJL9.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | [购买链接](https://www.ickey.cn/detail/1003001021936978/V5A20002NOQJL9.html#a48f53a5-b3cf-4d3e-8254-e91505f16fae) | 3061M系列解决方案 64KB QFP32 | +| V5A20002NOOJL9 | [购买链接](https://www.ickey.cn/detail/1003001016603890/V5A20002NOOJL9.html#208f8e9e-5cdf-4353-988d-d1df20bbb33f) | [购买链接](https://www.ickey.cn/detail/1003001021936989/V5A20002NOOJL9.html#a48f53a5-b3cf-4d3e-8254-e91505f16fae) | 3061M系列解决方案 64KB QFN32 | +| V5A20001ISQJSA | [购买链接](https://www.ickey.cn/detail/1003001016603882/V5A20001ISQJSA.html#) | 暂无 | 3065H系列解决方案 160KB LQFP64 | diff --git a/src/build/__pycache__/build_gn.cpython-311.pyc b/src/build/__pycache__/build_gn.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2a2761df3449c4512bab935abfd350a208cf895 Binary files /dev/null and b/src/build/__pycache__/build_gn.cpython-311.pyc differ diff --git a/src/build/createxml/__pycache__/mk_prim_xml_step1.cpython-311.pyc b/src/build/createxml/__pycache__/mk_prim_xml_step1.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eef27fd932c3ec83f002ad4261497155b4b2b06c Binary files /dev/null and b/src/build/createxml/__pycache__/mk_prim_xml_step1.cpython-311.pyc differ diff --git a/src/build/createxml/__pycache__/mk_prim_xml_step2.cpython-311.pyc b/src/build/createxml/__pycache__/mk_prim_xml_step2.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6790c1102ab360dc9b3bd9cc775ab13101761dd Binary files /dev/null and b/src/build/createxml/__pycache__/mk_prim_xml_step2.cpython-311.pyc differ diff --git a/src/build/out/build.log b/src/build/out/build.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.c b/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.c index 83fc35d9c5af63bfa3c3f3d20e59a10d8f819ab0..6ec5c721cb51ed609b4e1d4c7aceb547175fc950 100644 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.c +++ b/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.c @@ -1,65 +1,65 @@ -/** - * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. - * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the - * following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * @file gpio_key_sample.c - * @author MCU Driver Team - * @brief GPIO module realize a key function sample - * @details GPIO Capturing Key Triggered Interrupt Service Function. If the hardware environment does \ - * not support this function, you need to set up an environment for verification. - */ - -/* Includes ------------------------------------------------------------------*/ -#include "debug.h" -#include "gpio.h" -#include "main.h" -#include "gpio_key_sample.h" - -#define PREVENT_SWIPE_SCREEN_TIME 50 -#define CYCLE_INTERVAL_TIME 500 - -/* prototype functions -------------------------------------------------------*/ -void GPIO_CallBackFunc(void *param); - -/* ---------------------------------- Sample Parameters ---------------------- */ -/** - * @brief GPIO key test sample. - * @param None - * @retval Value of @ref BASE_StatusType. - */ -BASE_StatusType GPIO_KeySample(void) -{ - SystemInit(); - /* Waiting for the key to come. */ - while (1) { - DBG_PRINTF("Wait key \r\n"); - BASE_FUNC_DELAY_MS(CYCLE_INTERVAL_TIME); - } - - return BASE_STATUS_OK; -} - -/** - * @brief GPIO register interrupt callback function. - * @param param Value of @ref GPIO_Handle. - * @retval None - */ -void GPIO_CallBackFunc(void *param) -{ - BASE_FUNC_UNUSED(param); - DBG_PRINTF("in GPIO Key Handler \r\n"); - BASE_FUNC_DELAY_MS(PREVENT_SWIPE_SCREEN_TIME); +/** + * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @file gpio_key_sample.c + * @author MCU Driver Team + * @brief GPIO module realize a key function sample + * @details GPIO Capturing Key Triggered Interrupt Service Function. If the hardware environment does \ + * not support this function, you need to set up an environment for verification. + */ + +/* Includes ------------------------------------------------------------------*/ +#include "debug.h" +#include "gpio.h" +#include "main.h" +#include "gpio_key_sample.h" + +#define PREVENT_SWIPE_SCREEN_TIME 50 +#define CYCLE_INTERVAL_TIME 500 + +/* prototype functions -------------------------------------------------------*/ +void GPIO_CallBackFunc(void *param); + +/* ---------------------------------- Sample Parameters ---------------------- */ +/** + * @brief GPIO key test sample. + * @param None + * @retval Value of @ref BASE_StatusType. + */ +BASE_StatusType GPIO_KeySample(void) +{ + SystemInit(); + /* Waiting for the key to come. */ + while (1) { + DBG_PRINTF("Wait key \r\n"); + BASE_FUNC_DELAY_MS(CYCLE_INTERVAL_TIME); + } + + return BASE_STATUS_OK; +} + +/** + * @brief GPIO register interrupt callback function. + * @param param Value of @ref GPIO_Handle. + * @retval None + */ +void GPIO_CallBackFunc(void *param) +{ + BASE_FUNC_UNUSED(param); + DBG_PRINTF("in GPIO Key Handler \r\n"); + BASE_FUNC_DELAY_MS(PREVENT_SWIPE_SCREEN_TIME); } \ No newline at end of file diff --git a/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.h b/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.h index 17ff5146931f2a3e009ca4ae8363316a4d240653..e490c9de98fea22505d6e7c3d81031aa2537b812 100644 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.h +++ b/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.h @@ -1,30 +1,30 @@ -/** - * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. - * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the - * following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * @file gpio_key_sample.h - * @author MCU Driver Team - * @brief GPIO module sample - * @details This file provides sample code for users to help use - * the trigger an interrupt based on the key connected to the GPIO. - */ - -#ifndef GPIO_KEY_SAMPLE_H -#define GPIO_KEY_SAMPLE_H - -BASE_StatusType GPIO_KeySample(void); - +/** + * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @file gpio_key_sample.h + * @author MCU Driver Team + * @brief GPIO module sample + * @details This file provides sample code for users to help use + * the trigger an interrupt based on the key connected to the GPIO. + */ + +#ifndef GPIO_KEY_SAMPLE_H +#define GPIO_KEY_SAMPLE_H + +BASE_StatusType GPIO_KeySample(void); + #endif /* GPIO_KEY_SAMPLE_H */ \ No newline at end of file diff --git a/vendor/yibaina_3061M/demo/sample_gpio_key/readme.md b/vendor/yibaina_3061M/demo/sample_gpio_key/readme.md index fb6ae9362f7aa6348ad188aae099a3671f0333bc..839d223087d2fb694942d2e1e14fca6f5ef9d27e 100644 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/readme.md +++ b/vendor/yibaina_3061M/demo/sample_gpio_key/readme.md @@ -1,78 +1,78 @@ -# sample_gpio_key - -## 1.1 介绍 - -**功能介绍:** 基于HAL接口完成时钟、GPIO控制器初始化和功能配置。在示例代码中通过中断的方式实现对S2按键的检测。 - -**软件概述:** 使用中断方式实现按键功能。 - -**硬件概述:** 核心板。通过板端丝印可以看出S2按键的GPIO对应GPIO2_4。硬件搭建要求如图所示: - - - -![image-20240829165616356](../../../../docs/pic/tools/image-20240829165616356.png) - -## 1.2 约束与限制 - -### 1.2.1 支持应用运行的芯片和开发板 - - 本示例支持开发板:3061M - -### 1.2.2 支持API版本、SDK版本 - - 本示例支持版本号:SolarA2_1.0.1.2 - -### 1.2.3 支持IDE版本 - - 本示例支持IDE版本号:1.0.0.6; - -## 1.3 效果预览 - - 当用户烧录编译后的示例代码后,初始化和配置完成后,示例代码中在按键没有按下时Debug串口会一直打印等待按键的log信息,当连接的按键按下时功能正常时Debug串口打印成功log信息;功能异常时按下按键时Debug串口还是会一直打印等待按键的log信息。 - -![image-20240829172606786](../../../../docs/pic/sample_gpio_key/image-20240829172606786.png) - -## 1.4 接口介绍 - -#### 1.4.1 HAL_GPIO_Init() - -| **定义:** | void HAL_GPIO_Init(GPIO_Handle *handle); | -| ------------ | ----------------------------------------- | -| **功能:** | 初始化GPIO寄存器值 | -| **参数:** | handle:GPIO_Handle的值 | -| **返回值:** | None | -| **依赖:** | drivers\gpio\common\inc\gpio.h | - -## 1.5 具体实现 - - 步骤一:GPIO管脚选择:示例代码中选择GPIO管脚用于通过中断方式进行按键检测。也可以选择其他GPIO管脚用于按键检测功能测试,在"GPIO_Init()"接口中的"g_gpiox.baseAddress"可以配置其它GPIOX,g_gpiox.pins可以配置“GPIO_PIN_0-GPIO_PIN_7”中的任意一个。 - - 步骤二:GPIO管脚初始化:调用接口"HAL_GPIO_Init()”完成对示例代码中GPIO管脚的方向、电平、中断模式配置。 - -## 1.6 实验流程 - -- 步骤一:在xxx\vendor\yibaina_3061M\demo\sample_gpio_key/文件夹里面内容复制替换到xxx/user/目录下。 - - ![image-20240829174750105](../../../../docs/pic/sample_gpio_key/image-20240829174750105.png) - - -- 步骤二:点击编译按钮![image-20240528173107958](../../../../docs/pic/sample_gpio_key/image-20240528173107958-17249242848691.png),编译成功后终端窗口输出如下图所示。 - ![image-20240624165330284](../../../../docs/pic/tools/image-20240624165330284.png) - - - -- 步骤三:进入工程配置界面。打开要烧录的工程后,单击顶部![image-20240624154427635](../../../../docs/pic/sample_gpio_key/image-20240624154427635-17249243742892.png)的图标,进入工程配置界面->进入程序加载。选择传输方式为“swd”,并配置其他参数。(具体[参考tools目录README搭建环境](https://gitee.com/HiSpark/open_mcu/tree/master/tools)) - - ![image-20240829174913995](../../../../docs/pic/sample_gpio_key/image-20240829174913995.png) - -- 步骤四:单击“烧录”![image-20240624162016190](../../../../docs/pic/tools/image-20240624162016190.png) 按钮,开始烧录。烧录成功后终端窗口输出如下图所示。 - - ![image-20240624162037834](../../../../docs/pic/sample_gpio_key/image-20240624162037834-17249245112874.png) - -* 步骤五 : 当用户烧录编译后的示例代码后,初始化和配置完成后,示例代码中在按键没有按下时Debug串口会一直打印等待按键的log信息,当连接的按键按下时功能正常时Debug串口打印成功log信息;功能异常时按下按键时Debug串口还是会一直打印等待按键的log信息。 - - ![image-20240829172606786](../../../../docs/pic/sample_gpio_key/image-20240829172606786.png) - - - +# sample_gpio_key + +## 1.1 介绍 + +**功能介绍:** 基于HAL接口完成时钟、GPIO控制器初始化和功能配置。在示例代码中通过中断的方式实现对S2按键的检测。 + +**软件概述:** 使用中断方式实现按键功能。 + +**硬件概述:** 核心板。通过板端丝印可以看出S2按键的GPIO对应GPIO2_4。硬件搭建要求如图所示: + + + +![image-20240829165616356](../../../../docs/pic/tools/image-20240829165616356.png) + +## 1.2 约束与限制 + +### 1.2.1 支持应用运行的芯片和开发板 + + 本示例支持开发板:3061M + +### 1.2.2 支持API版本、SDK版本 + + 本示例支持版本号:SolarA2_1.0.1.2 + +### 1.2.3 支持IDE版本 + + 本示例支持IDE版本号:1.0.0.6; + +## 1.3 效果预览 + + 当用户烧录编译后的示例代码后,初始化和配置完成后,示例代码中在按键没有按下时Debug串口会一直打印等待按键的log信息,当连接的按键按下时功能正常时Debug串口打印成功log信息;功能异常时按下按键时Debug串口还是会一直打印等待按键的log信息。 + +![image-20240829172606786](../../../../docs/pic/sample_gpio_key/image-20240829172606786.png) + +## 1.4 接口介绍 + +#### 1.4.1 HAL_GPIO_Init() + +| **定义:** | void HAL_GPIO_Init(GPIO_Handle *handle); | +| ------------ | ----------------------------------------- | +| **功能:** | 初始化GPIO寄存器值 | +| **参数:** | handle:GPIO_Handle的值 | +| **返回值:** | None | +| **依赖:** | drivers\gpio\common\inc\gpio.h | + +## 1.5 具体实现 + + 步骤一:GPIO管脚选择:示例代码中选择GPIO管脚用于通过中断方式进行按键检测。也可以选择其他GPIO管脚用于按键检测功能测试,在"GPIO_Init()"接口中的"g_gpiox.baseAddress"可以配置其它GPIOX,g_gpiox.pins可以配置“GPIO_PIN_0-GPIO_PIN_7”中的任意一个。 + + 步骤二:GPIO管脚初始化:调用接口"HAL_GPIO_Init()”完成对示例代码中GPIO管脚的方向、电平、中断模式配置。 + +## 1.6 实验流程 + +- 步骤一:在xxx\vendor\yibaina_3061M\demo\sample_gpio_key/文件夹里面内容复制替换到xxx/user/目录下。 + + ![image-20240829174750105](../../../../docs/pic/sample_gpio_key/image-20240829174750105.png) + + +- 步骤二:点击编译按钮![image-20240528173107958](../../../../docs/pic/sample_gpio_key/image-20240528173107958-17249242848691.png),编译成功后终端窗口输出如下图所示。 + ![image-20240624165330284](../../../../docs/pic/tools/image-20240624165330284.png) + + + +- 步骤三:进入工程配置界面。打开要烧录的工程后,单击顶部![image-20240624154427635](../../../../docs/pic/sample_gpio_key/image-20240624154427635-17249243742892.png)的图标,进入工程配置界面->进入程序加载。选择传输方式为“swd”,并配置其他参数。(具体[参考tools目录README搭建环境](https://gitee.com/HiSpark/open_mcu/tree/master/tools)) + + ![image-20240829174913995](../../../../docs/pic/sample_gpio_key/image-20240829174913995.png) + +- 步骤四:单击“烧录”![image-20240624162016190](../../../../docs/pic/tools/image-20240624162016190.png) 按钮,开始烧录。烧录成功后终端窗口输出如下图所示。 + + ![image-20240624162037834](../../../../docs/pic/sample_gpio_key/image-20240624162037834-17249245112874.png) + +* 步骤五 : 当用户烧录编译后的示例代码后,初始化和配置完成后,示例代码中在按键没有按下时Debug串口会一直打印等待按键的log信息,当连接的按键按下时功能正常时Debug串口打印成功log信息;功能异常时按下按键时Debug串口还是会一直打印等待按键的log信息。 + + ![image-20240829172606786](../../../../docs/pic/sample_gpio_key/image-20240829172606786.png) + + + \ No newline at end of file