Browse Source

update

master
zhaohe 2 years ago
parent
commit
ccf3719b3b
  1. 10
      .cproject
  2. 2
      .project
  3. 4
      .settings/language.settings.xml
  4. 4
      .settings/stm32cubeide.project.prefs
  5. 0
      dap.cfg
  6. 2
      sdk
  7. 117
      usrc/main.cpp
  8. 107
      usrc/project.hpp
  9. 4
      zapp.ioc
  10. 14
      zapp.launch

10
.cproject

@ -26,7 +26,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1449146736" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407VETx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407VETX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.2004392039" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="144" valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1550094338" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/robotic_core_xy}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.2039995727" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<builder buildPath="${workspace_loc:/zapp}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.2039995727" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1267404562" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1574118648" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.1426155053" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
@ -134,7 +134,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1999660059" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F407VETx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F407xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F407VETX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.1733776023" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="144" valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1767941885" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/robotic_core_xy}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1109588320" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<builder buildPath="${workspace_loc:/zapp}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1109588320" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1819027329" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1168918717" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.937143612" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
@ -207,16 +207,16 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="robotic_core_xy.null.218039856" name="robotic_core_xy"/>
<project id="zapp.null.218039856" name="zapp"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/robotic_core_xy"/>
<resource resourceType="PROJECT" workspacePath="/zapp"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/robotic_core_xy"/>
<resource resourceType="PROJECT" workspacePath="/zapp"/>
</configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">

2
.project

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>robotic_core_xy</name>
<name>zapp</name>
<comment></comment>
<projects>
</projects>

4
.settings/language.settings.xml

@ -5,7 +5,7 @@
<provider-reference id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-893282063446892158" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1382728325907468114" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider-reference id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-847233803538494395" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1428776585815865877" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

4
.settings/stm32cubeide.project.prefs

@ -1,3 +1,3 @@
8DF89ED150041C4CBC7CB9A9CAA90856=763711B08F1ABC1A77FC8FA1A08B45FA
DC22A860405A8BF2F2C095E5B6529F12=763711B08F1ABC1A77FC8FA1A08B45FA
8DF89ED150041C4CBC7CB9A9CAA90856=F6DE5292A9642B92EC07AFF89A393D1B
DC22A860405A8BF2F2C095E5B6529F12=D76CD03FA6D6925E54EEE32EC928F8C2
eclipse.preferences.version=1

0
robotic_core_xy dap.cfg → dap.cfg

2
sdk

@ -1 +1 @@
Subproject commit c081915dfcdc6901b278c969f861458ee386eae0
Subproject commit f28856b68a9c6fd2b06070a2a10c6f40dfe9896d

117
usrc/main.cpp

