frame construction: compile successfully

This commit is contained in:
yuanjing 2024-01-22 04:13:38 +08:00
parent 9e4d16f4c5
commit d63bc6e375
76 changed files with 19426 additions and 20883 deletions

18
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"D:\\Espressif\\504\\Espressif\\frameworks\\esp-idf-v5.0.4/**",
"D:\\Espressif\\504\\Espressif\\frameworks\\esp-idf-v5.0.4\\components\\esp_wifi\\include/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
]
}
],
"version": 4
}

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"idf.adapterTargetName": "esp32s3"
}

View File

@ -1 +1 @@
e49fd7e24e23bbeca6d9c99114634b78 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/wheel.bin
bb826159d88158957e36e5b7d2343420 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/wheel.bin

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -513,7 +513,7 @@ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=84
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=87
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP

View File

@ -608,3 +608,24 @@ D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/modbu
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/modbus_tcp/CMakeFiles/install.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/modbus_tcp/CMakeFiles/install/local.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/modbus_tcp/CMakeFiles/install/strip.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/CMakeFiles/__idf_bdc_motor.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/CMakeFiles/edit_cache.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/CMakeFiles/rebuild_cache.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/CMakeFiles/list_install_components.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/CMakeFiles/install.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/CMakeFiles/install/local.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/CMakeFiles/install/strip.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/CMakeFiles/__idf_pid_ctrl.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/CMakeFiles/edit_cache.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/CMakeFiles/rebuild_cache.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/CMakeFiles/list_install_components.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/CMakeFiles/install.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/CMakeFiles/install/local.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/CMakeFiles/install/strip.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/CMakeFiles/__idf_mcpwm_bdc_control.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/CMakeFiles/edit_cache.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/CMakeFiles/rebuild_cache.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/CMakeFiles/list_install_components.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/CMakeFiles/install.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/CMakeFiles/install/local.dir
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/CMakeFiles/install/strip.dir

View File

@ -1 +1 @@
6b250ffc3d31e568721deb64153f170eff6f303c
9e4d16f4c55377e1fea69c7f543b2b8a9babc231

View File

@ -1358,6 +1358,63 @@ rule C_STATIC_LIBRARY_LINKER____idf_modbus_tcp_
restat = $RESTAT
#############################################
# Rule for compiling C files.
rule C_COMPILER____idf_bdc_motor_
depfile = $DEP_FILE
deps = gcc
command = ccache D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
#############################################
# Rule for linking C static library.
rule C_STATIC_LIBRARY_LINKER____idf_bdc_motor_
command = cmd.exe /C "$PRE_LINK && D:\Espressif\504\Espressif\tools\cmake\3.24.0\bin\cmake.exe -E rm -f $TARGET_FILE && D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-ar.exe qc $TARGET_FILE $LINK_FLAGS $in && D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-ranlib.exe $TARGET_FILE && $POST_BUILD"
description = Linking C static library $TARGET_FILE
restat = $RESTAT
#############################################
# Rule for compiling C files.
rule C_COMPILER____idf_pid_ctrl_
depfile = $DEP_FILE
deps = gcc
command = ccache D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
#############################################
# Rule for linking C static library.
rule C_STATIC_LIBRARY_LINKER____idf_pid_ctrl_
command = cmd.exe /C "$PRE_LINK && D:\Espressif\504\Espressif\tools\cmake\3.24.0\bin\cmake.exe -E rm -f $TARGET_FILE && D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-ar.exe qc $TARGET_FILE $LINK_FLAGS $in && D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-ranlib.exe $TARGET_FILE && $POST_BUILD"
description = Linking C static library $TARGET_FILE
restat = $RESTAT
#############################################
# Rule for compiling C files.
rule C_COMPILER____idf_mcpwm_bdc_control_
depfile = $DEP_FILE
deps = gcc
command = ccache D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
#############################################
# Rule for linking C static library.
rule C_STATIC_LIBRARY_LINKER____idf_mcpwm_bdc_control_
command = cmd.exe /C "$PRE_LINK && D:\Espressif\504\Espressif\tools\cmake\3.24.0\bin\cmake.exe -E rm -f $TARGET_FILE && D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-ar.exe qc $TARGET_FILE $LINK_FLAGS $in && D:\Espressif\504\Espressif\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-ranlib.exe $TARGET_FILE && $POST_BUILD"
description = Linking C static library $TARGET_FILE
restat = $RESTAT
#############################################
# Rule for re-running cmake.

View File

