diff --git a/FOC_10000rpm/.keep b/FOC_10000rpm/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/FOC_10000rpm/testaa_202410212250.rar b/FOC_10000rpm/testaa_202410212250.rar new file mode 100644 index 0000000000000000000000000000000000000000..16f43fb1fcea13823a13689975d8afede087319a Binary files /dev/null and b/FOC_10000rpm/testaa_202410212250.rar differ diff --git a/vendor/smart_bldc_Ultrasonic.rar b/vendor/smart_bldc_Ultrasonic.rar new file mode 100644 index 0000000000000000000000000000000000000000..1849746a1d3c8d3fcb40ae621cba687ed9f04838 Binary files /dev/null and b/vendor/smart_bldc_Ultrasonic.rar differ diff --git a/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/feature.h b/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/feature.h deleted file mode 100644 index a1f9eb276a05eee970c2b38cac5d189c83d50342..0000000000000000000000000000000000000000 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/feature.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @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 feature.h - * @author MCU Driver Team - * @brief This file contains macro configurations related to the project. This file is generated by the IDE tool. - */ - -#ifndef McuMagicTag_FEATURE_H -#define McuMagicTag_FEATURE_H - -/* Macro definitions --------------------------------------------------------- */ -#define CHIP_3061MNPICA MACRO_ENABLE - -#define MACRO_ENABLE 1 -#define MACRO_DISABLE 0 - -/* Macro switch */ -#define BASE_DEFINE_USE_ASSERT MACRO_ENABLE -#ifndef FLASH_CRC_CONFIG -#define FLASH_CRC_CONFIG -#endif /* #ifndef FLASH_CRC_CONFIG */ -#define BASE_MATH_SINCOS_MIDDLE_TABLE MACRO_ENABLE /**< This macro is used to control the table type when the - BASE_MATH_GetSinCos() queries the table. When the value of - this macro is MACRO_ENABLE, the error value obtained by the - BASE_MATH_GetSinCos() is relatively small, and the return - value of the function may be greater than or less than the - actual value. When the value of this macro is MACRO_DISABLE, - the error value obtained by the BASE_MATH_GetSinCos() is - relatively large. However, in the range [0°, 180°) and - [180°, 360°), the return value of the function is either - greater than or less than the actual value. */ - -/* Peripheral module macro switch--------------------------------------------- */ -#define BOARD_DIM_NUM 1 /**< Number of dimming handle arrays. */ - -#define BOARD_KEY_NUM 10 /**< Number of key handle arrays. */ -#define BOARD_KEY_PRESS_ON GPIO_HIGH_LEVEL /**< GPIO status corresponding to long press valid. */ -#define BOARD_KEY_PRESS_OFF GPIO_LOW_LEVEL /**< GPIO status corresponding to short press valid. */ - -#define BOARD_LED_SEG_NUM 4 /**< Number of segments. */ -#define BOARD_LED_SEGMENT_ON GPIO_HIGH_LEVEL /**< GPIO level status corresponding to valid segments. */ -#define BOARD_LED_SEGMENT_OFF GPIO_LOW_LEVEL /**< GPIO level status corresponding to invalid segments. */ - -#define BOARD_MKEY_SCHEME_NUMBER BOARD_MKEY_SCHEME_NUMBER_ONE /**< Define the scheme to be adopted. */ -#define BOARD_MKEY_OUT_NUM 4 /**< Number of GPIO pins used as output during scanning. */ -#define BOARD_MKEY_IN_NUM 4 /**< Number of GPIO pins used as input during scanning. */ -#define BOARD_MKEY_OUT_PIN_VALID GPIO_LOW_LEVEL /**< GPIO level status corresponding to the valid \ - status of the output GPIO in the key matrix. */ -#define BOARD_MKEY_OUT_PIN_INVALID GPIO_HIGH_LEVEL /**< GPIO level status corresponding to the \ - invalid status of the output GPIO in the key matrix. */ -#define BOARD_MKEY_IN_PIN_VALID GPIO_LOW_LEVEL /**< Indicates the GPIO level corresponding to the \ - valid status of the input GPIO in the key matrix. */ -#define BOARD_MKEY_IN_PIN_INVALID GPIO_HIGH_LEVEL /**< Indicates the GPIO level corresponding to the \ - invalid status of the input GPIO in the key matrix. */ - -#define BOARD_PULSES_NUM 2 /**< Number of pulse handles. */ - -#define BASE_DEFINE_SLIPAVERAGE_NUM 2 /**< Sliding average array length. */ - -#define LISTNODE_MAX 20 - -#define BASE_DEFINE_DMA_QUICKSTART - -#define XTRAIL_FREQ 30000000U - -#define DBG_USE_NO_PRINTF 0U -#define DBG_USE_UART_PRINTF 1U - -#define DBG_PRINTF_USE DBG_USE_UART_PRINTF -#if (DBG_PRINTF_USE == DBG_USE_UART_PRINTF) -#define DBG_PRINTF_UART_PORT UART0 -#endif - -/* USER CODE BEGIN 0 */ -/* USER CODE 区域内代码不会被覆盖,区域外会被生成的默认代码覆盖(其余USER CODE 区域同理) */ -/* USER CODE END 0 */ - -#endif /* McuMagicTag_FEATURE_H */ \ No newline at end of file diff --git a/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/main.h b/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/main.h deleted file mode 100644 index c77e0f2ece54dd83d99b719c2dccffc08d908aeb..0000000000000000000000000000000000000000 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/main.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @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 main.h - * @author MCU Driver Team - * @brief This file contains driver init functions. - */ - -/* Define to prevent recursive inclusion ------------------------------------- */ -#ifndef McuMagicTag_SYSTEM_INIT_H -#define McuMagicTag_SYSTEM_INIT_H - -#include "uart.h" -#include "uart_ex.h" -#include "gpio.h" -#include "crg.h" -#include "iocmg.h" - -#define IO_SPEED_FAST 0x00U -#define IO_SPEED_SLOW 0x01U - -#define IO_DRV_LEVEL4 0x00U -#define IO_DRV_LEVEL3 0x01U -#define IO_DRV_LEVEL2 0x02U -#define IO_DRV_LEVEL1 0x03U - -#define XTAL_DRV_LEVEL4 0x03U -#define XTAL_DRV_LEVEL3 0x02U -#define XTAL_DRV_LEVEL2 0x01U -#define XTAL_DRV_LEVEL1 0x00U - -extern UART_Handle g_uart0; - -extern GPIO_Handle g_gpio2; - -BASE_StatusType CRG_Config(CRG_CoreClkSelect *coreClkSelect); -void SystemInit(void); - -void GPIO_CallBackFunc(void *param); - -/* USER CODE BEGIN 0 */ -/* USER CODE 区域内代码不会被覆盖,区域外会被生成的默认代码覆盖(其余USER CODE 区域同理) */ -/* USER CODE END 0 */ - -#endif /* McuMagicTag_SYSTEM_INIT_H */ \ No newline at end of file diff --git a/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/system_init.c b/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/system_init.c deleted file mode 100644 index 24a14c9c158800a66611c267cc0c417694a461fc..0000000000000000000000000000000000000000 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/generatecode/system_init.c +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @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 system_init.c - * @author MCU Driver Team - * @brief This file contains driver init functions. - */ - -#include "main.h" -#include "ioconfig.h" -#include "iocmg_ip.h" - -#define UART0_BAND_RATE 115200 - -BASE_StatusType CRG_Config(CRG_CoreClkSelect *coreClkSelect) -{ - CRG_Handle crg; - crg.baseAddress = CRG; - crg.pllRefClkSelect = CRG_PLL_REF_CLK_SELECT_HOSC; - crg.pllPreDiv = CRG_PLL_PREDIV_4; - crg.pllFbDiv = 48; /* PLL Multiplier 48 */ - crg.pllPostDiv = CRG_PLL_POSTDIV_2; - crg.coreClkSelect = CRG_CORE_CLK_SELECT_PLL; - crg.handleEx.pllPostDiv2 = CRG_PLL_POSTDIV2_3; - crg.handleEx.clk1MSelect = CRG_1M_CLK_SELECT_HOSC; - crg.handleEx.clk1MDiv = (25 - 1); /* The 1 MHz freq is equal to the input clock frequency / (clk_1m_div + 1). 25 is the div of the clk_1m in CLOCK. */ - - if (HAL_CRG_Init(&crg) != BASE_STATUS_OK) { - return BASE_STATUS_ERROR; - } - *coreClkSelect = crg.coreClkSelect; - return BASE_STATUS_OK; -} - -__weak void GPIO_CallBackFunc(void *param) -{ - GPIO_Handle *handle = (GPIO_Handle *)param; - BASE_FUNC_UNUSED(handle); -} - -static void GPIO_Init(void) -{ - HAL_CRG_IpEnableSet(GPIO2_BASE, IP_CLK_ENABLE); - g_gpio2.baseAddress = GPIO2; - - g_gpio2.pins = GPIO_PIN_4; - HAL_GPIO_Init(&g_gpio2); - HAL_GPIO_SetDirection(&g_gpio2, g_gpio2.pins, GPIO_INPUT_MODE); - HAL_GPIO_SetValue(&g_gpio2, g_gpio2.pins, GPIO_LOW_LEVEL); - HAL_GPIO_SetIrqType(&g_gpio2, g_gpio2.pins, GPIO_INT_TYPE_RISE_EDGE); - - HAL_GPIO_RegisterCallBack(&g_gpio2, GPIO_PIN_4, GPIO_CallBackFunc); - IRQ_Register(IRQ_GPIO2, HAL_GPIO_IrqHandler, &g_gpio2); - IRQ_SetPriority(IRQ_GPIO2, 1); /* set gpio1 interrupt priority to 1, 1~15. 1 is priority value */ - IRQ_EnableN(IRQ_GPIO2); /* gpio interrupt enable */ - - return; -} - -static void UART0_Init(void) -{ - HAL_CRG_IpEnableSet(UART0_BASE, IP_CLK_ENABLE); /* UART0 clock enable. */ - g_uart0.baseAddress = UART0; - - g_uart0.baudRate = UART0_BAND_RATE; - g_uart0.dataLength = UART_DATALENGTH_8BIT; - g_uart0.stopBits = UART_STOPBITS_ONE; - g_uart0.parity = UART_PARITY_NONE; - g_uart0.txMode = UART_MODE_BLOCKING; - g_uart0.rxMode = UART_MODE_BLOCKING; - g_uart0.fifoMode = BASE_CFG_ENABLE; - g_uart0.fifoTxThr = UART_FIFODEPTH_SIZE8; - g_uart0.fifoRxThr = UART_FIFODEPTH_SIZE8; - g_uart0.hwFlowCtr = BASE_CFG_DISABLE; - g_uart0.handleEx.overSampleMultiple = UART_OVERSAMPLING_16X; - g_uart0.handleEx.msbFirst = BASE_CFG_DISABLE; - HAL_UART_Init(&g_uart0); -} - -static void IOConfig(void) -{ - /* Config PIN21 */ - HAL_IOCMG_SetPinAltFuncMode(GPIO2_4_AS_GPIO2_4); /* Check function selection */ - HAL_IOCMG_SetPinPullMode(GPIO2_4_AS_GPIO2_4, PULL_NONE); /* Pull-up and Pull-down */ - HAL_IOCMG_SetPinSchmidtMode(GPIO2_4_AS_GPIO2_4, SCHMIDT_DISABLE); /* Schmitt input on/off */ - HAL_IOCMG_SetPinLevelShiftRate(GPIO2_4_AS_GPIO2_4, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ - HAL_IOCMG_SetPinDriveRate(GPIO2_4_AS_GPIO2_4, DRIVER_RATE_2); /* Output signal edge fast/slow */ - /* Config PIN39 */ - HAL_IOCMG_SetPinAltFuncMode(GPIO0_3_AS_UART0_TXD); /* Check function selection */ - HAL_IOCMG_SetPinPullMode(GPIO0_3_AS_UART0_TXD, PULL_NONE); /* Pull-up and Pull-down */ - HAL_IOCMG_SetPinSchmidtMode(GPIO0_3_AS_UART0_TXD, SCHMIDT_DISABLE); /* Schmitt input on/off */ - HAL_IOCMG_SetPinLevelShiftRate(GPIO0_3_AS_UART0_TXD, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ - HAL_IOCMG_SetPinDriveRate(GPIO0_3_AS_UART0_TXD, DRIVER_RATE_2); /* Output signal edge fast/slow */ - /* Config PIN40 */ - HAL_IOCMG_SetPinAltFuncMode(GPIO0_4_AS_UART0_RXD); /* Check function selection */ - HAL_IOCMG_SetPinPullMode(GPIO0_4_AS_UART0_RXD, PULL_UP); /* Pull-up and Pull-down, UART RX recommend PULL_UP */ - HAL_IOCMG_SetPinSchmidtMode(GPIO0_4_AS_UART0_RXD, SCHMIDT_DISABLE); /* Schmitt input on/off */ - HAL_IOCMG_SetPinLevelShiftRate(GPIO0_4_AS_UART0_RXD, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ - HAL_IOCMG_SetPinDriveRate(GPIO0_4_AS_UART0_RXD, DRIVER_RATE_2); /* Output signal edge fast/slow */ -} - -void SystemInit(void) -{ - IOConfig(); - UART0_Init(); - GPIO_Init(); - - /* USER CODE BEGIN system_init */ - /* USER CODE END system_init */ -} \ No newline at end of file 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 deleted file mode 100644 index 83fc35d9c5af63bfa3c3f3d20e59a10d8f819ab0..0000000000000000000000000000000000000000 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.c +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @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 deleted file mode 100644 index 17ff5146931f2a3e009ca4ae8363316a4d240653..0000000000000000000000000000000000000000 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/gpio_key_sample.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @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/main.c b/vendor/yibaina_3061M/demo/sample_gpio_key/main.c deleted file mode 100644 index 10f82fbe10df696360782732d64fa1acb993e5a2..0000000000000000000000000000000000000000 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/main.c +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @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 main.c - * @author MCU Driver Team - * @brief Main program body. - */ - -#include "typedefs.h" -#include "feature.h" -#include "gpio_key_sample.h" -#include "main.h" -/* USER CODE BEGIN 0 */ -/* USER CODE 区域内代码不会被覆盖,区域外会被生成的默认代码覆盖(其余USER CODE 区域同理) */ -/* 建议用户放置头文件 */ -/* USER CODE END 0 */ -UART_Handle g_uart0; -GPIO_Handle g_gpio2; -/* USER CODE BEGIN 1 */ -/* 建议用户定义全局变量、结构体、宏定义或函数声明等 */ -/* USER CODE END 1 */ - -int main(void) -{ - /* USER CODE BEGIN 2 */ - /* 建议用户放置初始化代码或启动代码等 */ - /* USER CODE END 2 */ - GPIO_KeySample(); - /* USER CODE BEGIN 3 */ - /* 建议用户放置初始配置代码 */ - /* USER CODE END 3 */ - while (1) { - /* USER CODE BEGIN 4 */ - /* 建议用户放置周期性执行代码 */ - /* USER CODE END 4 */ - } - /* USER CODE BEGIN 5 */ - /* 建议用户放置代码流程 */ - /* USER CODE END 5 */ - return BASE_STATUS_OK; -} - -/* USER CODE BEGIN 6 */ -/* 建议用户放置自定义函数 */ -/* USER CODE END 6 */ \ 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 deleted file mode 100644 index fb6ae9362f7aa6348ad188aae099a3671f0333bc..0000000000000000000000000000000000000000 --- a/vendor/yibaina_3061M/demo/sample_gpio_key/readme.md +++ /dev/null @@ -1,78 +0,0 @@ -# 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 diff --git "a/vendor/\347\250\213\345\272\217\350\257\264\346\230\216.txt" "b/vendor/\347\250\213\345\272\217\350\257\264\346\230\216.txt" new file mode 100644 index 0000000000000000000000000000000000000000..4b33098ab27c06039b55a2ea42a55207319856f0 --- /dev/null +++ "b/vendor/\347\250\213\345\272\217\350\257\264\346\230\216.txt" @@ -0,0 +1,3 @@ +在智能风扇的设计中,我们采用华为海思 HI3061M 芯片作为核心控制单元,结合超声波模块 US - 100 实现智能测距调速功能。 +其中,超声波模块的输出发送引脚连接至芯片的 12 引脚,接收引脚连接至 13 引脚。以芯片的定时器 0 作为时间基准,将其设置为 10us 延时来满足测距需求。在工作过程中,系统依据超声波的往返时间准确测量风扇与目标物体之间的距离。随后,通过线性计算方式,将所测得的距离信号精准地转化为目标转速。 +并且,借助 BLDC 电机的 PID 闭环算法,根据目标转速对电机进行实时、精确的调控,从而实现风扇转速随距离智能变化的功能,为用户打造更加智能、舒适的使用体验。这种设计融合了先进的硬件和算法,充分展现了智能控制在风扇应用中的优势。 \ No newline at end of file diff --git "a/vendor/\350\207\252\345\212\250\345\217\257\350\260\203\351\243\216\346\211\207-1.docx" "b/vendor/\350\207\252\345\212\250\345\217\257\350\260\203\351\243\216\346\211\207-1.docx" new file mode 100644 index 0000000000000000000000000000000000000000..a7d6a7d39379fd9b5743d71340df6112f762b7b9 Binary files /dev/null and "b/vendor/\350\207\252\345\212\250\345\217\257\350\260\203\351\243\216\346\211\207-1.docx" differ