@ -9,6 +9,7 @@
#include "sdk/hal/zhal.hpp"
#include "sdk\components\iflytop_can_slave_v1\iflytop_can_slave.hpp"
#include "sdk\components\tmc\ic\ztmc4361A.hpp"
#include "sdk\components\tmc\ic\ztmc5130.hpp"
#define TAG "main"
namespace iflytop {
@ -18,17 +19,18 @@ Main gmain;
using namespace iflytop;
IflytopCanProtocolStackProcesser m_protocolStack;
TMC4361A m_motora;
TMC4361A m_motorb;
ZGPIO arm_sensor1_gpio;
ZGPIO arm_sensor2_gpio;
ZGPIO arm_sensor3_gpio;
ZGPIO arm_sensor4_gpio;
ZGPIO arm_sensor5_gpio;
ZGPIO arm_sensor6_gpio;
ZGPIO arm_sensor7_gpio;
ZGPIO arm_sensor8_gpio;
TMC5130 m_tj_motor;
TMC5130 m_py_motor;
// ZGPIO arm_sensor1_gpio;
// ZGPIO arm_sensor2_gpio;
// ZGPIO arm_sensor3_gpio;
// ZGPIO arm_sensor4_gpio;
// ZGPIO arm_sensor5_gpio;
// ZGPIO arm_sensor6_gpio;
// ZGPIO arm_sensor7_gpio;
// ZGPIO arm_sensor8_gpio;
ZGPIO debuglight;
@ -42,43 +44,40 @@ ZGPIO tmc_motor2_nreset_io;
ZGPIO tmc_motor2_sub_ic_enn_io;
void input_sensors_init() {
arm_sensor1_gpio.initAsInput(ARM_SENSOR1_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
arm_sensor2_gpio.initAsInput(ARM_SENSOR2_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
arm_sensor3_gpio.initAsInput(ARM_SENSOR3_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
arm_sensor4_gpio.initAsInput(ARM_SENSOR4_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
arm_sensor5_gpio.initAsInput(ARM_SENSOR5_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
arm_sensor6_gpio.initAsInput(ARM_SENSOR6_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
arm_sensor7_gpio.initAsInput(ARM_SENSOR7_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
arm_sensor8_gpio.initAsInput(ARM_SENSOR8_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
// arm_sensor1_gpio.initAsInput(ARM_SENSOR1_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
// arm_sensor2_gpio.initAsInput(ARM_SENSOR2_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
// arm_sensor3_gpio.initAsInput(ARM_SENSOR3_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
// arm_sensor4_gpio.initAsInput(ARM_SENSOR4_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
// arm_sensor5_gpio.initAsInput(ARM_SENSOR5_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
// arm_sensor6_gpio.initAsInput(ARM_SENSOR6_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
// arm_sensor7_gpio.initAsInput(ARM_SENSOR7_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
// arm_sensor8_gpio.initAsInput(ARM_SENSOR8_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_risingAndFallingIrq, true);
}
uint32_t intput_sensors_get_table0() {
uint32_t val = 0;
val |= arm_sensor1_gpio.getStateUint32() << 1;
val |= arm_sensor2_gpio.getStateUint32() << 2;
val |= arm_sensor3_gpio.getStateUint32() << 3;
val |= arm_sensor4_gpio.getStateUint32() << 4;
val |= arm_sensor5_gpio.getStateUint32() << 5;
val |= arm_sensor6_gpio.getStateUint32() << 6;
val |= arm_sensor7_gpio.getStateUint32() << 7;
val |= arm_sensor8_gpio.getStateUint32() << 8;
// val |= arm_sensor1_gpio.getStateUint32() << 1;
// val |= arm_sensor2_gpio.getStateUint32() << 2;
// val |= arm_sensor3_gpio.getStateUint32() << 3;
// val |= arm_sensor4_gpio.getStateUint32() << 4;
// val |= arm_sensor5_gpio.getStateUint32() << 5;
// val |= arm_sensor6_gpio.getStateUint32() << 6;
// val |= arm_sensor7_gpio.getStateUint32() << 7;
// val |= arm_sensor8_gpio.getStateUint32() << 8;
return val;
}
ZGPIO *input_sensors_get_arm1_homegpio() { return &arm_sensor8_gpio; }
ZGPIO *input_sensors_get_arm2_homegpio() { return &arm_sensor7_gpio; }
icps::error_t Main::onHostRegisterWriteEvent(IflytopCanProtocolStackProcesser *processer, icps::WriteEvent *event) { return icps::kSuccess; }
icps::error_t Main::onHostRegisterReadEvent(IflytopCanProtocolStackProcesser *processer, icps::ReadEvent *event) { return icps::kSuccess; }
void Main::onHostRegisterReportEvent(IflytopCanProtocolStackProcesser *processer, icps::ReportEvent *event) {}
void Main::run() {
iflytop_no_os_cfg_t oscfg = {
ZHALCORE::cfg_t oscfg = {
.delayhtim = &DELAY_US_TIMER,
.debuguart = &DEBUG_UART,
};
iflytop_no_os_init(&oscfg);
ZHALCORE::getInstance()->initialize(oscfg);
ZLOGI(TAG, "robotic_core_xy:%s", VERSION);
ZLOGI(TAG, "zapp:%s", VERSION);
printf("int32_t %d int %d longint %d\n", sizeof(int32_t), sizeof(int), sizeof(long int));
debuglight.initAsOutput(DEBUG_LIGHT_GPIO, ZGPIO::kMode_nopull, false, false);
@ -93,43 +92,20 @@ void Main::run() {
/*******************************************************************************
* *
*******************************************************************************/
tmc_motor1_spi_select1_io.initAsOutput(TMC_MOTOR1_SPI_SELECT1_IO, ZGPIO::kMode_nopull, false, true);
tmc_motor1_nfreeze_io.initAsOutput(TMC_MOTOR1_nFREEZE_IO, ZGPIO::kMode_nopull, false, true);
tmc_motor1_nreset_io.initAsOutput(TMC_MOTOR1_nRESET_IO, ZGPIO::kMode_nopull, false, true);
tmc_motor1_sub_ic_enn_io.initAsOutput(TMC_MOTOR1_SUB_IC_ENN_IO, ZGPIO::kMode_nopull, false, true);
tmc_motor2_spi_select1_io.initAsOutput(TMC_MOTOR2_SPI_SELECT1_IO, ZGPIO::kMode_nopull, false, true);
tmc_motor2_nfreeze_io.initAsOutput(TMC_MOTOR2_nFREEZE_IO, ZGPIO::kMode_nopull, false, true);
tmc_motor2_nreset_io.initAsOutput(TMC_MOTOR2_nRESET_IO, ZGPIO::kMode_nopull, false, true);
tmc_motor2_sub_ic_enn_io.initAsOutput(TMC_MOTOR2_SUB_IC_ENN_IO, ZGPIO::kMode_nopull, false, true);
{
TMC4361A::cfg_t motora_cfg = {.spi = &TMC_MOTOR_SPI,
.csgpio = &tmc_motor1_spi_select1_io,
.resetPin = &tmc_motor1_nreset_io,
.fREEZEPin = &tmc_motor1_nfreeze_io,
.ennPin = NULL,
.driverIC_ennPin = &tmc_motor1_sub_ic_enn_io,
.driverIC_resetPin = NULL};
m_motora.initialize(&motora_cfg);
int32_t ic4361Version = m_motora.readICVersion();
int32_t ic2160Version = m_motora.readSubICVersion();
ZLOGI(TAG, "m_motora:TMC4361Version:%lx TMC2160VERSION:%lx", ic4361Version, ic2160Version);
TMC5130::cfg_t cfg = {.hspi = &MOTOR_SPI, .enn_pin = MOTOR0_ENN, .csn_pin = MOTOR0_CSN};
m_py_motor.initialize(&cfg);
int32_t chipv = m_py_motor.readChipVERSION();
ZLOGI(TAG, "m_py_motor:%lx", chipv);
}
{
TMC4361A::cfg_t motorb_cfg = {.spi = &TMC_MOTOR_SPI,
.csgpio = &tmc_motor2_spi_select1_io,
.resetPin = &tmc_motor2_nreset_io,
.fREEZEPin = &tmc_motor2_nfreeze_io,
.ennPin = NULL,
.driverIC_ennPin = &tmc_motor2_sub_ic_enn_io,
.driverIC_resetPin = NULL};
m_motorb.initialize(&motorb_cfg);
int32_t ic4361Version = m_motorb.readICVersion();
int32_t ic2160Version = m_motorb.readSubICVersion();
ZLOGI(TAG, "m_motorb:TMC4361Version:%lx TMC2160VERSION:%lx", ic4361Version, ic2160Version);
TMC5130::cfg_t cfg = {.hspi = &MOTOR_SPI, .enn_pin = MOTOR1_ENN, .csn_pin = MOTOR1_CSN};
m_tj_motor.initialize(&cfg);
int32_t chipv = m_tj_motor.readChipVERSION();
ZLOGI(TAG, "m_tj_motor:%lx", chipv);
}
/*******************************************************************************
@ -162,15 +138,6 @@ void Main::run() {
m_protocolStack.activeReg(REG_GPIO_INPUT0, icps::kwr, 0);
}
m_motora.setIHOLD_IRUN(1, 12, 0); // 小臂
m_motora.setMotorShaft(0);
m_motorb.setIHOLD_IRUN(1, 12, 0); // 小臂
m_motorb.setMotorShaft(0);
m_motora.rotate(1200000);
m_motorb.rotate(1200000);
while (1) {
ZHALCORE::getInstance()->loop();
}

107
usrc/project.hpp

@ -1,64 +1,83 @@
#pragma once
#define VERSION "v2.0"
#define VERSION "v1.0"
// 设备ID
#define DEVICE_ID (128 + 3)
#define DEVICE_ID (128 + 5)
// 调试串口
#define DEBUG_UART huart1
// 调试指示灯
#define DEBUG_LIGHT_GPIO PE2
#define DEBUG_LIGHT_GPIO PE8
// 微秒延迟定时器,注意该延时定时器需要按照以下文档进行配置
// http://192.168.1.3:3000/zwikipedia/iflytop_wikipedia/src/branch/master/doc/stm32cubemx_us_timer.md
#define DELAY_US_TIMER htim6
// 电机通道编号
#define TMC_MOTOR_SPI hspi1
// MOTOR1
#define TMC_MOTOR1_CHANNEL 1
#define TMC_MOTOR1_SPI_SELECT1_IO PA4
#define TMC_MOTOR1_nFREEZE_IO PC2
#define TMC_MOTOR1_nRESET_IO PB3
#define TMC_MOTOR1_SUB_IC_ENN_IO PC3
#define TMC_MOTOR1_ENN_IO // unused
#define DELAY_US_TIMER htim6
#define MICROSWITCH_NUM 6
//
/*******************************************************************************
* 485 *
*******************************************************************************/
#define MASTER_SLAVE_485_UART huart2
/*******************************************************************************
* *
*******************************************************************************/
#define REACTION_BOX_SWEEP_SENSOR_UART huart3
/*******************************************************************************
* MOTOR *
*******************************************************************************/
/**
*
*
*/
#define MOTOR_SPI hspi1
// MOTOR2
#define TMC_MOTOR2_CHANNEL 2
#define TMC_MOTOR2_SPI_SELECT1_IO PA8
#define TMC_MOTOR2_nFREEZE_IO PC6
#define TMC_MOTOR2_nRESET_IO PB2
#define TMC_MOTOR2_SUB_IC_ENN_IO PC7
#define TMC_MOTOR2_ENN_IO // unused
#define TMC5130_MOTOR_NUM 2
#define MOTOR_CH(n) (n)
// FYBJ_PY
#define MOTOR0_CSN PA4 // 平移电机片选信号
#define MOTOR0_ENN PE14
// FYBJ_TJ_DRV
#define MOTOR1_CSN PC4 // 添加电机片选信号
#define MOTOR1_ENN PE13
/*******************************************************************************
* MotorConfig *
* REG LIST *
*******************************************************************************/
#define MOTOR_REDUCTION_RATIO1 50
#define MOTOR_REDUCTION_RATIO2 50
#define DEVICE_BASIC_CONTROLLER_ADD_BASE 0
#define GPIO_INPUT_ADD_BASE 1000 // GPIO输入
#define REG_GPIO_INPUT0 (GPIO_INPUT_ADD_BASE + 0)
#define REG_PY_MOTOR_CTRL_ADD_BASE 10000 // 控制 入料电机控制
#define REG_TJ_MOTOR_CTRL_ADD_BASE 10100 // 控制 转移电机控制
#define REG_ID_CARD_READER_CTRL_ADD_BASE 20000 // 控制 串口扫码器
#define REG_LARSER_SCANNER_CTRL_ADD_BASE 30000 // 控制 单点激光扫码器
#define SCARA_L2 (2385) // 0.1mm
#define SCARA_L1 (2150) // 0.1mm
/*******************************************************************************
* REG LIST *
* GPIO *
*******************************************************************************/
// https://iflytop1.feishu.cn/docx/ZBsddjrL1oHAiYx8DdmcccEBnPf
#define BEEP PA1 // 蜂鸣器
#define FAN1_FB_INT PA15 // 帕尔贴风机反馈
#define DEVICE_BASIC_CTRL_ADD_BASE 0
#define GPIO_INPUT_ADD_BASE 1000 // GPIO输入
#define REG_SCARA_CTRL_ADD_BASE 11200 // 机械臂控制基地址
#define REG_BARCODE_CTRL_ADD_BASE 20000 // 扫码器控制基地址
#define HOT_CTR PB1
#define REG_GPIO_INPUT0 (GPIO_INPUT_ADD_BASE + 0)
#define FAN0_POWER PC8 // 外部风机电源
#define FAN1_POWER PC9 // 帕尔贴风机
#define ARM_SENSOR1_GPIO PD0
#define ARM_SENSOR2_GPIO PD1
#define ARM_SENSOR3_GPIO PD2
#define ARM_SENSOR4_GPIO PD3
#define ARM_SENSOR5_GPIO PD4
#define ARM_SENSOR6_GPIO PD5
#define ARM_SENSOR7_GPIO PD6
#define ARM_SENSOR8_GPIO PD7
#define FYBH_READ1 PD0
#define FYBH_READ2 PD1
#define FYBH_READ3 PD2
#define FYBH_READ4 PD3
#define FYBH_READ5 PD4
#define FYBH_READ6 PD5
#define FYBJL_SENSOR8 PD7 // 开门霍尔
#define FYBJL_SENSOR7 PD8 // 卡板光电1
#define FYBJL_SENSOR6 PD9 // 预留光电
#define FYBJL_SENSOR5 PD10 // 推杆限位光电
#define FYBJL_SENSOR4 PD11 // 推杆原点光电
#define FYBJL_SENSOR3 PD12 // 平移计步光电(预留)
#define FYBJL_SENSOR2 PD13 // 平移限位光电
#define FYBJL_SENSOR1 PD14 // 平移原点光电
#define FYBJL_SENSOR0 PD15 // 黑白扫码
#define CODE_SCANER_UART huart3
#define COLD_CTR PE10

4
robotic_core_xy.ioc → zapp.ioc

@ -147,8 +147,8 @@ ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=robotic_core_xy.ioc
ProjectManager.ProjectName=robotic_core_xy
ProjectManager.ProjectFileName=zapp.ioc
ProjectManager.ProjectName=zapp
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x1000

14
robotic_core_xy.launch → zapp.launch

@ -12,7 +12,7 @@
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{&quot;fItems&quot;:[{&quot;fIsFromMainTab&quot;:true,&quot;fPath&quot;:&quot;Debug/robotic_core_xy.elf&quot;,&quot;fProjectName&quot;:&quot;robotic_core_xy&quot;,&quot;fPerformBuild&quot;:true,&quot;fDownload&quot;:true,&quot;fLoadSymbols&quot;:true}]}"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{&quot;fItems&quot;:[{&quot;fIsFromMainTab&quot;:true,&quot;fPath&quot;:&quot;Debug/zapp.elf&quot;,&quot;fProjectName&quot;:&quot;zapp&quot;,&quot;fPerformBuild&quot;:true,&quot;fDownload&quot;:true,&quot;fLoadSymbols&quot;:true}]}"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
@ -36,7 +36,7 @@
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.OPENOCD_NAME" value="&quot;${stm32cubeide_openocd_path}\openocd.exe&quot;"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.OPENOCD_OTHER_OPTIONS" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.OPENOCD_RESTART_CONFIGURATIONS" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset halt&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Reset halt&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Reset halt&quot;,&quot;fLaunchAttribute&quot;:&quot;monitor reset halt&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset halt&quot;],&quot;fCmdOptions&quot;:[]},{&quot;fDisplayName&quot;:&quot;Reset init&quot;,&quot;fLaunchAttribute&quot;:&quot;monitor reset init&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset init&quot;],&quot;fCmdOptions&quot;:[]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true},{&quot;fDisplayName&quot;:&quot;Reset init&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Reset init&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Reset halt&quot;,&quot;fLaunchAttribute&quot;:&quot;monitor reset halt&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset halt&quot;],&quot;fCmdOptions&quot;:[]},{&quot;fDisplayName&quot;:&quot;Reset init&quot;,&quot;fLaunchAttribute&quot;:&quot;monitor reset init&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset init&quot;],&quot;fCmdOptions&quot;:[]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.OPENOCD_SCRIPT" value="${ProjDirPath}\robotic_core_xy dap.cfg"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.OPENOCD_SCRIPT" value="${ProjDirPath}\dap.cfg"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.openocd.OPENOCD_SCRIPT_CHOICE" value="provided"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.openocdenable_rtos" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_allow_halt" value="false"/>
@ -46,7 +46,7 @@
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_shared_stlink" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.frequency" value="0"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.halt_all_on_reset" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="D:\workspace\project_boditech_vidas_a8000\new\robotic_core_xy\Debug\st-link_gdbserver_log.txt"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="D:\workspace\project_boditech_vidas_a8000\new\zapp\Debug\st-link_gdbserver_log.txt"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="enable"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
@ -80,13 +80,13 @@
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/robotic_core_xy.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="robotic_core_xy"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/zapp.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="zapp"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1316415929"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/robotic_core_xy"/>
<listEntry value="/zapp"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
Loading…
Cancel
Save