@ -1,66 +1,66 @@
# ninja log v5
24 254 7275412011977750 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/dport_access.c.obj 450955e55cdb9d12
1650 2031 7275412029706587 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/bootloader_sha.c.obj 160188295d5efe5
9 161 7275412010447779 project_elf_src_esp32.c 3dc0627859f05045
235 517 7275412014410595 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/i2c_periph.c.obj 8532259ffc0259c4
9 161 7275412010447779 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/project_elf_src_esp32.c 3dc0627859f05045
9 161 7275412010447779 project_elf_src_esp32.c 3dc0627859f05045
24 254 7275412011977750 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/dport_access.c.obj 450955e55cdb9d12
535 1793 7275412027336134 esp-idf/micro-ecc/CMakeFiles/__idf_micro-ecc.dir/uECC_verify_antifault.c.obj be67413f4c0dd4f1
9 161 7275412010447779 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/project_elf_src_esp32.c 3dc0627859f05045
27 297 7275412012307742 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/adc_periph.c.obj 8ad3f7aa9b96c4ec
14 232 7275412011557749 esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/eri.c.obj db97f125acd5c3c0
1512 1733 7275412026410324 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_console_loader.c.obj ac9d304a6ff4f7d2
19 246 7275412011747756 esp-idf/soc/CMakeFiles/__idf_soc.dir/dport_access_common.c.obj b4c255e69c3f994
1025 1745 7275412026656156 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/flash_qio_mode.c.obj 40c579e18d1a0ded
1512 1733 7275412026410324 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_console_loader.c.obj ac9d304a6ff4f7d2
1832 2144 7275412030746579 esp-idf/esp_system/CMakeFiles/__idf_esp_system.dir/esp_err.c.obj a965aab841a85b54
1037 1613 7275412025378266 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_encrypt.c.obj eb3f85b0260a65b1
21 292 7275412012277735 esp-idf/soc/CMakeFiles/__idf_soc.dir/lldesc.c.obj de1048c568abf868
310 714 7275412016308578 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/timer_periph.c.obj db9975c79f4c8552
1037 1613 7275412025378266 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_encrypt.c.obj eb3f85b0260a65b1
1832 2144 7275412030746579 esp-idf/esp_system/CMakeFiles/__idf_esp_system.dir/esp_err.c.obj a965aab841a85b54
37 260 7275412011987743 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdm_periph.c.obj ba2840b74f44f93
47 285 7275412012257733 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/lcd_periph.c.obj fa62bedba83e3e9f
248 502 7275412014310609 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/i2s_periph.c.obj 180df683239026be
710 1740 7275412026686151 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp_image_format.c.obj 2a4cf82e406c97da
30 302 7275412012387718 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/gpio_periph.c.obj ad3a3c9a6befb1a
710 1740 7275412026686151 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp_image_format.c.obj 2a4cf82e406c97da
43 308 7275412012387718 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/mcpwm_periph.c.obj 5b31a961d39f4ded
162 314 7275412012537716 CMakeFiles/bootloader.elf.dir/project_elf_src_esp32.c.obj 24985f473ccf2cb2
1662 2053 7275412029826586 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_panic.c.obj 2414460980c5cf1d
1231 1819 7275412027588478 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash_config_esp32.c.obj 8872704072f7267c
518 1135 7275412020498466 esp-idf/hal/CMakeFiles/__idf_hal.dir/esp32/efuse_hal.c.obj 26a4a6150ec9e804
16 361 7275412012907736 esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/xt_trax.c.obj 196a4a57f45530ee
55 321 7275412012507736 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/interrupts.c.obj c7739a975f2011e2
16 361 7275412012907736 esp-idf/xtensa/CMakeFiles/__idf_xtensa.dir/xt_trax.c.obj 196a4a57f45530ee
518 1135 7275412020498466 esp-idf/hal/CMakeFiles/__idf_hal.dir/esp32/efuse_hal.c.obj 26a4a6150ec9e804
1231 1819 7275412027588478 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash_config_esp32.c.obj 8872704072f7267c
1662 2053 7275412029826586 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_panic.c.obj 2414460980c5cf1d
33 327 7275412012587733 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/dac_periph.c.obj fde9a2c432a41877
51 351 7275412012527739 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/ledc_periph.c.obj 1fb86bdcc56bf31e
585 1195 7275412021188270 esp-idf/esp_app_format/CMakeFiles/__idf_esp_app_format.dir/esp_app_desc.c.obj 3ea70f3ef7c978b9
936 1497 7275412024058254 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random.c.obj de5b0c37209ac139
503 1023 7275412019315764 esp-idf/hal/CMakeFiles/__idf_hal.dir/mmu_hal.c.obj 1e2d5d2815ef433
287 534 7275412014640591 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rmt_periph.c.obj 66b949356dc271d8
1741 2190 7275412031175526 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_api.c.obj c2065641e6062fc4
503 1023 7275412019315764 esp-idf/hal/CMakeFiles/__idf_hal.dir/mmu_hal.c.obj 1e2d5d2815ef433
936 1497 7275412024058254 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random.c.obj de5b0c37209ac139
255 549 7275412014760596 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/pcnt_periph.c.obj c2d0fdab7cd5dbd5
1216 1661 7275412025958242 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/secure_boot.c.obj ff8f3cc5fa7c9ee5
1741 2190 7275412031175526 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_api.c.obj c2065641e6062fc4
298 584 7275412015060604 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdmmc_periph.c.obj b882cd34011b6059
1746 2172 7275412031094700 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_utility.c.obj 5c8b8187006efb93
304 594 7275412015260607 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/touch_sensor_periph.c.obj 6093133727e817a5
1746 2172 7275412031094700 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_utility.c.obj 5c8b8187006efb93
293 618 7275412015300643 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/rtc_io_periph.c.obj f0d702ca8d354f5c
315 634 7275412015620591 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/uart_periph.c.obj e176fcd90a49d06f
619 1530 7275412024518250 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common.c.obj 3adbe511c99fd7fb
262 703 7275412016038568 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/sdio_slave_periph.c.obj a0a9c98c578025fc
619 1530 7275412024518250 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common.c.obj 3adbe511c99fd7fb
323 709 7275412016258569 esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32/spi_periph.c.obj 43405d26937aa0a5
352 775 7275412016808579 esp-idf/hal/CMakeFiles/__idf_hal.dir/esp32/cache_hal_esp32.c.obj 15e8f983de585cb9
810 1368 7275412022908251 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_mem.c.obj 637269e029b15655
704 1752 7275412026956133 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash.c.obj 9a2423b5f36723bc
352 775 7275412016808579 esp-idf/hal/CMakeFiles/__idf_hal.dir/esp32/cache_hal_esp32.c.obj 15e8f983de585cb9
1499 1870 7275412028103725 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_efuse.c.obj f10b1f10683a40db
363 808 7275412016989618 esp-idf/hal/CMakeFiles/__idf_hal.dir/efuse_hal.c.obj d73951028ea387b1
1499 1870 7275412028103725 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_efuse.c.obj f10b1f10683a40db
328 935 7275412018715758 esp-idf/hal/CMakeFiles/__idf_hal.dir/wdt_hal_iram.c.obj ed04842e235eda60
550 1036 7275412019695760 esp-idf/hal/CMakeFiles/__idf_hal.dir/mpu_hal.c.obj 5b3f6580fa7446f7
2290 2452 7275412033995565 esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_regi2c.c.obj f9b3ed23a14471ea
1773 2119 7275412030566583 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_fields.c.obj 60b431ffab0df9b4
1821 2217 7275412031615521 esp-idf/esp_common/CMakeFiles/__idf_esp_common.dir/src/esp_err_to_name.c.obj b92695fd8f2bfae0
635 1229 7275412021578263 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_clock_init.c.obj ba9d14982ac10788
2290 2452 7275412033995565 esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_regi2c.c.obj f9b3ed23a14471ea
1773 2119 7275412030566583 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_fields.c.obj 60b431ffab0df9b4
715 1278 7275412022088266 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random_esp32.c.obj 71812545fad67d7c
1136 1648 7275412025778243 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_partitions.c.obj b5a00ecfd36d819a
595 1510 7275412024308242 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common_loader.c.obj 42bce09dbd8178c0
1370 1771 7275412027146142 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_console.c.obj d6f4508f69c42d3a
1615 1776 7275412027176145 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32/bootloader_soc.c.obj 73011cb647c71e26
1280 2037 7275412029756591 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_init.c.obj 7a8af6dd4aaf230a
1531 1801 7275412027406141 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_clock_loader.c.obj d754c4bc2c57e60e
1280 2037 7275412029756591 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_init.c.obj 7a8af6dd4aaf230a
777 1831 7275412027693717 esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_utility.c.obj 261a59fe114bb5f
1754 2106 7275412030366584 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_fields.c.obj 85652ef2c857f8ca
1777 2066 7275412030116596 esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32/esp_efuse_table.c.obj 8e07fa673beccafd
@ -73,8 +73,8 @@
2032 2326 7275412032697985 esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/esp_memory_utils.c.obj cd60f33be779dca6
2262 2377 7275412033255554 esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_sys.c.obj ec06e907845c599d
2173 2383 7275412033255554 esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32/chip_info.c.obj a255a6ef58e156d9
2038 2554 7275412035023865 esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32/rtc_clk.c.obj 3124fa93b39ecb0c
2055 2417 7275412033465571 esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/cpu.c.obj 3da9e58baefe377
2038 2554 7275412035023865 esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32/rtc_clk.c.obj 3124fa93b39ecb0c
2187 2418 7275412033625565 esp-idf/main/CMakeFiles/__idf_main.dir/bootloader_start.c.obj 5b3712a675a2ec84
2317 2437 7275412033805585 esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_longjmp.S.obj 814c2018f6bd4b3d
2119 2460 7275412034085543 esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32/rtc_time.c.obj a8bcae606f9a4513
@ -83,8 +83,8 @@
2297 2479 7275412034293126 esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_uart.c.obj 42c576aa74184daa
2107 2481 7275412034293126 esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32/rtc_sleep.c.obj 2ac1f5e616902415
2218 2560 7275412035099010 esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_spiflash.c.obj a3e4393a25d040e1
2841 2890 7275412038405344 esp-idf/efuse/libefuse.a 76b77989a44b3462
2327 2577 7275412034953522 esp-idf/log/CMakeFiles/__idf_log.dir/log.c.obj eee223fe3a96280a
2841 2890 7275412038405344 esp-idf/efuse/libefuse.a 76b77989a44b3462
2384 2595 7275412035445260 esp-idf/log/CMakeFiles/__idf_log.dir/log_noos.c.obj 8dca581d054260cc
2378 2598 7275412035475232 esp-idf/log/CMakeFiles/__idf_log.dir/log_buffers.c.obj a01a9b8a964b71a8
2599 2656 7275412036075211 esp-idf/log/liblog.a 3492091d6546269f
@ -102,37 +102,15 @@
3259 3416 7275412043619004 bootloader.elf 7da3cbfaa3a310de
3416 3622 7275412045737611 .bin_timestamp 72b2f29a32754a2e
3416 3622 7275412045737611 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/.bin_timestamp 72b2f29a32754a2e
17 164 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
17 164 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
1 7849 7275624849518312 build.ninja f0427fbf96cb5f
1 9153 7275624849518312 build.ninja f0427fbf96cb5f
35 187 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
35 187 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
21 159 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
21 159 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
18 173 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
18 173 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
15 157 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
15 157 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
15 162 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
15 162 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
21 166 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
21 166 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
18 160 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
18 160 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
15 154 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
15 154 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
18 154 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
18 154 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
20 165 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
20 165 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
20 157 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
20 157 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
22 157 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
22 157 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
20 167 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
20 167 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
17 151 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
17 151 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
19 188 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
19 188 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
1 9153 7275703426356529 build.ninja f0427fbf96cb5f
0 4571 7275703426356529 build.ninja f0427fbf96cb5f
9 77 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
9 77 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
9 82 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
9 82 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
8 79 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
8 79 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
12 89 0 esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb
12 89 0 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/esp-idf/esptool_py/CMakeFiles/bootloader_check_size ed9b9c42ba501afb

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"COMPONENT_KCONFIGS": "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/app_trace/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/bt/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/driver/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/efuse/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp-tls/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_adc/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_common/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_eth/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_event/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_gdbstub/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_http_client/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_http_server/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_https_ota/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_https_server/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_hw_support/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_lcd/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_netif/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_phy/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_pm/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_psram/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_ringbuf/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_system/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_timer/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_wifi/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/espcoredump/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/fatfs/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/freertos/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/hal/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/heap/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/ieee802154/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/log/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/lwip/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/mbedtls/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/mqtt/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/newlib/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/nvs_flash/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/openthread/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/protocomm/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/pthread/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/soc/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/spi_flash/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/spiffs/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/tcp_transport/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/ulp/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/unity/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/usb/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/vfs/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/wear_levelling/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/wifi_provisioning/Kconfig;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/wpa_supplicant/Kconfig",
"COMPONENT_KCONFIGS_PROJBUILD": "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/bootloader/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_app_format/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_rom/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esptool_py/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/partition_table/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/wifi_station/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/modbus_tcp/Kconfig.projbuild",
"COMPONENT_KCONFIGS_PROJBUILD": "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/bootloader/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_app_format/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_rom/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esptool_py/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/partition_table/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/wifi_station/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/modbus_tcp/Kconfig.projbuild;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/mcpwm_bdc_control/Kconfig.projbuild",
"COMPONENT_SDKCONFIG_RENAMES": "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/app_trace/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/bootloader/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/bt/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/driver/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_event/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_gdbstub/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_https_ota/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_hw_support/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_hw_support/sdkconfig.rename.esp32;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_phy/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_pm/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_system/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_system/sdkconfig.rename.esp32;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_timer/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_wifi/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/espcoredump/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esptool_py/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/freertos/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/hal/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/lwip/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/newlib/sdkconfig.rename.esp32;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/pthread/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/spi_flash/sdkconfig.rename;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/ulp/sdkconfig.rename.esp32;D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/vfs/sdkconfig.rename",
"IDF_TARGET": "esp32",
"IDF_ENV_FPGA": "",

