├── docs ├── index.md ├── 串口 │ └── figure │ │ ├── 001.jpg │ │ └── 002.jpg ├── 用户指南 │ └── figure │ │ ├── 001.jpg │ │ ├── 002.jpg │ │ ├── 003.jpg │ │ ├── 004.JPG │ │ ├── 005.JPG │ │ ├── 006.JPG │ │ ├── 007.JPG │ │ ├── 008.JPG │ │ ├── 009.jpg │ │ ├── 010.jpg │ │ ├── 011.jpg │ │ ├── 012.jpg │ │ ├── 013.jpg │ │ ├── 014.jpg │ │ ├── 015.jpg │ │ ├── 016.jpg │ │ ├── 017.jpg │ │ ├── 018.jpg │ │ ├── 019.jpg │ │ ├── 020.jpg │ │ └── 021.jpg ├── 电机 │ └── figure │ │ ├── 001.jpg │ │ ├── 002.jpg │ │ └── 002.png ├── 车体 │ ├── figure │ │ ├── 001.jpg │ │ └── 002.jpg │ └── car.md ├── 浮点运算单元 │ ├── figure │ │ ├── 001.jpg │ │ ├── 002.jpg │ │ ├── 003.jpg │ │ └── 004.jpg │ └── FPU.md └── update.md ├── demo └── STM32F407ZGT6_HAL_4WHEEL_MECANUM │ ├── .settings │ ├── org.eclipse.ltk.core.refactoring.prefs │ ├── com.st.stm32cube.ide.mcu.sfrview.prefs │ ├── stm32cubeide.project.prefs │ ├── org.eclipse.cdt.core.prefs │ └── language.settings.xml │ ├── Middlewares │ └── Third_Party │ │ └── FreeRTOS │ │ └── Source │ │ ├── CMSIS_RTOS │ │ ├── cmsis_os.c │ │ └── cmsis_os.h │ │ └── LICENSE │ ├── Drivers │ ├── CMSIS │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F4xx │ │ │ │ ├── LICENSE.txt │ │ │ │ └── Include │ │ │ │ └── system_stm32f4xx.h │ │ └── Include │ │ │ ├── cmsis_version.h │ │ │ └── tz_context.h │ └── STM32F4xx_HAL_Driver │ │ ├── LICENSE.txt │ │ └── Inc │ │ ├── stm32f4xx_hal_flash_ramfunc.h │ │ └── stm32f4xx_hal_dma_ex.h │ ├── CarOS │ ├── src │ │ ├── c_includes.h │ │ ├── peri_driver │ │ │ ├── peri_driver.h │ │ │ └── distance_measure_sensor │ │ │ │ └── laser_TF_Luna │ │ │ │ ├── c_tf_luna.h │ │ │ │ └── c_tf_luna.c │ │ ├── car │ │ │ ├── c_akerman.c │ │ │ ├── c_3wheel_omni.c │ │ │ ├── c_2wheel_balance.c │ │ │ ├── c_2wheel_differential.c │ │ │ ├── c_4wheel_omni.c │ │ │ ├── c_4wheel_differential.c │ │ │ ├── c_6wheel_mecanum.c │ │ │ ├── c_car.c │ │ │ ├── c_car.h │ │ │ ├── c_akerman.h │ │ │ ├── c_3wheel_omni.h │ │ │ ├── c_2wheel_balance.h │ │ │ ├── c_2wheel_differential.h │ │ │ ├── c_4wheel_omni.h │ │ │ ├── c_4wheel_differential.h │ │ │ └── c_6wheel_mecanum.h │ │ ├── c_types.h │ │ ├── memory │ │ │ └── c_memory.h │ │ ├── app │ │ │ ├── c_builtinapp.h │ │ │ ├── c_builtinapp.c │ │ │ ├── c_app.c │ │ │ └── c_app.h │ │ └── motor │ │ │ ├── DCmotor │ │ │ ├── driver │ │ │ │ ├── DCmotor_driver.h │ │ │ │ └── DCMotor_driver.c │ │ │ └── controller │ │ │ │ ├── c_controller.c │ │ │ │ └── c_controller.h │ │ │ └── encoder │ │ │ ├── c_encoder.h │ │ │ └── c_encoder.c │ └── cos.h │ ├── .project │ └── Core │ ├── Inc │ ├── gpio.h │ ├── dma.h │ ├── usart.h │ ├── tim.h │ ├── stm32f4xx_it.h │ └── arm_const_structs.h │ └── Src │ ├── dma.c │ ├── stm32f4xx_hal_msp.c │ ├── sysmem.c │ ├── gpio.c │ └── syscalls.c ├── src ├── c_includes.h ├── peri_driver │ ├── peri_driver.h │ └── distance_measure_sensor │ │ └── laser_TF_Luna │ │ ├── c_tf_luna.h │ │ └── c_tf_luna.c ├── car │ ├── c_akerman.c │ ├── c_3wheel_omni.c │ ├── c_2wheel_balance.c │ ├── c_2wheel_differential.c │ ├── c_4wheel_omni.c │ ├── c_4wheel_differential.c │ ├── c_6wheel_mecanum.c │ ├── c_car.c │ ├── c_car.h │ ├── c_akerman.h │ ├── c_3wheel_omni.h │ ├── c_2wheel_balance.h │ ├── c_2wheel_differential.h │ ├── c_4wheel_omni.h │ ├── c_4wheel_differential.h │ └── c_6wheel_mecanum.h ├── c_types.h ├── memory │ └── c_memory.h ├── app │ ├── c_builtinapp.h │ ├── c_builtinapp.c │ ├── c_app.c │ └── c_app.h └── motor │ ├── DCmotor │ ├── driver │ │ ├── DCmotor_driver.h │ │ └── DCMotor_driver.c │ └── controller │ │ ├── c_controller.c │ │ └── c_controller.h │ └── encoder │ ├── c_encoder.h │ └── c_encoder.c ├── cos.h └── README.md /docs/index.md: -------------------------------------------------------------------------------- 1 | # CarOS Documentation 2 | 3 | ## 写在前面 4 | 5 | ## 6 | -------------------------------------------------------------------------------- /docs/串口/figure/001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/串口/figure/001.jpg -------------------------------------------------------------------------------- /docs/串口/figure/002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/串口/figure/002.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/001.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/002.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/003.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/004.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/004.JPG -------------------------------------------------------------------------------- /docs/用户指南/figure/005.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/005.JPG -------------------------------------------------------------------------------- /docs/用户指南/figure/006.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/006.JPG -------------------------------------------------------------------------------- /docs/用户指南/figure/007.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/007.JPG -------------------------------------------------------------------------------- /docs/用户指南/figure/008.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/008.JPG -------------------------------------------------------------------------------- /docs/用户指南/figure/009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/009.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/010.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/011.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/012.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/013.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/014.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/015.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/016.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/017.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/018.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/019.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/020.jpg -------------------------------------------------------------------------------- /docs/用户指南/figure/021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/用户指南/figure/021.jpg -------------------------------------------------------------------------------- /docs/电机/figure/001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/电机/figure/001.jpg -------------------------------------------------------------------------------- /docs/电机/figure/002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/电机/figure/002.jpg -------------------------------------------------------------------------------- /docs/电机/figure/002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/电机/figure/002.png -------------------------------------------------------------------------------- /docs/车体/figure/001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/车体/figure/001.jpg -------------------------------------------------------------------------------- /docs/车体/figure/002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/车体/figure/002.jpg -------------------------------------------------------------------------------- /docs/浮点运算单元/figure/001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/浮点运算单元/figure/001.jpg -------------------------------------------------------------------------------- /docs/浮点运算单元/figure/002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/浮点运算单元/figure/002.jpg -------------------------------------------------------------------------------- /docs/浮点运算单元/figure/003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/浮点运算单元/figure/003.jpg -------------------------------------------------------------------------------- /docs/浮点运算单元/figure/004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/docs/浮点运算单元/figure/004.jpg -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 3 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | sfrviewstate={"fFavorites"\:{"fLists"\:{}},"fProperties"\:{"fNodeProperties"\:{}}} 3 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/.settings/stm32cubeide.project.prefs: -------------------------------------------------------------------------------- 1 | 8DF89ED150041C4CBC7CB9A9CAA90856=84C439DA3B66D84CAA3B358788706637 2 | DC22A860405A8BF2F2C095E5B6529F12=84C439DA3B66D84CAA3B358788706637 3 | eclipse.preferences.version=1 4 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pansamic/CarOS/HEAD/demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | doxygen/doxygen_new_line_after_brief=true 2 | doxygen/doxygen_use_brief_tag=false 3 | doxygen/doxygen_use_javadoc_tags=true 4 | doxygen/doxygen_use_pre_tag=false 5 | doxygen/doxygen_use_structural_commands=false 6 | eclipse.preferences.version=1 7 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Drivers/CMSIS/Device/ST/STM32F4xx/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the Apache-2.0 license shall apply. 5 | You may obtain a copy of the Apache-2.0 at: 6 | https://opensource.org/licenses/Apache-2.0 7 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Drivers/STM32F4xx_HAL_Driver/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the BSD-3-Clause license shall apply. 5 | You may obtain a copy of the BSD-3-Clause at: 6 | https://opensource.org/licenses/BSD-3-Clause 7 | -------------------------------------------------------------------------------- /src/c_includes.h: -------------------------------------------------------------------------------- 1 | #ifndef __INCLUDES_H__ 2 | #define __INCLUDES_H__ 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "./c_config.h" 7 | #include "./src/c_types.h" 8 | #if USE_STM32 9 | #if USE_STM32F1 10 | #if USE_HAL_LIB 11 | #include "stm32f1xx_hal.h" 12 | #elif USE_FW_LIB 13 | 14 | #endif/* USE_HAL_LIB */ 15 | #endif/* USE_STM32F1 */ 16 | 17 | #if USE_STM32F4 18 | #if USE_HAL_LIB 19 | #include "stm32f4xx_hal.h" 20 | #elif USE_FW_LIB 21 | 22 | #endif/* USE_HAL_LIB */ 23 | #endif/* USE_STM32F4 */ 24 | 25 | #endif/* USE_STM32 */ 26 | #if USE_MSP432 27 | 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* __INCLUDES_H__ */ 34 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/c_includes.h: -------------------------------------------------------------------------------- 1 | #ifndef __INCLUDES_H__ 2 | #define __INCLUDES_H__ 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include "./c_config.h" 7 | #include "./src/c_types.h" 8 | #if USE_STM32 9 | #if USE_STM32F1 10 | #if USE_HAL_LIB 11 | #include "stm32f1xx_hal.h" 12 | #elif USE_FW_LIB 13 | 14 | #endif/* USE_HAL_LIB */ 15 | #endif/* USE_STM32F1 */ 16 | 17 | #if USE_STM32F4 18 | #if USE_HAL_LIB 19 | #include "stm32f4xx_hal.h" 20 | #elif USE_FW_LIB 21 | 22 | #endif/* USE_HAL_LIB */ 23 | #endif/* USE_STM32F4 */ 24 | 25 | #endif/* USE_STM32 */ 26 | #if USE_MSP432 27 | 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* __INCLUDES_H__ */ 34 | -------------------------------------------------------------------------------- /docs/update.md: -------------------------------------------------------------------------------- 1 | # 开发版本更新记录 2 | 3 | ## v1.3.1 4 | 5 | **发布日期**:2023年1月17日 6 | 7 | **统一管理不同设备(MCU)的差异** 8 | 9 | 将不同开发环境的串口结构体等进行封装 10 | 11 | **增强io设备数据包解析器** 12 | 13 | 实现用户自定义数据包解析格式。用户可以自定义报文头部、报文尾部、报文校验算法、报文长度。此举拓展了对于各类串口通讯设备的支持 14 | 15 | **为io设备增加字符串模式** 16 | 17 | 每获取到一行就执行一次回调函数 18 | 19 | **拆分c_communication文件** 20 | 21 | 拆分为1.c_pkgproc 2.c_command 3.c_io 22 | 23 | **增加外设驱动** 24 | 25 | 增加TF-Luna激光测距传感器驱动 26 | 27 | ## v1.3 28 | 29 | **io设备增加了数据流模式** 30 | 31 | `CarOS/src/communication/c_communication.h` `CarOS/src/communication/c_communication.c`增加了`Stream` 类型结构体对象。输入缓冲区处理函数增加了对数据流模式的支持。 32 | 33 | **改进了io设备缓冲区空间不足时的输出算法。** 34 | 35 | 改进了`io_vprintf()`函数,增加了写入缓冲区之后,对缓冲区是否为满的判定。 36 | 37 | **提高了io设备输入输出函数的鲁棒性** 38 | 39 | 增加了对于未正确初始化的io设备的检测和报错提示。 40 | 41 | -------------------------------------------------------------------------------- /src/peri_driver/peri_driver.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: peri_driver.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.14 11 | Description: This file contains all supported peripherals. 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.14 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifndef __PERI_DRIVER_H__ 19 | #define __PERI_DRIVER_H__ 20 | #ifdef __cplusplus 21 | extern "C"{ 22 | #endif 23 | #include "./src/peri_driver/distance_measure_sensor/laser_TF_Luna/c_tf_luna.h" 24 | 25 | 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/peri_driver/peri_driver.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: peri_driver.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.14 11 | Description: This file contains all supported peripherals. 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.14 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifndef __PERI_DRIVER_H__ 19 | #define __PERI_DRIVER_H__ 20 | #ifdef __cplusplus 21 | extern "C"{ 22 | #endif 23 | #include "./src/peri_driver/distance_measure_sensor/laser_TF_Luna/c_tf_luna.h" 24 | 25 | 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /cos.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: cos.h 8 | Author: Pansamic 9 | Version: 1.1 10 | Create date: 2022.12.09 11 | Description: the header of all features of CarOS. 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2022.12.10 create v1.0 version. 17 | pansamic 2023.1.3 v1.1 done 18 | *****************************************************************************/ 19 | #ifndef __COS_H_ 20 | #define __COS_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #include "./src/car/c_car.h" 27 | #include "./src/memory/c_memory.h" 28 | #include "./src/communication/c_io.h" 29 | #include "./src/peri_driver/distance_measure_sensor/laser_TF_Luna/c_tf_luna.h" 30 | #include "./src/peri_driver/peri_driver.h" 31 | 32 | #ifdef __cplusplus 33 | } /*extern "C"*/ 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Middlewares/Third_Party/FreeRTOS/Source/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy of 3 | this software and associated documentation files (the "Software"), to deal in 4 | the Software without restriction, including without limitation the rights to 5 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 6 | the Software, and to permit persons to whom the Software is furnished to do so, 7 | subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/cos.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: cos.h 8 | Author: Pansamic 9 | Version: 1.1 10 | Create date: 2022.12.09 11 | Description: the header of all features of CarOS. 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2022.12.10 create v1.0 version. 17 | pansamic 2023.1.3 v1.1 done 18 | *****************************************************************************/ 19 | #ifndef __COS_H_ 20 | #define __COS_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #include "./src/car/c_car.h" 27 | #include "./src/memory/c_memory.h" 28 | #include "./src/communication/c_io.h" 29 | #include "./src/peri_driver/distance_measure_sensor/laser_TF_Luna/c_tf_luna.h" 30 | #include "./src/peri_driver/peri_driver.h" 31 | 32 | #ifdef __cplusplus 33 | } /*extern "C"*/ 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | STM32F407ZGT6_HAL_4WHEEL_MECANUM 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | com.st.stm32cube.ide.mcu.MCUProjectNature 23 | com.st.stm32cube.ide.mcu.MCUCubeProjectNature 24 | org.eclipse.cdt.core.cnature 25 | com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature 26 | com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature 27 | com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature 28 | com.st.stm32cube.ide.mcu.MCURootProjectNature 29 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 30 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 31 | 32 | 33 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Core/Inc/gpio.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.h 5 | * @brief This file contains all the function prototypes for 6 | * the gpio.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __GPIO_H__ 22 | #define __GPIO_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | /* USER CODE BEGIN Private defines */ 36 | 37 | /* USER CODE END Private defines */ 38 | 39 | void MX_GPIO_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif /*__ GPIO_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /src/peri_driver/distance_measure_sensor/laser_TF_Luna/c_tf_luna.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_tf_luna.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.14 11 | Description: This file contains all supported peripherals. 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.14 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifndef __PERI_DRIVER_H__ 19 | #define __PERI_DRIVER_H__ 20 | #ifdef __cplusplus 21 | extern "C"{ 22 | #endif 23 | #include "./src/c_includes.h" 24 | #include "./src/communication/c_io.h" 25 | 26 | #define LUNA_IO_INPUT_BUF_LEN 1024 27 | #define LUNA_IO_OUTPUT_BUF1_LEN 128 28 | #define LUNA_IO_OUTPUT_BUF2_LEN 64 29 | 30 | typedef struct 31 | { 32 | uint16_t Distance; 33 | uint16_t Amplification; 34 | COS_io ioDevice; 35 | }TFLuna; 36 | 37 | 38 | TFLuna* AddPeri_TFLuna (const char *Name,COS_uart huart); 39 | void TFLuna_Reset (TFLuna *TFLuna_instance); 40 | uint16_t TFLuna_GetDistance (TFLuna *TFLuna_instance); 41 | uint16_t TFLuna_GetAmp (TFLuna *TFLuna_instance); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /src/car/c_akerman.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_akerman.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==AKERMAN) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_akerman.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==AKERMAN */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /src/car/c_3wheel_omni.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_3wheel_omni.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==THREE_WHEEL_OMNI) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_3wheel_omni.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==THREE_WHEEL_OMNI */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/peri_driver/distance_measure_sensor/laser_TF_Luna/c_tf_luna.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_tf_luna.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.14 11 | Description: This file contains all supported peripherals. 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.14 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifndef __PERI_DRIVER_H__ 19 | #define __PERI_DRIVER_H__ 20 | #ifdef __cplusplus 21 | extern "C"{ 22 | #endif 23 | #include "./src/c_includes.h" 24 | #include "./src/communication/c_io.h" 25 | 26 | #define LUNA_IO_INPUT_BUF_LEN 1024 27 | #define LUNA_IO_OUTPUT_BUF1_LEN 128 28 | #define LUNA_IO_OUTPUT_BUF2_LEN 64 29 | 30 | typedef struct 31 | { 32 | uint16_t Distance; 33 | uint16_t Amplification; 34 | COS_io ioDevice; 35 | }TFLuna; 36 | 37 | 38 | TFLuna* AddPeri_TFLuna (const char *Name,COS_uart huart); 39 | void TFLuna_Reset (TFLuna *TFLuna_instance); 40 | uint16_t TFLuna_GetDistance (TFLuna *TFLuna_instance); 41 | uint16_t TFLuna_GetAmp (TFLuna *TFLuna_instance); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /src/car/c_2wheel_balance.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_2wheel_balance.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==TWO_WHEEL_BALANCE) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_2wheel_balance.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==TWO_WHEEL_BALANCE */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/car/c_akerman.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_akerman.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==AKERMAN) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_akerman.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==AKERMAN */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /src/car/c_2wheel_differential.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_2wheel_differential.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==TWO_WHEEL_DIFFERENTIAL) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_2wheel_balance.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==TWO_WHEEL_DIFFERENTIAL */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/car/c_3wheel_omni.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_3wheel_omni.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==THREE_WHEEL_OMNI) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_3wheel_omni.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==THREE_WHEEL_OMNI */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /src/car/c_4wheel_omni.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_4wheel_omni.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==FOUR_WHEEL_OMNI) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_4wheel_omni.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor FrontMotor; 37 | DCMotor BehindMotor; 38 | DCMotor LeftMotor; 39 | DCMotor RightMotor; 40 | 41 | 42 | /***************************************************************************************************** 43 | * @name: 44 | * @brief: 45 | * @params: 46 | * @retval:none 47 | * @author: 48 | *****************************************************************************************************/ 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | #endif /* CAR_TYPE==FOUR_WHEEL_OMNI */ 59 | #ifdef _cplusplus 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/car/c_2wheel_balance.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_2wheel_balance.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==TWO_WHEEL_BALANCE) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_2wheel_balance.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==TWO_WHEEL_BALANCE */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Core/Inc/dma.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file dma.h 5 | * @brief This file contains all the function prototypes for 6 | * the dma.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __DMA_H__ 22 | #define __DMA_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* DMA memory to memory transfer handles -------------------------------------*/ 32 | 33 | /* USER CODE BEGIN Includes */ 34 | 35 | /* USER CODE END Includes */ 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_DMA_Init(void); 42 | 43 | /* USER CODE BEGIN Prototypes */ 44 | 45 | /* USER CODE END Prototypes */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __DMA_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/car/c_2wheel_differential.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_2wheel_differential.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==TWO_WHEEL_DIFFERENTIAL) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_2wheel_balance.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftMotor; 37 | DCMotor RightMotor; 38 | 39 | 40 | /***************************************************************************************************** 41 | * @name: 42 | * @brief: 43 | * @params: 44 | * @retval:none 45 | * @author: 46 | *****************************************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif /* CAR_TYPE==TWO_WHEEL_DIFFERENTIAL */ 57 | #ifdef _cplusplus 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/car/c_4wheel_omni.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_4wheel_omni.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==FOUR_WHEEL_OMNI) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_4wheel_omni.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor FrontMotor; 37 | DCMotor BehindMotor; 38 | DCMotor LeftMotor; 39 | DCMotor RightMotor; 40 | 41 | 42 | /***************************************************************************************************** 43 | * @name: 44 | * @brief: 45 | * @params: 46 | * @retval:none 47 | * @author: 48 | *****************************************************************************************************/ 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | #endif /* CAR_TYPE==FOUR_WHEEL_OMNI */ 59 | #ifdef _cplusplus 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Core/Inc/usart.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file usart.h 5 | * @brief This file contains all the function prototypes for 6 | * the usart.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __USART_H__ 22 | #define __USART_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern UART_HandleTypeDef huart1; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | extern uint8_t Usart1RxBuffer; 39 | extern uint8_t BLEUsartRxBuffer; 40 | /* USER CODE END Private defines */ 41 | 42 | void MX_USART1_UART_Init(void); 43 | 44 | /* USER CODE BEGIN Prototypes */ 45 | 46 | /* USER CODE END Prototypes */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __USART_H__ */ 53 | 54 | -------------------------------------------------------------------------------- /src/c_types.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_types.h 8 | Author: Pansamic 9 | Version: 1.0 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v1.0 version. 17 | *****************************************************************************/ 18 | #ifndef __C_TYPES_H__ 19 | #define __C_TYPES_H__ 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #define LinVelToAngVel(Radius,LinearVel) LinearVel/Radius 25 | #define AngVelToLinVel(Radius,AngularVel) Radius*AngularVel 26 | 27 | /* it is used to describe rotation speed of dc motor, unit:r/s */ 28 | typedef float Angle_t; // unit:rad 29 | typedef float LinVelocity_t; // unit:cm/s 30 | typedef float AngVelocity_t; // unit:rad/s 31 | 32 | 33 | /* Remember that COS_uart is ALWAYS a pointer. 34 | * In HAL lib, it's like '&huart1', etc. 35 | * In FW lib, it's like 'USART1', etc.,because 'USART1' itself is a pointer. 36 | * In MSP432, it's like 'EUSCI_A0_BASE', etc., because 'EUSCI_A0_BASE' itself is a pointer. */ 37 | #if USE_HAL_LIB 38 | #define COS_uart UART_HandleTypeDef* 39 | #elif USE_FW_LIB 40 | #define COS_uart USART_TypeDef* 41 | #elif USE_MSP432 42 | #define COS_uart void* 43 | #endif 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif 49 | -------------------------------------------------------------------------------- /src/car/c_4wheel_differential.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_4wheel_differential.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==FOUR_WHEEL_DIFFERENTIAL) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_4wheel_differential.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftFrontMotor; 37 | DCMotor LeftRearMotor; 38 | DCMotor RightFrontMotor; 39 | DCMotor RightRearMotor; 40 | 41 | 42 | /***************************************************************************************************** 43 | * @name: 44 | * @brief: 45 | * @params: 46 | * @retval:none 47 | * @author: 48 | *****************************************************************************************************/ 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | #endif /* CAR_TYPE==FOUR_WHEEL_DIFFERENTIAL */ 59 | #ifdef _cplusplus 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /src/memory/c_memory.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_memory.h 8 | Author: Pansamic 9 | Version: 0.3 10 | Create date: 2022.12.20 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2022.12.20 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifndef __MEMORY_H 19 | #define __MEMORY_H 20 | #include "./src/c_includes.h" 21 | #ifndef NULL 22 | #define NULL 0 23 | #endif 24 | 25 | 26 | 27 | //内存管理控制器 28 | struct _m_mallco_dev 29 | { 30 | void (*init)(void); //初始化 31 | uint8_t (*perused)(void); //内存使用率 32 | uint8_t *membasex; //内存池,管理2个区域的内存 33 | uint16_t *memmapx; //内存管理状态表 34 | uint8_t memrdyx; //内存管理是否就绪 35 | }; 36 | extern struct _m_mallco_dev mallco_dev; //在mallco.c里面定义 ;;这里进行外部声明; 37 | 38 | 39 | 40 | void Mem_Init (void); //内存管理初始化函数(外/内部调用) 41 | uint8_t Mem_GetUsedRate (void); //获得内存使用率(外/内部调用) 42 | void cos_free (void *ptr); //内存释放(外部调用) 43 | void *cos_malloc (uint32_t size); //内存分配(外部调用) 44 | void *cos_realloc (void *ptr,uint32_t size); //重新分配内存(外部调用) 45 | #endif 46 | -------------------------------------------------------------------------------- /src/car/c_6wheel_mecanum.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_6wheel_mecanum.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==SIX_WHEEL_MECANUM) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_6wheel_mecanum.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftFrontMotor; 37 | DCMotor LeftMidMotor; 38 | DCMotor LeftRearMotor; 39 | DCMotor RightFrontMotor; 40 | DCMotor RightMidMotor; 41 | DCMotor RightRearMotor; 42 | 43 | 44 | /***************************************************************************************************** 45 | * @name: 46 | * @brief: 47 | * @params: 48 | * @retval:none 49 | * @author: 50 | *****************************************************************************************************/ 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | #endif /* CAR_TYPE==SIX_WHEEL_MECANUM */ 61 | #ifdef _cplusplus 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/c_types.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_types.h 8 | Author: Pansamic 9 | Version: 1.0 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v1.0 version. 17 | *****************************************************************************/ 18 | #ifndef __C_TYPES_H__ 19 | #define __C_TYPES_H__ 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #define LinVelToAngVel(Radius,LinearVel) LinearVel/Radius 25 | #define AngVelToLinVel(Radius,AngularVel) Radius*AngularVel 26 | 27 | /* it is used to describe rotation speed of dc motor, unit:r/s */ 28 | typedef float Angle_t; // unit:rad 29 | typedef float LinVelocity_t; // unit:cm/s 30 | typedef float AngVelocity_t; // unit:rad/s 31 | 32 | 33 | /* Remember that COS_uart is ALWAYS a pointer. 34 | * In HAL lib, it's like '&huart1', etc. 35 | * In FW lib, it's like 'USART1', etc.,because 'USART1' itself is a pointer. 36 | * In MSP432, it's like 'EUSCI_A0_BASE', etc., because 'EUSCI_A0_BASE' itself is a pointer. */ 37 | #if USE_HAL_LIB 38 | #define COS_uart UART_HandleTypeDef* 39 | #elif USE_FW_LIB 40 | #define COS_uart USART_TypeDef* 41 | #elif USE_MSP432 42 | #define COS_uart void* 43 | #endif 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif 49 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/memory/c_memory.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_memory.h 8 | Author: Pansamic 9 | Version: 0.3 10 | Create date: 2022.12.20 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2022.12.20 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifndef __MEMORY_H 19 | #define __MEMORY_H 20 | #include "./src/c_includes.h" 21 | #ifndef NULL 22 | #define NULL 0 23 | #endif 24 | 25 | 26 | 27 | //内存管理控制器 28 | struct _m_mallco_dev 29 | { 30 | void (*init)(void); //初始化 31 | uint8_t (*perused)(void); //内存使用率 32 | uint8_t *membasex; //内存池,管理2个区域的内存 33 | uint16_t *memmapx; //内存管理状态表 34 | uint8_t memrdyx; //内存管理是否就绪 35 | }; 36 | extern struct _m_mallco_dev mallco_dev; //在mallco.c里面定义 ;;这里进行外部声明; 37 | 38 | 39 | 40 | void Mem_Init (void); //内存管理初始化函数(外/内部调用) 41 | uint8_t Mem_GetUsedRate (void); //获得内存使用率(外/内部调用) 42 | void cos_free (void *ptr); //内存释放(外部调用) 43 | void *cos_malloc (uint32_t size); //内存分配(外部调用) 44 | void *cos_realloc (void *ptr,uint32_t size); //重新分配内存(外部调用) 45 | #endif 46 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/car/c_4wheel_differential.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_4wheel_differential.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==FOUR_WHEEL_DIFFERENTIAL) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_4wheel_differential.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftFrontMotor; 37 | DCMotor LeftRearMotor; 38 | DCMotor RightFrontMotor; 39 | DCMotor RightRearMotor; 40 | 41 | 42 | /***************************************************************************************************** 43 | * @name: 44 | * @brief: 45 | * @params: 46 | * @retval:none 47 | * @author: 48 | *****************************************************************************************************/ 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | #endif /* CAR_TYPE==FOUR_WHEEL_DIFFERENTIAL */ 59 | #ifdef _cplusplus 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/car/c_6wheel_mecanum.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_6wheel_mecanum.c 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.3 11 | Description: 12 | Others: none 13 | 14 | History: 15 | 1. 16 | pansamic 2023.1.3 create v0.1 version. 17 | *****************************************************************************/ 18 | #ifdef _cplusplus 19 | extern "C"{ 20 | #endif 21 | #include "c_config.h" 22 | #if (CAR_TYPE==SIX_WHEEL_MECANUM) 23 | #include 24 | #include "./src/c_types.h" 25 | #include "./src/debug/c_debug.h" 26 | #include "./src/car/c_car.h" 27 | #include "./src/car/c_6wheel_mecanum.h" 28 | 29 | 30 | COS_App CarAppList[CARAPPAMOUNT]={ 31 | 32 | }; 33 | 34 | CarType_t Car; 35 | 36 | DCMotor LeftFrontMotor; 37 | DCMotor LeftMidMotor; 38 | DCMotor LeftRearMotor; 39 | DCMotor RightFrontMotor; 40 | DCMotor RightMidMotor; 41 | DCMotor RightRearMotor; 42 | 43 | 44 | /***************************************************************************************************** 45 | * @name: 46 | * @brief: 47 | * @params: 48 | * @retval:none 49 | * @author: 50 | *****************************************************************************************************/ 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | #endif /* CAR_TYPE==SIX_WHEEL_MECANUM */ 61 | #ifdef _cplusplus 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /docs/车体/car.md: -------------------------------------------------------------------------------- 1 | # 对于不同小车模型的使用说明 2 | 3 | ## 目录 4 | 5 | ## 1. 简介 6 | 7 | `CarOS/src/car/`文件夹下有很多文件,这些文件都是适配不同类型小车的代码。`c_car.h`和`c_car.c`是管理所有小车代码的文件。 8 | 9 | ## 2. 通用使用方法 10 | 11 | 就像实际在拼装车子一样,要想让整个车子动起来,必须要搭好车身框架、装上电机、装上轮子、装上其他外设、连接好遥控器等等。在CarOS中,也是类似的思路,首先我们需要初始化一个小车框架,然后给小车加上轮子距离、轮子直径、加上电机驱动、加上其他外设、连接好串口控制台等等,这样才能让整个车子跑起来。 12 | 13 | 以下**API的名称**不会随着小车模型的不同而改变。 14 | 15 | ### 2.1 初始化 16 | 17 | 初始化一个小车模型就必须要知道小车的类型、车子尺寸等基本信息。以4轮麦克纳姆轮小车为例,请你想象,如果我们要画出一辆麦克纳姆轮小车,我们要知道什么信息?这辆小车到底是像林肯加长轿车那样长还是四四方方?轮胎究竟是直径一米还是直径仅几微米小到看不见?如果我们一旦已知了上述信息,那么这个小车的框架图就基本上定死了,除非这个小车非常高(不过不在我们考虑范围之内)。一个4轮麦克纳姆轮小车的最基本参数就是轮胎之间的距离和轮胎直径,就这样我们搭好了麦克纳姆轮小车的框架。其他的小车类型也是一样的,只要最基本的参数传进结构体中,小车的模型就算是被搭好了。 18 | 19 | 初始化小车的函数是`Car_Init()`函数。该函数由于小车模型不同而有不同版本,每个版本的函数名都是一样的,但是函数参数有差别。只要修改`CarOS/c_config.h`中的`CAR_TYPE`宏定义即可改变`Car_Init()`函数的声明及定义。 20 | 21 | ### 2.2 添加电机及驱动 22 | 23 | 一辆小车必须有轮子、有电机才能跑起来,所以我们需要生成并初始化几个电机结构体,然后把电机安装在小车上,小车才能跑起来。 24 | 25 | 在不同的小车模型的代码文件中已经定义好了与该小车模型相匹配的数量的电机结构体,所以无需用户再次定义。详见`CarOS/src/car/c_xwheel_xxxx.c`(x代表轮子数量,xxxx代表小车模型)文件开头部分。 26 | 27 | **关于初始化**,需要调用`DCMotor_Init()`函数来初始化电机,该函数将参数传递给电机结构体,函数详见文档`电机/motor.md`。 28 | 29 | 为电机添加**硬件驱动**。根据电路实际情况,为电机添加与硬件电路相匹配的驱动。举例:我的小车使用L298N模块来驱动电机,那么需要调用`DCMotor_AddL298N(&xxxMotor,port1,pin1,port2,pin2)`来为电机添加L298N驱动。 30 | 31 | ### 2.3 添加电机控制算法 32 | 33 | 一般来说小车配套的直流电机具有编码器,使用编码器可以实现直流电机的速度环闭环控制。除了**常见的PID算法**,还有滑模控制、模糊控制等控制算法来实现电机速度控制,在v1.x版本中,只支持PID控制,在v2.3及以后的版本中可能会**逐步支持其他速度环控制算法**。 34 | 35 | 使用`DCMotor_AddPID()`来为电机添加PID速度环闭环控制算法。 36 | 37 | ### 2.4 添加编码器 38 | 39 | 如果只添加速度环控制算法而不添加编码器,那将毫无作用,因为根本就不能获取到电机实际的转速是多少。 40 | 41 | 使用`DCMotor_AddEncoder()`函数来为电机添加编码器。 42 | 43 | ## 3. 不同车型的使用说明 44 | 45 | 在以下文档查看具体说明 46 | 47 | [4轮麦克纳姆轮小车](https://github.com/Pansamic/CarOS/blob/master/docs/%E8%BD%A6%E4%BD%93/4wheel_mecanum.md) 48 | 49 | -------------------------------------------------------------------------------- /src/app/c_builtinapp.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_biltinapp.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.2 11 | Description: The CarOS built-in applications. These applications generally 12 | fit for every car model and are system-level debug tools. 13 | Others: none 14 | 15 | History: 16 | 1. 17 | pansamic 2023.1.2 create v0.1 version. 18 | *****************************************************************************/ 19 | #ifndef __C_BUILTINAPP_H__ 20 | #define __C_BUILTINAPP_H__ 21 | #ifdef __cplusplus 22 | extern "C"{ 23 | #endif 24 | #include "./src/app/c_app.h" 25 | 26 | #if LOG_STORAGE 27 | #define BUILT_IN_APP_AMOUNT 2 28 | #else 29 | #define BUILT_IN_APP_AMOUNT 0 30 | #endif 31 | /********************************************************************************************** 32 | * * 33 | * EXTERN * 34 | * * 35 | **********************************************************************************************/ 36 | /* only provide a application list */ 37 | extern COS_App BuiltinAppList[BUILT_IN_APP_AMOUNT]; 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Core/Src/dma.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file dma.c 5 | * @brief This file provides code for the configuration 6 | * of all the requested memory to memory DMA transfers. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "dma.h" 23 | 24 | /* USER CODE BEGIN 0 */ 25 | 26 | /* USER CODE END 0 */ 27 | 28 | /*----------------------------------------------------------------------------*/ 29 | /* Configure DMA */ 30 | /*----------------------------------------------------------------------------*/ 31 | 32 | /* USER CODE BEGIN 1 */ 33 | 34 | /* USER CODE END 1 */ 35 | 36 | /** 37 | * Enable DMA controller clock 38 | */ 39 | void MX_DMA_Init(void) 40 | { 41 | 42 | /* DMA controller clock enable */ 43 | __HAL_RCC_DMA2_CLK_ENABLE(); 44 | 45 | /* DMA interrupt init */ 46 | /* DMA2_Stream7_IRQn interrupt configuration */ 47 | HAL_NVIC_SetPriority(DMA2_Stream7_IRQn, 5, 0); 48 | HAL_NVIC_EnableIRQ(DMA2_Stream7_IRQn); 49 | 50 | } 51 | 52 | /* USER CODE BEGIN 2 */ 53 | 54 | /* USER CODE END 2 */ 55 | 56 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/app/c_builtinapp.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_biltinapp.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.2 11 | Description: The CarOS built-in applications. These applications generally 12 | fit for every car model and are system-level debug tools. 13 | Others: none 14 | 15 | History: 16 | 1. 17 | pansamic 2023.1.2 create v0.1 version. 18 | *****************************************************************************/ 19 | #ifndef __C_BUILTINAPP_H__ 20 | #define __C_BUILTINAPP_H__ 21 | #ifdef __cplusplus 22 | extern "C"{ 23 | #endif 24 | #include "./src/app/c_app.h" 25 | 26 | #if LOG_STORAGE 27 | #define BUILT_IN_APP_AMOUNT 2 28 | #else 29 | #define BUILT_IN_APP_AMOUNT 0 30 | #endif 31 | /********************************************************************************************** 32 | * * 33 | * EXTERN * 34 | * * 35 | **********************************************************************************************/ 36 | /* only provide a application list */ 37 | extern COS_App BuiltinAppList[BUILT_IN_APP_AMOUNT]; 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Drivers/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/Core/Inc/tim.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file tim.h 5 | * @brief This file contains all the function prototypes for 6 | * the tim.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __TIM_H__ 22 | #define __TIM_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern TIM_HandleTypeDef htim1; 36 | 37 | extern TIM_HandleTypeDef htim2; 38 | 39 | extern TIM_HandleTypeDef htim3; 40 | 41 | extern TIM_HandleTypeDef htim4; 42 | 43 | extern TIM_HandleTypeDef htim5; 44 | 45 | /* USER CODE BEGIN Private defines */ 46 | 47 | /* USER CODE END Private defines */ 48 | 49 | void MX_TIM1_Init(void); 50 | void MX_TIM2_Init(void); 51 | void MX_TIM3_Init(void); 52 | void MX_TIM4_Init(void); 53 | void MX_TIM5_Init(void); 54 | 55 | void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); 56 | 57 | /* USER CODE BEGIN Prototypes */ 58 | 59 | /* USER CODE END Prototypes */ 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* __TIM_H__ */ 66 | 67 | -------------------------------------------------------------------------------- /docs/浮点运算单元/FPU.md: -------------------------------------------------------------------------------- 1 | # 关于浮点运算单元 2 | 3 | ## 目录 4 | 5 | 6 | ## 1. 为什么要用浮点运算单元? 7 | 8 | ## 2. 什么MCU有浮点运算单元? 9 | 10 | ## 3. 不同MCU开启浮点运算单元的标准方法 11 | 12 | ### 3.1 STM32 13 | 14 | #### 3.1.1 使用STM32CubeIDE 15 | 16 | 如果MCU自带浮点运算单元,那么STM32CubeIDe会自行生成浮点运算单元指令。 17 | 18 | 查看是否确实生成了浮点运算单元控制指令的方法: 19 | 20 | 1. 在main函数里面写一些浮点运算代码 21 | 1. 点击小锤子进行编译 22 | 2. 连接上ST-Link,开始调试 23 | 3. 依次点击软件最上面一行的Window->Show View->Disassembly打开汇编指令窗口 24 | 4. 在汇编指令窗口最上面的小输入框输入main回车,STM32CubeIDE会自己转到main函数的汇编指令部分 25 | 5. 往下翻找到自己写的浮点运算代码部分,看看是否有xxx.f32的这种指令,如果有,那么开启FPU就实锤了 26 | 27 | #### 3.1.2 使用Keil5 MDK 28 | 29 | STM32F4+CubeMX+Hal库下使能FPU 30 | 31 | ### 3.2 MSP432 32 | 33 | (待补充) 34 | 35 | ## 4. 使用DSP库函数进行快速计算 36 | 37 | ### 4.1 STM32CubeIDE 38 | 39 | 40 | STM32CubeIDE下使能STM32F4的FPU同时调用DSP库计算正弦函数 41 | 42 | ##### 加入代码文件 43 | 44 | STM32F4对应的库文件是arm_cortexM4lf_math.lib: 45 | 46 | `C:\Users\用户名\STM32Cube\Repository\STM32Cube_FW_F4_V1.24.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib` 47 | 48 | 头文件有三个,路径是 49 | `C:\Users\用户名\STM32Cube\Repository\STM32Cube_FW_F4_V1.24.0\Drivers\CMSIS\DSP\Include` 50 | 51 | 源文件是一些math运算,在arm中优化过的。有不少文件夹,直接复制粘贴到工程源文件目录内。 52 | 53 | `C:\Users\用户名\STM32Cube\Repository\STM32Cube_FW_F4_V1.24.0\Drivers\CMSIS\DSP\Source` 54 | 55 | 56 | 57 | ##### 加入全局宏定义 58 | 59 | 右键工程,选属性。在C/C++ General -> Paths and Symbols 中的Symbols增加以下定义 60 | 61 | __FPU_PRESENT,且数值1 62 | 63 | __TARGET_FPU_VFP 64 | 65 | ARM_MATH_CM4 66 | 67 | 68 | 69 | 70 | 71 | 网上有人说还要加一个宏定义`__FPU_USED`其实是不用的。因为core_cm4.h文件里面已经定义了这个宏。 72 | 73 | 在程序要用DSP的时候就`include "arm_math.h"`就行,然后就可以用里面的函数了。 74 | 75 | ### 4.2 Keil5 MDK 76 | 77 | 类似上文 78 | 79 | ### 4.3 CCS(MSP432) 80 | 81 | (待补充) 82 | 83 | ## 4. CarOS对于不同MCU的处理 84 | 85 | -------------------------------------------------------------------------------- /src/app/c_builtinapp.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_biltinapp.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.2 11 | Description: This file contains an application list and some definition of 12 | application callback functions. 13 | Others: none 14 | 15 | History: 16 | 1. 17 | pansamic 2023.1.2 create v0.1 version. 18 | *****************************************************************************/ 19 | #ifdef __cplusplus 20 | extern "C"{ 21 | #endif 22 | #include "c_config.h" 23 | #include "./src/debug/c_debug.h" 24 | #include "./src/app/c_app.h" 25 | #include "./src/app/c_builtinapp.h" 26 | #include "./src/car/c_car.h" 27 | 28 | #if LOG_STORAGE 29 | void PrintLogcb (uint8_t* ParamList); 30 | #endif 31 | void PackageModecb (uint8_t *ParamList); 32 | /* stream mode callback function */ 33 | void PackageTest (COS_io* ioDevice, uint8_t* DataPackage); 34 | 35 | COS_App BuiltinAppList[BUILT_IN_APP_AMOUNT]={ 36 | #if LOG_STORAGE 37 | /* print all system log */ 38 | {"dmesg", NULL, PrintLogcb}, 39 | 40 | {"pkg", NULL, PackageModecb} 41 | #endif 42 | }; 43 | 44 | 45 | 46 | #if LOG_STORAGE 47 | void PrintLogcb(uint8_t* ParamList) 48 | { 49 | COS_PrintLog(); 50 | } 51 | #endif 52 | 53 | 54 | void PackageModecb(uint8_t *ParamList) 55 | { 56 | io_PackageMode(&cosio, 1, 4, PackageTest); 57 | } 58 | 59 | 60 | void PackageTest(COS_io* ioDevice, uint8_t* DataPackage) 61 | { 62 | io_SendData(&cosio, DataPackage, 4); 63 | if(*DataPackage == '+') 64 | { 65 | io_CommandMode(&cosio); 66 | } 67 | } 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | -------------------------------------------------------------------------------- /demo/STM32F407ZGT6_HAL_4WHEEL_MECANUM/CarOS/src/app/c_builtinapp.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT 3 | UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION. 4 | 5 | Copyright (C), 2022-2023, pansamic(Wang GengJie) pansamic@foxmail.com 6 | 7 | Filename: c_biltinapp.h 8 | Author: Pansamic 9 | Version: 0.1 10 | Create date: 2023.1.2 11 | Description: This file contains an application list and some definition of 12 | application callback functions. 13 | Others: none 14 | 15 | History: 16 | 1. 17 | pansamic 2023.1.2 create v0.1 version. 18 | *****************************************************************************/ 19 | #ifdef __cplusplus 20 | extern "C"{ 21 | #endif 22 | #include "c_config.h" 23 | #include "./src/debug/c_debug.h" 24 | #include "./src/app/c_app.h" 25 | #include "./src/app/c_builtinapp.h" 26 | #include "./src/car/c_car.h" 27 | 28 | #if LOG_STORAGE 29 | void PrintLogcb (uint8_t* ParamList); 30 | #endif 31 | void PackageModecb (uint8_t *ParamList); 32 | /* stream mode callback function */ 33 | void PackageTest (COS_io* ioDevice, uint8_t* DataPackage); 34 | 35 | COS_App BuiltinAppList[BUILT_IN_APP_AMOUNT]={ 36 | #if LOG_STORAGE 37 | /* print all system log */ 38 | {"dmesg", NULL, PrintLogcb}, 39 | 40 | {"pkg", NULL, PackageModecb} 41 | #endif 42 | }; 43 | 44 | 45 | 46 | #if LOG_STORAGE 47 | void PrintLogcb(uint8_t* ParamList) 48 | { 49 | COS_PrintLog(); 50 | } 51 | #endif 52 | 53 | 54 | void PackageModecb(uint8_t *ParamList) 55 | { 56 | io_PackageMode(&cosio, 1, 4, PackageTest); 57 | } 58 | 59 | 60 | void PackageTest(COS_io* ioDevice, uint8_t* DataPackage) 61 | { 62 | io_SendData(&cosio, DataPackage, 4); 63 | if(*DataPackage == '+') 64 | { 65 | io_CommandMode(&cosio); 66 | } 67 | } 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | -------------------------------------------------------------------------------- /src/motor/DCmotor/driver/DCmotor_driver.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (C), 2022, pansamic(王耕杰 Wang GengJie) pansamic@foxmail.com 3 | FileName: DCmotor_driver.h 4 | Author: pansamic 5 | Version: v0.0 6 | Date: 2022.12.17 7 | Description: 8 | 9 | History: 10 |