View File

@ -4095,6 +4095,44 @@
"title": "Modbus Configuration",
"type": "menu"
},
{
"children": [
{
"children": [],
"depends_on": null,
"help": "SSID (network name) for the example to connect to.",
"id": "ESP_WIFI_SSID",
"name": "ESP_WIFI_SSID",
"range": null,
"title": "WiFi SSID",
"type": "string"
},
{
"children": [],
"depends_on": null,
"help": "WiFi password (WPA or WPA2) for the example to use.",
"id": "ESP_WIFI_PASSWORD",
"name": "ESP_WIFI_PASSWORD",
"range": null,
"title": "WiFi Password",
"type": "string"
},
{
"children": [],
"depends_on": null,
"help": "Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent.",
"id": "ESP_MAXIMUM_RETRY",
"name": "ESP_MAXIMUM_RETRY",
"range": null,
"title": "Maximum retry",
"type": "int"
}
],
"depends_on": null,
"id": "wifi-configuration",
"title": "Wifi Configuration",
"type": "menu"
},
{
"children": [
{

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,39 @@
# Install script for directory: D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/bdc_motor
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/wheel")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "TRUE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "D:/Espressif/504/Espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-objdump.exe")
endif()

Binary file not shown.

View File

@ -402,3 +402,18 @@ if(NOT CMAKE_INSTALL_LOCAL_ONLY)
include("D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/modbus_tcp/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/cmake_install.cmake")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for the subdirectory.
include("D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/cmake_install.cmake")
endif()

Binary file not shown.

View File

@ -0,0 +1,39 @@
# Install script for directory: D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/mcpwm_bdc_control
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/wheel")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "TRUE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "D:/Espressif/504/Espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-objdump.exe")
endif()

Binary file not shown.

View File

@ -0,0 +1,39 @@
# Install script for directory: D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/pid_ctrl
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/wheel")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "TRUE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "D:/Espressif/504/Espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-objdump.exe")
endif()

Binary file not shown.

View File

@ -4,4 +4,5 @@ source "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esp_rom/
source "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/esptool_py/Kconfig.projbuild"
source "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/partition_table/Kconfig.projbuild"
source "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/wifi_station/Kconfig.projbuild"
source "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/modbus_tcp/Kconfig.projbuild"
source "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/modbus_tcp/Kconfig.projbuild"
source "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/mcpwm_bdc_control/Kconfig.projbuild"

View File

@ -61,3 +61,6 @@ D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/wifi_
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/main/libmain.a
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/wifi_station/libwifi_station.a
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/modbus_tcp/libmodbus_tcp.a
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/bdc_motor/libbdc_motor.a
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/pid_ctrl/libpid_ctrl.a
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/esp-idf/mcpwm_bdc_control/libmcpwm_bdc_control.a

View File

@ -60,4 +60,7 @@ $<TARGET_FILE:__idf_ulp>
$<TARGET_FILE:__idf_wifi_provisioning>
$<TARGET_FILE:__idf_main>
$<TARGET_FILE:__idf_wifi_station>
$<TARGET_FILE:__idf_modbus_tcp>
$<TARGET_FILE:__idf_modbus_tcp>
$<TARGET_FILE:__idf_bdc_motor>
$<TARGET_FILE:__idf_pid_ctrl>
$<TARGET_FILE:__idf_mcpwm_bdc_control>

View File

View File

@ -0,0 +1,52 @@
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component 'components/wifi_station components/modbus_tcp' contains
a space separator. It was automatically split into ['components/wifi_station', 'components/modbus_tcp']
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component ' components/wifi_station components/modbus_tcp'
contains leading spaces
Note: In ESP-IDF v5.0 and later, COMPONENT_DIRS and EXTRA_COMPONENT_DIRS should be defined
as CMake lists, not as space separated strings.
Examples:
* set(EXTRA_COMPONENT_DIRS path/to/components path/to/more/components)
# Correct, EXTRA_COMPONENT_DIRS is defined as a CMake list, with two paths added
* list(APPEND EXTRA_COMPONENT_DIRS path/to/component)
list(APPEND EXTRA_COMPONENT_DIRS path/to/more/components)
# Correct, use when building EXTRA_COMPONENT_DIRS incrementally
* set(EXTRA_COMPONENT_DIRS path/to/components "another/path with space/components")
# Literal path with spaces has to be quoted
* set(EXTRA_COMPONENT_DIRS $ENV{MY_PATH}/components dir/more_components)
# Correct, even if MY_PATH contains spaces
* set(EXTRA_COMPONENT_DIRS ${ROOT}/component1 ${ROOT}/component2 ${ROOT}/component3)
# Correct, even if ROOT contains spaces
Avoid string concatenation!
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component1")
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component2")
# Incorrect. String "component1 component2" may indicate a single directory
# name with a space, or two directory names separated by space.
Instead use:
list(APPEND component1)
list(APPEND component2)
Defining COMPONENT_DIRS and EXTRA_COMPONENT_DIRS as CMake lists is backwards compatible
with ESP-IDF 4.4 and below.
(If you think these variables are defined correctly in your project and this message
is not relevant, please report this as an issue.)
Diagnostic info: D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/split_paths_by_spaces.py was invoked in D:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car with arguments: ['--var-name=EXTRA_COMPONENT_DIRS', ' components/wifi_station components/modbus_tcp']
CMake Error at D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/cmake/build.cmake:245 (message):
Failed to resolve component 'mcpwm_prelude'.
Call Stack (most recent call first):
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/cmake/build.cmake:281 (__build_resolve_and_add_req)
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/cmake/build.cmake:574 (__build_expand_requirements)
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/cmake/project.cmake:530 (idf_build_process)
CMakeLists.txt:8 (project)
ninja: error: rebuilding 'build.ninja': subcommand failed

View File

@ -0,0 +1,42 @@
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component 'components/wifi_station components/modbus_tcp' contains
a space separator. It was automatically split into ['components/wifi_station', 'components/modbus_tcp']
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component ' components/wifi_station components/modbus_tcp'
contains leading spaces
Note: In ESP-IDF v5.0 and later, COMPONENT_DIRS and EXTRA_COMPONENT_DIRS should be defined
as CMake lists, not as space separated strings.
Examples:
* set(EXTRA_COMPONENT_DIRS path/to/components path/to/more/components)
# Correct, EXTRA_COMPONENT_DIRS is defined as a CMake list, with two paths added
* list(APPEND EXTRA_COMPONENT_DIRS path/to/component)
list(APPEND EXTRA_COMPONENT_DIRS path/to/more/components)
# Correct, use when building EXTRA_COMPONENT_DIRS incrementally
* set(EXTRA_COMPONENT_DIRS path/to/components "another/path with space/components")
# Literal path with spaces has to be quoted
* set(EXTRA_COMPONENT_DIRS $ENV{MY_PATH}/components dir/more_components)
# Correct, even if MY_PATH contains spaces
* set(EXTRA_COMPONENT_DIRS ${ROOT}/component1 ${ROOT}/component2 ${ROOT}/component3)
# Correct, even if ROOT contains spaces
Avoid string concatenation!
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component1")
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component2")
# Incorrect. String "component1 component2" may indicate a single directory
# name with a space, or two directory names separated by space.
Instead use:
list(APPEND component1)
list(APPEND component2)
Defining COMPONENT_DIRS and EXTRA_COMPONENT_DIRS as CMake lists is backwards compatible
with ESP-IDF 4.4 and below.
(If you think these variables are defined correctly in your project and this message
is not relevant, please report this as an issue.)
Diagnostic info: D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/split_paths_by_spaces.py was invoked in D:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car with arguments: ['--var-name=EXTRA_COMPONENT_DIRS', ' components/wifi_station components/modbus_tcp']

View File

@ -0,0 +1,42 @@
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component 'components/wifi_station components/modbus_tcp' contains
a space separator. It was automatically split into ['components/wifi_station', 'components/modbus_tcp']
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component ' components/wifi_station components/modbus_tcp'
contains leading spaces
Note: In ESP-IDF v5.0 and later, COMPONENT_DIRS and EXTRA_COMPONENT_DIRS should be defined
as CMake lists, not as space separated strings.
Examples:
* set(EXTRA_COMPONENT_DIRS path/to/components path/to/more/components)
# Correct, EXTRA_COMPONENT_DIRS is defined as a CMake list, with two paths added
* list(APPEND EXTRA_COMPONENT_DIRS path/to/component)
list(APPEND EXTRA_COMPONENT_DIRS path/to/more/components)
# Correct, use when building EXTRA_COMPONENT_DIRS incrementally
* set(EXTRA_COMPONENT_DIRS path/to/components "another/path with space/components")
# Literal path with spaces has to be quoted
* set(EXTRA_COMPONENT_DIRS $ENV{MY_PATH}/components dir/more_components)
# Correct, even if MY_PATH contains spaces
* set(EXTRA_COMPONENT_DIRS ${ROOT}/component1 ${ROOT}/component2 ${ROOT}/component3)
# Correct, even if ROOT contains spaces
Avoid string concatenation!
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component1")
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component2")
# Incorrect. String "component1 component2" may indicate a single directory
# name with a space, or two directory names separated by space.
Instead use:
list(APPEND component1)
list(APPEND component2)
Defining COMPONENT_DIRS and EXTRA_COMPONENT_DIRS as CMake lists is backwards compatible
with ESP-IDF 4.4 and below.
(If you think these variables are defined correctly in your project and this message
is not relevant, please report this as an issue.)
Diagnostic info: D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/split_paths_by_spaces.py was invoked in D:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car with arguments: ['--var-name=EXTRA_COMPONENT_DIRS', ' components/wifi_station components/modbus_tcp']

View File

@ -0,0 +1,42 @@
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component 'components/wifi_station components/modbus_tcp' contains
a space separator. It was automatically split into ['components/wifi_station', 'components/modbus_tcp']
Warning: in CMake variable EXTRA_COMPONENT_DIRS: Path component ' components/wifi_station components/modbus_tcp'
contains leading spaces
Note: In ESP-IDF v5.0 and later, COMPONENT_DIRS and EXTRA_COMPONENT_DIRS should be defined
as CMake lists, not as space separated strings.
Examples:
* set(EXTRA_COMPONENT_DIRS path/to/components path/to/more/components)
# Correct, EXTRA_COMPONENT_DIRS is defined as a CMake list, with two paths added
* list(APPEND EXTRA_COMPONENT_DIRS path/to/component)
list(APPEND EXTRA_COMPONENT_DIRS path/to/more/components)
# Correct, use when building EXTRA_COMPONENT_DIRS incrementally
* set(EXTRA_COMPONENT_DIRS path/to/components "another/path with space/components")
# Literal path with spaces has to be quoted
* set(EXTRA_COMPONENT_DIRS $ENV{MY_PATH}/components dir/more_components)
# Correct, even if MY_PATH contains spaces
* set(EXTRA_COMPONENT_DIRS ${ROOT}/component1 ${ROOT}/component2 ${ROOT}/component3)
# Correct, even if ROOT contains spaces
Avoid string concatenation!
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component1")
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component2")
# Incorrect. String "component1 component2" may indicate a single directory
# name with a space, or two directory names separated by space.
Instead use:
list(APPEND component1)
list(APPEND component2)
Defining COMPONENT_DIRS and EXTRA_COMPONENT_DIRS as CMake lists is backwards compatible
with ESP-IDF 4.4 and below.
(If you think these variables are defined correctly in your project and this message
is not relevant, please report this as an issue.)
Diagnostic info: D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/tools/split_paths_by_spaces.py was invoked in D:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car with arguments: ['--var-name=EXTRA_COMPONENT_DIRS', ' components/wifi_station components/modbus_tcp']

View File

@ -0,0 +1,21 @@
[1/9] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D D:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car\build\bootloader\esp-idf\esptool_py && D:\Espressif\504\Espressif\python_env\idf5.0_py3.11_env\Scripts\python.exe D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/bootloader/bootloader.bin"
Bootloader binary size 0x6760 bytes. 0x8a0 bytes (8%) free.
[2/7] Building C object esp-idf/mcpwm_bdc_control/CMakeFiles/__idf_mcpwm_bdc_control.dir/mcpwm_bdc_control.c.obj
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/mcpwm_bdc_control/mcpwm_bdc_control.c:43: warning: "BDC_CH1_AOUT_GPIO" redefined
43 | #define BDC_CH1_AOUT_GPIO 6
|
D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/components/mcpwm_bdc_control/mcpwm_bdc_control.c:42: note: this is the location of the previous definition
42 | #define BDC_CH1_AOUT_GPIO 5
|
[3/7] Linking C static library esp-idf\mcpwm_bdc_control\libmcpwm_bdc_control.a
[4/7] Generating ld/sections.ld
[5/7] Linking CXX executable wheel.elf
[6/7] Generating binary image from built executable
esptool.py v4.6.2
Creating esp32 image...
Merged 26 ELF sections
Successfully created esp32 image.
Generated D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/wheel.bin
[7/7] cmd.exe /C "cd /D D:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car\build\esp-idf\esptool_py && D:\Espressif\504\Espressif\python_env\idf5.0_py3.11_env\Scripts\python.exe D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/components/partition_table/check_sizes.py --offset 0x8000 partition --type app D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/partition_table/partition-table.bin D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/wheel.bin"
wheel.bin binary size 0xba0e0 bytes. Smallest app partition is 0x100000 bytes. 0x45f20 bytes (27%) free.

View File

@ -0,0 +1,7 @@
[0/1] Re-running CMake...
-- ccache will be used for faster recompilation
-- Building ESP-IDF components for target esp32
-- Configuring incomplete, errors occurred!
See also "D:/Espressif/504/Espressif/frameworks/esp-idf-v5.0.4/app/car/build/CMakeFiles/CMakeOutput.log".
FAILED: build.ninja
D:\Espressif\504\Espressif\tools\cmake\3.24.0\bin\cmake.exe --regenerate-during-build -SD:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car -BD:\Espressif\504\Espressif\frameworks\esp-idf-v5.0.4\app\car\build

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,10 @@
"files.associations": {
"esp_wifi.h": "c",
"tcp.h": "c",
"bdc_motor_interface.h": "c"
"bdc_motor_interface.h": "c",
"pulse_cnt.h": "c",
"mcpwm_prelude.h": "c",
"esp_timer.h": "c"
}
}
}

View File

@ -0,0 +1,3 @@
idf_component_register(SRCS "bdc_motor_mcpwm_impl.c" "bdc_motor.c"
INCLUDE_DIRS "."
REQUIRES driver)

View File

@ -0,0 +1,3 @@
idf_component_register(SRCS "mcpwm_bdc_control.c"
INCLUDE_DIRS "."
REQUIRES bdc_motor pid_ctrl esp_timer modbus_tcp driver)

View File

@ -0,0 +1,20 @@
menu "Wifi Configuration"
config ESP_WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the example to connect to.
config ESP_WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the example to use.
config ESP_MAXIMUM_RETRY
int "Maximum retry"
default 5
help
Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP is really inexistent.
endmenu

View File

@ -18,24 +18,20 @@
static const char *TAG = "bdc_control";
// Enable this config, we will print debug formated string, which in return can be captured and parsed by Serial-Studio
#define SERIAL_STUDIO_DEBUG CONFIG_SERIAL_STUDIO_DEBUG
#define BDC_MCPWM_TIMER_RESOLUTION_HZ 10000000 // 10MHz, 1 tick = 0.1us
#define BDC_MCPWM_FREQ_HZ 25000 // 25KHz PWM
#define BDC_MCPWM_DUTY_TICK_MAX (BDC_MCPWM_TIMER_RESOLUTION_HZ / BDC_MCPWM_FREQ_HZ) // maximum value we can set for the duty cycle, in ticks
/* PWM输出的定时器配置 */
#define BDC_MCPWM_TIMER_RESOLUTION_HZ 10000000 /* 精度,即计数器的频率 10MHz, 1 tick = 0.1us */
#define BDC_MCPWM_FREQ_HZ 25000 /* PWM周期频率 25KHz PWM */
#define BDC_MCPWM_DUTY_TICK_MAX (BDC_MCPWM_TIMER_RESOLUTION_HZ / BDC_MCPWM_FREQ_HZ) /* PWM占空比最大值由定时器计数频率和PWM周期频率计算得来 */
/* 电机PWM输出IO口 */
#define BDC_MCPWM_GPIO_A 12
#define BDC_MCPWM_GPIO_B 13
#define BDC_MCPWM_GPIO_A1 14
#define BDC_MCPWM_GPIO_B1 15
#define BDC_MCPWM_GPIO_A2 16
#define BDC_MCPWM_GPIO_B2 17
//编码器对应IO口
/* 编码器对应IO口 */
#define BDC_ENCODER_GPIO_A 34
#define BDC_ENCODER_GPIO_B 35
#define BDC_ENCODER_GPIO_A1 33
#define BDC_ENCODER_GPIO_B1 26
@ -50,12 +46,12 @@ static const char *TAG = "bdc_control";
#define BDC_CH0_LOW1_GPIO 9
#define BDC_CH0_HI1_GPIO 10
//编码器脉冲计数误差范围
/* 编码器计数范围 */
#define BDC_ENCODER_PCNT_HIGH_LIMIT 1000
#define BDC_ENCODER_PCNT_LOW_LIMIT -1000
#define BDC_PID_LOOP_PERIOD_MS 1000 // calculate the motor speed every 10ms
#define BDC_PID_EXPECT_SPEED 400 // expected motor speed, in the pulses counted by the rotary encoder
/* pid控制时间周期ms */
#define BDC_PID_LOOP_PERIOD_MS 1000
typedef struct
{
@ -288,7 +284,7 @@ void bdc_motor_init_all(void)
/* 右轮 */
static motor_control_context_t motor_ctrl_ctxr = {
.id = 0, /* 左轮 */
.id = 1, /* 右轮 */
.accumu_count = 0,
.pcnt_encoder = NULL,
.motor = NULL

View File

@ -0,0 +1,2 @@
idf_component_register(SRCS "pid_ctrl.c"
INCLUDE_DIRS ".")

View File

@ -1,2 +1,2 @@
idf_component_register(SRCS "can_network.c" "mcpwm_bdc_control.c" "station_example_main.c" "pid_ctrl.c" "bdc_motor.c" "bdc_motor_interface.h" "bdc_motor_mcpwm_impl.c"
idf_component_register(SRCS "station_example_main.c"
INCLUDE_DIRS ".")

View File

@ -1,250 +0,0 @@
/* TWAI Network Slave Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
/*
* The following example demonstrates a slave node in a TWAI network. The slave
* node is responsible for sending data messages to the master. The example will
* execute multiple iterations, with each iteration the slave node will do the
* following:
* 1) Start the TWAI driver
* 2) Listen for ping messages from master, and send ping response
* 3) Listen for start command from master
* 4) Send data messages to master and listen for stop command
* 5) Send stop response to master
* 6) Stop the TWAI driver
*/
#include <stdio.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "esp_err.h"
#include "esp_log.h"
#include "driver/twai.h"
/* --------------------- Definitions and static variables ------------------ */
// Example Configuration
#define DATA_PERIOD_MS 50
#define NO_OF_ITERS 3
#define ITER_DELAY_MS 1000
#define RX_TASK_PRIO 8 // Receiving task priority
#define TX_TASK_PRIO 9 // Sending task priority
#define CTRL_TSK_PRIO 10 // Control task priority
#define TX_GPIO_NUM 42
#define RX_GPIO_NUM 41
#define TAG "CAN"
#define ID_MASTER_STOP_CMD 0x0A0
#define ID_MASTER_START_CMD 0x0A1
#define ID_MASTER_PING 0x0A2
#define ID_SLAVE_STOP_RESP 0x0B0
#define ID_SLAVE_DATA 0x0B1
#define ID_SLAVE_PING_RESP 0x0B2
typedef enum
{
TX_SEND_PING_RESP,
TX_SEND_DATA,
TX_SEND_STOP_RESP,
TX_TASK_EXIT,
} tx_task_action_t;
typedef enum
{
RX_RECEIVE_PING,
RX_RECEIVE_START_CMD,
RX_RECEIVE_STOP_CMD,
RX_TASK_EXIT,
} rx_task_action_t;
static const twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(TX_GPIO_NUM, RX_GPIO_NUM, TWAI_MODE_NORMAL);
static const twai_timing_config_t t_config = TWAI_TIMING_CONFIG_250KBITS();
static const twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
// static const twai_message_t ping_resp = {.identifier = ID_SLAVE_PING_RESP, .data_length_code = 0, .data = {0, 0, 0, 0, 0, 0, 0, 0}};
// static const twai_message_t stop_resp = {.identifier = ID_SLAVE_STOP_RESP, .data_length_code = 0, .data = {0, 0, 0, 0, 0, 0, 0, 0}};
// Data bytes of data message will be initialized in the transmit task
// static twai_message_t data_message = {.identifier = ID_SLAVE_DATA, .data_length_code = 4, .data = {0, 0, 0, 0, 0, 0, 0, 0}};
// static QueueHandle_t tx_task_queue;
// static QueueHandle_t rx_task_queue;
// static SemaphoreHandle_t ctrl_task_sem;
// static SemaphoreHandle_t stop_data_sem;
// static SemaphoreHandle_t done_sem;
/* --------------------------- Tasks and Functions -------------------------- */
static void twai_receive_task(void *arg)
{
twai_message_t rx_msg;
int i;
while (1)
{
char msg_data_str[32];
int index = 0;
esp_err_t err = twai_receive(&rx_msg, portMAX_DELAY);
if (err == ESP_OK)
{
for (i = 0; i < rx_msg.data_length_code; i++)
{
index += sprintf(&msg_data_str[i], "%02x ", rx_msg.data[i]);
}
// ESP_LOGI(TAG, "recive msg id=%x,len=%d,data=[%s]", rx_msg.identifier, rx_msg.data_length_code, msg_data_str);
}
}
}
// static void twai_transmit_task(void *arg)
// {
// while (1)
// {
// tx_task_action_t action;
// xQueueReceive(tx_task_queue, &action, portMAX_DELAY);
// if (action == TX_SEND_PING_RESP)
// {
// // Transmit ping response to master
// twai_transmit(&ping_resp, portMAX_DELAY);
// ESP_LOGI(EXAMPLE_TAG, "Transmitted ping response");
// xSemaphoreGive(ctrl_task_sem);
// }
// else if (action == TX_SEND_DATA)
// {
// // Transmit data messages until stop command is received
// ESP_LOGI(EXAMPLE_TAG, "Start transmitting data");
// while (1)
// {
// // FreeRTOS tick count used to simulate sensor data
// uint32_t sensor_data = xTaskGetTickCount();
// for (int i = 0; i < 4; i++)
// {
// data_message.data[i] = (sensor_data >> (i * 8)) & 0xFF;
// }
// twai_transmit(&data_message, portMAX_DELAY);
// ESP_LOGI(EXAMPLE_TAG, "Transmitted data value %d", sensor_data);
// vTaskDelay(pdMS_TO_TICKS(DATA_PERIOD_MS));
// if (xSemaphoreTake(stop_data_sem, 0) == pdTRUE)
// {
// break;
// }
// }
// }
// else if (action == TX_SEND_STOP_RESP)
// {
// // Transmit stop response to master
// twai_transmit(&stop_resp, portMAX_DELAY);
// ESP_LOGI(EXAMPLE_TAG, "Transmitted stop response");
// xSemaphoreGive(ctrl_task_sem);
// }
// else if (action == TX_TASK_EXIT)
// {
// break;
// }
// }
// vTaskDelete(NULL);
// }
// static void twai_control_task(void *arg)
// {
// xSemaphoreTake(ctrl_task_sem, portMAX_DELAY);
// tx_task_action_t tx_action;
// rx_task_action_t rx_action;
// for (int iter = 0; iter < NO_OF_ITERS; iter++)
// {
// ESP_ERROR_CHECK(twai_start());
// ESP_LOGI(EXAMPLE_TAG, "Driver started");
// // Listen of pings from master
// rx_action = RX_RECEIVE_PING;
// xQueueSend(rx_task_queue, &rx_action, portMAX_DELAY);
// xSemaphoreTake(ctrl_task_sem, portMAX_DELAY);
// // Send ping response
// tx_action = TX_SEND_PING_RESP;
// xQueueSend(tx_task_queue, &tx_action, portMAX_DELAY);
// xSemaphoreTake(ctrl_task_sem, portMAX_DELAY);
// // Listen for start command
// rx_action = RX_RECEIVE_START_CMD;
// xQueueSend(rx_task_queue, &rx_action, portMAX_DELAY);
// xSemaphoreTake(ctrl_task_sem, portMAX_DELAY);
// // Start sending data messages and listen for stop command
// tx_action = TX_SEND_DATA;
// rx_action = RX_RECEIVE_STOP_CMD;
// xQueueSend(tx_task_queue, &tx_action, portMAX_DELAY);
// xQueueSend(rx_task_queue, &rx_action, portMAX_DELAY);
// xSemaphoreTake(ctrl_task_sem, portMAX_DELAY);
// // Send stop response
// tx_action = TX_SEND_STOP_RESP;
// xQueueSend(tx_task_queue, &tx_action, portMAX_DELAY);
// xSemaphoreTake(ctrl_task_sem, portMAX_DELAY);
// // Wait for bus to become free
// twai_status_info_t status_info;
// twai_get_status_info(&status_info);
// while (status_info.msgs_to_tx > 0)
// {
// vTaskDelay(pdMS_TO_TICKS(100));
// twai_get_status_info(&status_info);
// }
// ESP_ERROR_CHECK(twai_stop());
// ESP_LOGI(EXAMPLE_TAG, "Driver stopped");
// vTaskDelay(pdMS_TO_TICKS(ITER_DELAY_MS));
// }
// // Stop TX and RX tasks
// tx_action = TX_TASK_EXIT;
// rx_action = RX_TASK_EXIT;
// xQueueSend(tx_task_queue, &tx_action, portMAX_DELAY);
// xQueueSend(rx_task_queue, &rx_action, portMAX_DELAY);
// // Delete Control task
// xSemaphoreGive(done_sem);
// vTaskDelete(NULL);
// }
void can_init(void)
{
// Add short delay to allow master it to initialize first
// Create semaphores and tasks
// tx_task_queue = xQueueCreate(1, sizeof(tx_task_action_t));
// rx_task_queue = xQueueCreate(1, sizeof(rx_task_action_t));
// ctrl_task_sem = xSemaphoreCreateBinary();
// stop_data_sem = xSemaphoreCreateBinary();;
// done_sem = xSemaphoreCreateBinary();;
ESP_ERROR_CHECK(twai_driver_install(&g_config, &t_config, &f_config));
ESP_LOGI(TAG, "Driver installed");
xTaskCreatePinnedToCore(twai_receive_task, "CAN_rx", 1024, NULL, RX_TASK_PRIO, NULL, tskNO_AFFINITY);
twai_start();
// xTaskCreatePinnedToCore(twai_transmit_task, "TWAI_tx", 4096, NULL, TX_TASK_PRIO, NULL, tskNO_AFFINITY);
// xTaskCreatePinnedToCore(twai_control_task, "TWAI_ctrl", 4096, NULL, CTRL_TSK_PRIO, NULL, tskNO_AFFINITY);
// Install TWAI driver, trigger tasks to start
// ESP_ERROR_CHECK(twai_driver_install(&g_config, &t_config, &f_config));
// xSemaphoreGive(ctrl_task_sem); // Start Control task
// xSemaphoreTake(done_sem, portMAX_DELAY); // Wait for tasks to complete
// //Uninstall TWAI driver
// ESP_ERROR_CHECK(twai_driver_uninstall());
// ESP_LOGI(EXAMPLE_TAG, "Driver uninstalled");
// //Cleanup
// vSemaphoreDelete(ctrl_task_sem);
// vSemaphoreDelete(stop_data_sem);
// vSemaphoreDelete(done_sem);
// vQueueDelete(tx_task_queue);
// vQueueDelete(rx_task_queue);
}

View File

@ -1 +0,0 @@
9292b605cfd390ff62225caa93e02700b86377e6a3156620192e4876dcf87b27

View File

@ -1,9 +0,0 @@
set(srcs "src/bdc_motor.c")
if(CONFIG_SOC_MCPWM_SUPPORTED)
list(APPEND srcs "src/bdc_motor_mcpwm_impl.c")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS "include" "interface"
PRIV_REQUIRES "driver")

View File

@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,5 +0,0 @@
# Brushed DC Motor Control
This directory contains an implementation for Brushed DC Motor by different peripherals. Currently only MCPWM is supported as the BDC motor backend.
To learn more about how to use this component, please check API Documentation from header file [bdc_motor.h](./include/bdc_motor.h).

View File

@ -1,5 +0,0 @@
dependencies:
idf: '>=5.0'
description: Brushed DC Motor Control Driver
url: https://github.com/espressif/idf-extra-components/tree/master/bdc_motor
version: 0.1.0

View File

@ -1,145 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Brushed DC Motor handle
*/
typedef struct bdc_motor_t *bdc_motor_handle_t;
/**
* @brief Enable BDC motor
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Enable motor successfully
* - ESP_ERR_INVALID_ARG: Enable motor failed because of invalid parameters
* - ESP_FAIL: Enable motor failed because other error occurred
*/
esp_err_t bdc_motor_enable(bdc_motor_handle_t motor);
/**
* @brief Disable BDC motor
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Disable motor successfully
* - ESP_ERR_INVALID_ARG: Disable motor failed because of invalid parameters
* - ESP_FAIL: Disable motor failed because other error occurred
*/
esp_err_t bdc_motor_disable(bdc_motor_handle_t motor);
/**
* @brief Set speed for bdc motor
*
* @param motor: BDC Motor handle
* @param speed: BDC speed
*
* @return
* - ESP_OK: Set motor speed successfully
* - ESP_ERR_INVALID_ARG: Set motor speed failed because of invalid parameters
* - ESP_FAIL: Set motor speed failed because other error occurred
*/
esp_err_t bdc_motor_set_speed(bdc_motor_handle_t motor, uint32_t speed);
/**
* @brief Forward BDC motor
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Forward motor successfully
* - ESP_FAIL: Forward motor failed because some other error occurred
*/
esp_err_t bdc_motor_forward(bdc_motor_handle_t motor);
/**
* @brief Reverse BDC Motor
*
* @param strip: BDC Motor handle
*
* @return
* - ESP_OK: Reverse motor successfully
* - ESP_FAIL: Reverse motor failed because some other error occurred
*/
esp_err_t bdc_motor_reverse(bdc_motor_handle_t motor);
/**
* @brief Stop motor in a coast way (a.k.a Fast Decay)
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Stop motor successfully
* - ESP_FAIL: Stop motor failed because some other error occurred
*/
esp_err_t bdc_motor_coast(bdc_motor_handle_t motor);
/**
* @brief Stop motor in a brake way (a.k.a Slow Decay)
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Stop motor successfully
* - ESP_FAIL: Stop motor failed because some other error occurred
*/
esp_err_t bdc_motor_brake(bdc_motor_handle_t motor);
/**
* @brief Free BDC Motor resources
*
* @param strip: BDC Motor handle
*
* @return
* - ESP_OK: Free resources successfully
* - ESP_FAIL: Free resources failed because error occurred
*/
esp_err_t bdc_motor_del(bdc_motor_handle_t motor);
/**
* @brief BDC Motor Configuration
*/
typedef struct {
uint32_t pwma_gpio_num; /*!< BDC Motor PWM A gpio number */
uint32_t pwmb_gpio_num; /*!< BDC Motor PWM B gpio number */
uint32_t pwm_freq_hz; /*!< PWM frequency, in Hz */
} bdc_motor_config_t;
/**
* @brief BDC Motor MCPWM specific configuration
*/
typedef struct {
int group_id; /*!< MCPWM group number */
uint32_t resolution_hz; /*!< MCPWM timer resolution */
} bdc_motor_mcpwm_config_t;
/**
* @brief Create BDC Motor based on MCPWM peripheral
*
* @param motor_config: BDC Motor configuration
* @param mcpwm_config: MCPWM specific configuration
* @param ret_motor Returned BDC Motor handle
* @return
* - ESP_OK: Create BDC Motor handle successfully
* - ESP_ERR_INVALID_ARG: Create BDC Motor handle failed because of invalid argument
* - ESP_ERR_NO_MEM: Create BDC Motor handle failed because of out of memory
* - ESP_FAIL: Create BDC Motor handle failed because some other error
*/
esp_err_t bdc_motor_new_mcpwm_device(const bdc_motor_config_t *motor_config, const bdc_motor_mcpwm_config_t *mcpwm_config, bdc_motor_handle_t *ret_motor);
#ifdef __cplusplus
}
#endif

View File

@ -1,116 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct bdc_motor_t bdc_motor_t; /*!< Type of BDC motor */
/**
* @brief BDC motor interface definition
*/
struct bdc_motor_t {
/**
* @brief Enable BDC motor
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Enable motor successfully
* - ESP_ERR_INVALID_ARG: Enable motor failed because of invalid parameters
* - ESP_FAIL: Enable motor failed because other error occurred
*/
esp_err_t (*enable)(bdc_motor_t *motor);
/**
* @brief Disable BDC motor
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Disable motor successfully
* - ESP_ERR_INVALID_ARG: Disable motor failed because of invalid parameters
* - ESP_FAIL: Disable motor failed because other error occurred
*/
esp_err_t (*disable)(bdc_motor_t *motor);
/**
* @brief Set speed for bdc motor
*
* @param motor: BDC Motor handle
* @param speed: BDC speed
*
* @return
* - ESP_OK: Set motor speed successfully
* - ESP_ERR_INVALID_ARG: Set motor speed failed because of invalid parameters
* - ESP_FAIL: Set motor speed failed because other error occurred
*/
esp_err_t (*set_speed)(bdc_motor_t *motor, uint32_t speed);
/**
* @brief Forward BDC motor
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Forward motor successfully
* - ESP_FAIL: Forward motor failed because some other error occurred
*/
esp_err_t (*forward)(bdc_motor_t *motor);
/**
* @brief Reverse BDC Motor
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Reverse motor successfully
* - ESP_FAIL: Reverse motor failed because some other error occurred
*/
esp_err_t (*reverse)(bdc_motor_t *motor);
/**
* @brief Stop motor in a coast way (a.k.a Fast Decay)
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Stop motor successfully
* - ESP_FAIL: Stop motor failed because some other error occurred
*/
esp_err_t (*coast)(bdc_motor_t *motor);
/**
* @brief Stop motor in a brake way (a.k.a Slow Decay)
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Stop motor successfully
* - ESP_FAIL: Stop motor failed because some other error occurred
*/
esp_err_t (*brake)(bdc_motor_t *motor);
/**
* @brief Free BDC Motor handle resources
*
* @param motor: BDC Motor handle
*
* @return
* - ESP_OK: Free resources successfully
* - ESP_FAIL: Free resources failed because error occurred
*/
esp_err_t (*del)(bdc_motor_t *motor);
};
#ifdef __cplusplus
}
#endif

View File

@ -1,62 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
#include "esp_log.h"
#include "esp_check.h"
#include "bdc_motor.h"
#include "bdc_motor_interface.h"
static const char *TAG = "bdc_motor";
esp_err_t bdc_motor_enable(bdc_motor_handle_t motor)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->enable(motor);
}
esp_err_t bdc_motor_disable(bdc_motor_handle_t motor)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->disable(motor);
}
esp_err_t bdc_motor_set_speed(bdc_motor_handle_t motor, uint32_t speed)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->set_speed(motor, speed);
}
esp_err_t bdc_motor_forward(bdc_motor_handle_t motor)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->forward(motor);
}
esp_err_t bdc_motor_reverse(bdc_motor_handle_t motor)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->reverse(motor);
}
esp_err_t bdc_motor_coast(bdc_motor_handle_t motor)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->coast(motor);
}
esp_err_t bdc_motor_brake(bdc_motor_handle_t motor)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->brake(motor);
}
esp_err_t bdc_motor_del(bdc_motor_handle_t motor)
{
ESP_RETURN_ON_FALSE(motor, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
return motor->del(motor);
}

View File

@ -1,185 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
#include "esp_log.h"
#include "esp_check.h"
#include "driver/mcpwm_prelude.h"
#include "bdc_motor.h"
#include "bdc_motor_interface.h"
static const char *TAG = "bdc_motor_mcpwm";
typedef struct {
bdc_motor_t base;
mcpwm_timer_handle_t timer;
mcpwm_oper_handle_t operator;
mcpwm_cmpr_handle_t cmpa;
mcpwm_cmpr_handle_t cmpb;
mcpwm_gen_handle_t gena;
mcpwm_gen_handle_t genb;
} bdc_motor_mcpwm_obj;
static esp_err_t bdc_motor_mcpwm_set_speed(bdc_motor_t *motor, uint32_t speed)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
ESP_RETURN_ON_ERROR(mcpwm_comparator_set_compare_value(mcpwm_motor->cmpa, speed), TAG, "set compare value failed");
ESP_RETURN_ON_ERROR(mcpwm_comparator_set_compare_value(mcpwm_motor->cmpb, speed), TAG, "set compare value failed");
return ESP_OK;
}
static esp_err_t bdc_motor_mcpwm_enable(bdc_motor_t *motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
ESP_RETURN_ON_ERROR(mcpwm_timer_enable(mcpwm_motor->timer), TAG, "enable timer failed");
ESP_RETURN_ON_ERROR(mcpwm_timer_start_stop(mcpwm_motor->timer, MCPWM_TIMER_START_NO_STOP), TAG, "start timer failed");
return ESP_OK;
}
static esp_err_t bdc_motor_mcpwm_disable(bdc_motor_t *motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
ESP_RETURN_ON_ERROR(mcpwm_timer_start_stop(mcpwm_motor->timer, MCPWM_TIMER_STOP_EMPTY), TAG, "stop timer failed");
ESP_RETURN_ON_ERROR(mcpwm_timer_disable(mcpwm_motor->timer), TAG, "disable timer failed");
return ESP_OK;
}
static esp_err_t bdc_motor_mcpwm_forward(bdc_motor_t *motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->gena, -1, true), TAG, "disable force level for gena failed");
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->genb, 0, true), TAG, "set force level for genb failed");
return ESP_OK;
}
static esp_err_t bdc_motor_mcpwm_reverse(bdc_motor_t *motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->genb, -1, true), TAG, "disable force level for genb failed");
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->gena, 0, true), TAG, "set force level for gena failed");
return ESP_OK;
}
static esp_err_t bdc_motor_mcpwm_coast(bdc_motor_t *motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->gena, 0, true), TAG, "set force level for gena failed");
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->genb, 0, true), TAG, "set force level for genb failed");
return ESP_OK;
}
static esp_err_t bdc_motor_mcpwm_brake(bdc_motor_t *motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->gena, 1, true), TAG, "set force level for gena failed");
ESP_RETURN_ON_ERROR(mcpwm_generator_set_force_level(mcpwm_motor->genb, 1, true), TAG, "set force level for genb failed");
return ESP_OK;
}
static esp_err_t bdc_motor_mcpwm_del(bdc_motor_t *motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = __containerof(motor, bdc_motor_mcpwm_obj, base);
mcpwm_del_generator(mcpwm_motor->gena);
mcpwm_del_generator(mcpwm_motor->genb);
mcpwm_del_comparator(mcpwm_motor->cmpa);
mcpwm_del_comparator(mcpwm_motor->cmpb);
mcpwm_del_operator(mcpwm_motor->operator);
mcpwm_del_timer(mcpwm_motor->timer);
free(mcpwm_motor);
return ESP_OK;
}
esp_err_t bdc_motor_new_mcpwm_device(const bdc_motor_config_t *motor_config, const bdc_motor_mcpwm_config_t *mcpwm_config, bdc_motor_handle_t *ret_motor)
{
bdc_motor_mcpwm_obj *mcpwm_motor = NULL;
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(motor_config && mcpwm_config && ret_motor, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
mcpwm_motor = calloc(1, sizeof(bdc_motor_mcpwm_obj));
ESP_GOTO_ON_FALSE(mcpwm_motor, ESP_ERR_NO_MEM, err, TAG, "no mem for rmt motor");
// mcpwm timer
mcpwm_timer_config_t timer_config = {
.group_id = mcpwm_config->group_id,
.clk_src = MCPWM_TIMER_CLK_SRC_DEFAULT,
.resolution_hz = mcpwm_config->resolution_hz,
.period_ticks = mcpwm_config->resolution_hz / motor_config->pwm_freq_hz,
.count_mode = MCPWM_TIMER_COUNT_MODE_UP,
};
ESP_GOTO_ON_ERROR(mcpwm_new_timer(&timer_config, &mcpwm_motor->timer), err, TAG, "create MCPWM timer failed");
mcpwm_operator_config_t operator_config = {
.group_id = mcpwm_config->group_id,
};
ESP_GOTO_ON_ERROR(mcpwm_new_operator(&operator_config, &mcpwm_motor->operator), err, TAG, "create MCPWM operator failed");
ESP_GOTO_ON_ERROR(mcpwm_operator_connect_timer(mcpwm_motor->operator, mcpwm_motor->timer), err, TAG, "connect timer and operator failed");
mcpwm_comparator_config_t comparator_config = {
.flags.update_cmp_on_tez = true,
};
ESP_GOTO_ON_ERROR(mcpwm_new_comparator(mcpwm_motor->operator, &comparator_config, &mcpwm_motor->cmpa), err, TAG, "create comparator failed");
ESP_GOTO_ON_ERROR(mcpwm_new_comparator(mcpwm_motor->operator, &comparator_config, &mcpwm_motor->cmpb), err, TAG, "create comparator failed");
// set the initial compare value for both comparators
mcpwm_comparator_set_compare_value(mcpwm_motor->cmpa, 0);
mcpwm_comparator_set_compare_value(mcpwm_motor->cmpb, 0);
mcpwm_generator_config_t generator_config = {
.gen_gpio_num = motor_config->pwma_gpio_num,
};
ESP_GOTO_ON_ERROR(mcpwm_new_generator(mcpwm_motor->operator, &generator_config, &mcpwm_motor->gena), err, TAG, "create generator failed");
generator_config.gen_gpio_num = motor_config->pwmb_gpio_num;
ESP_GOTO_ON_ERROR(mcpwm_new_generator(mcpwm_motor->operator, &generator_config, &mcpwm_motor->genb), err, TAG, "create generator failed");
mcpwm_generator_set_actions_on_timer_event(mcpwm_motor->gena,
MCPWM_GEN_TIMER_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, MCPWM_TIMER_EVENT_EMPTY, MCPWM_GEN_ACTION_HIGH),
MCPWM_GEN_TIMER_EVENT_ACTION_END());
mcpwm_generator_set_actions_on_compare_event(mcpwm_motor->gena,
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, mcpwm_motor->cmpa, MCPWM_GEN_ACTION_LOW),
MCPWM_GEN_COMPARE_EVENT_ACTION_END());
mcpwm_generator_set_actions_on_timer_event(mcpwm_motor->genb,
MCPWM_GEN_TIMER_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, MCPWM_TIMER_EVENT_EMPTY, MCPWM_GEN_ACTION_HIGH),
MCPWM_GEN_TIMER_EVENT_ACTION_END());
mcpwm_generator_set_actions_on_compare_event(mcpwm_motor->genb,
MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, mcpwm_motor->cmpb, MCPWM_GEN_ACTION_LOW),
MCPWM_GEN_COMPARE_EVENT_ACTION_END());
mcpwm_motor->base.enable = bdc_motor_mcpwm_enable;
mcpwm_motor->base.disable = bdc_motor_mcpwm_disable;
mcpwm_motor->base.forward = bdc_motor_mcpwm_forward;
mcpwm_motor->base.reverse = bdc_motor_mcpwm_reverse;
mcpwm_motor->base.coast = bdc_motor_mcpwm_coast;
mcpwm_motor->base.brake = bdc_motor_mcpwm_brake;
mcpwm_motor->base.set_speed = bdc_motor_mcpwm_set_speed;
mcpwm_motor->base.del = bdc_motor_mcpwm_del;
*ret_motor = &mcpwm_motor->base;
return ESP_OK;
err:
if (mcpwm_motor) {
if (mcpwm_motor->gena) {
mcpwm_del_generator(mcpwm_motor->gena);
}
if (mcpwm_motor->genb) {
mcpwm_del_generator(mcpwm_motor->genb);
}
if (mcpwm_motor->cmpa) {
mcpwm_del_comparator(mcpwm_motor->cmpa);
}
if (mcpwm_motor->cmpb) {
mcpwm_del_comparator(mcpwm_motor->cmpb);
}
if (mcpwm_motor->operator) {
mcpwm_del_operator(mcpwm_motor->operator);
}
if (mcpwm_motor->timer) {
mcpwm_del_timer(mcpwm_motor->timer);
}
free(mcpwm_motor);
}
return ret;
}

View File

@ -1 +0,0 @@
17bd99c0160f1c327803aceb088ef0e4ab3410ceb0708cb87fcc950bb62e5698

View File

@ -1,4 +0,0 @@
set(srcs "src/pid_ctrl.c")
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "include")

View File

@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,6 +0,0 @@
dependencies:
idf:
version: '>=4.4'
description: Proportional-integral-derivative controller
url: https://github.com/espressif/idf-extra-components/tree/master/pid_ctrl
version: 0.1.1

View File

@ -1,100 +0,0 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief PID calculation type
*
*/
typedef enum {
PID_CAL_TYPE_INCREMENTAL, /*!< Incremental PID control */
PID_CAL_TYPE_POSITIONAL, /*!< Positional PID control */
} pid_calculate_type_t;
/**
* @brief Type of PID control block handle
*
*/
typedef struct pid_ctrl_block_t *pid_ctrl_block_handle_t;
/**
* @brief PID control parameters
*
*/
typedef struct {
float kp; // PID Kp parameter
float ki; // PID Ki parameter
float kd; // PID Kd parameter
float max_output; // PID maximum output limitation
float min_output; // PID minimum output limitation
float max_integral; // PID maximum integral value limitation
float min_integral; // PID minimum integral value limitation
pid_calculate_type_t cal_type; // PID calculation type
} pid_ctrl_parameter_t;
/**
* @brief PID control configuration
*
*/
typedef struct {
pid_ctrl_parameter_t init_param; // Initial parameters
} pid_ctrl_config_t;
/**
* @brief Create a new PID control session, returns the handle of control block
*
* @param[in] config PID control configuration
* @param[out] ret_pid Returned PID control block handle
* @return
* - ESP_OK: Created PID control block successfully
* - ESP_ERR_INVALID_ARG: Created PID control block failed because of invalid argument
* - ESP_ERR_NO_MEM: Created PID control block failed because out of memory
*/
esp_err_t pid_new_control_block(const pid_ctrl_config_t *config, pid_ctrl_block_handle_t *ret_pid);
/**
* @brief Delete the PID control block
*
* @param[in] pid PID control block handle, created by `pid_new_control_block()`
* @return
* - ESP_OK: Delete PID control block successfully
* - ESP_ERR_INVALID_ARG: Delete PID control block failed because of invalid argument
*/
esp_err_t pid_del_control_block(pid_ctrl_block_handle_t pid);
/**
* @brief Update PID parameters
*
* @param[in] pid PID control block handle, created by `pid_new_control_block()`
* @param[in] params PID parameters
* @return
* - ESP_OK: Update PID parameters successfully
* - ESP_ERR_INVALID_ARG: Update PID parameters failed because of invalid argument
*/
esp_err_t pid_update_parameters(pid_ctrl_block_handle_t pid, const pid_ctrl_parameter_t *params);
/**
* @brief Input error and get PID control result
*
* @param[in] pid PID control block handle, created by `pid_new_control_block()`
* @param[in] input_error error data that feed to the PID controller
* @param[out] ret_result result after PID calculation
* @return
* - ESP_OK: Run a PID compute successfully
* - ESP_ERR_INVALID_ARG: Run a PID compute failed because of invalid argument
*/
esp_err_t pid_compute(pid_ctrl_block_handle_t pid, float input_error, float *ret_result);
#ifdef __cplusplus
}
#endif

View File

@ -1,140 +0,0 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include <sys/param.h>
#include "esp_check.h"
#include "esp_log.h"
#include "pid_ctrl.h"
static const char *TAG = "pid_ctrl";
typedef struct pid_ctrl_block_t pid_ctrl_block_t;
typedef float (*pid_cal_func_t)(pid_ctrl_block_t *pid, float error);
struct pid_ctrl_block_t {
float Kp; // PID Kp value
float Ki; // PID Ki value
float Kd; // PID Kd value
float previous_err1; // e(k-1)
float previous_err2; // e(k-2)
float integral_err; // Sum of error
float last_output; // PID output in last control period
float max_output; // PID maximum output limitation
float min_output; // PID minimum output limitation
float max_integral; // PID maximum integral value limitation
float min_integral; // PID minimum integral value limitation
pid_cal_func_t calculate_func; // calculation function, depends on actual PID type set by user
};
static float pid_calc_positional(pid_ctrl_block_t *pid, float error)
{
float output = 0;
/* Add current error to the integral error */
pid->integral_err += error;
/* If the integral error is out of the range, it will be limited */
pid->integral_err = MIN(pid->integral_err, pid->max_integral);
pid->integral_err = MAX(pid->integral_err, pid->min_integral);
/* Calculate the pid control value by location formula */
/* u(k) = e(k)*Kp + (e(k)-e(k-1))*Kd + integral*Ki */
output = error * pid->Kp +
(error - pid->previous_err1) * pid->Kd +
pid->integral_err * pid->Ki;
/* If the output is out of the range, it will be limited */
output = MIN(output, pid->max_output);
output = MAX(output, pid->min_output);
/* Update previous error */
pid->previous_err1 = error;
return output;
}
static float pid_calc_incremental(pid_ctrl_block_t *pid, float error)
{
float output = 0;
/* Calculate the pid control value by increment formula */
/* du(k) = (e(k)-e(k-1))*Kp + (e(k)-2*e(k-1)+e(k-2))*Kd + e(k)*Ki */
/* u(k) = du(k) + u(k-1) */
output = (error - pid->previous_err1) * pid->Kp +
(error - 2 * pid->previous_err1 + pid->previous_err2) * pid->Kd +
error * pid->Ki +
pid->last_output;
/* If the output is beyond the range, it will be limited */
output = MIN(output, pid->max_output);
output = MAX(output, pid->min_output);
/* Update previous error */
pid->previous_err2 = pid->previous_err1;
pid->previous_err1 = error;
/* Update last output */
pid->last_output = output;
return output;
}
esp_err_t pid_new_control_block(const pid_ctrl_config_t *config, pid_ctrl_block_handle_t *ret_pid)
{
esp_err_t ret = ESP_OK;
pid_ctrl_block_t *pid = NULL;
/* Check the input pointer */
ESP_GOTO_ON_FALSE(config && ret_pid, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
pid = calloc(1, sizeof(pid_ctrl_block_t));
ESP_GOTO_ON_FALSE(pid, ESP_ERR_NO_MEM, err, TAG, "no mem for PID control block");
ESP_GOTO_ON_ERROR(pid_update_parameters(pid, &config->init_param), err, TAG, "init PID parameters failed");
*ret_pid = pid;
return ret;
err:
if (pid) {
free(pid);
}
return ret;
}
esp_err_t pid_del_control_block(pid_ctrl_block_handle_t pid)
{
ESP_RETURN_ON_FALSE(pid, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
free(pid);
return ESP_OK;
}
esp_err_t pid_compute(pid_ctrl_block_handle_t pid, float input_error, float *ret_result)
{
ESP_RETURN_ON_FALSE(pid && ret_result, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
*ret_result = pid->calculate_func(pid, input_error);
return ESP_OK;
}
esp_err_t pid_update_parameters(pid_ctrl_block_handle_t pid, const pid_ctrl_parameter_t *params)
{
ESP_RETURN_ON_FALSE(pid && params, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
pid->Kp = params->kp;
pid->Ki = params->ki;
pid->Kd = params->kd;
pid->max_output = params->max_output;
pid->min_output = params->min_output;
pid->max_integral = params->max_integral;
pid->min_integral = params->min_integral;
/* Set the calculate function according to the PID type */
switch (params->cal_type) {
case PID_CAL_TYPE_INCREMENTAL:
pid->calculate_func = pid_calc_incremental;
break;
case PID_CAL_TYPE_POSITIONAL:
pid->calculate_func = pid_calc_positional;
break;
default:
ESP_RETURN_ON_FALSE(false, ESP_ERR_INVALID_ARG, TAG, "invalid PID calculation type:%d", params->cal_type);
}
return ESP_OK;
}

View File

@ -321,6 +321,11 @@ CONFIG_ESP_MAXIMUM_RETRY=5
CONFIG_MODBUS_ID=1
# end of Modbus Configuration
#
# Wifi Configuration
#
# end of Wifi Configuration
#
# Compiler options
#