//------------------------------------------------------------------------------- // File Name: config.h // Brief: // Version: 1.1.0 // Create Date: 2021/07/20 // Create by: Marshal Lee // Copyright: // Copyright (c) 2021, Richpeace Co., LTD. // All rights reserved. // // Modify by: Marshal Lee // Modify Date: 2021/07/20 //------------------------------------------------------------------------------- #ifndef __CONFIG_H__ #define __CONFIG_H__ #include "afxdef.h" //--------------------------------------------------------------- // // 板卡配置 //--------------------------------------------------------------- #define CORE_BOARD_APP 1 // 应用代码 #define CUR_CORE_BOARD CORE_BOARD_APP //--------------------------------------------------------------- #define VERSION_DEBUG 0 // 调试版本 #define VERSION_RELEASE 1 // 发布版本 #define CUR_VERSION VERSION_DEBUG //--------------------------------------------------------------- //--------------------------------------------------------------- #define VER_CODE_M '2','4' #define VER_CODE_S '1','0' #define VER_CODE_D '1','7' //--------------------------------------------------------------- // 板卡用途 #define TEST_BOARD 0 // 测试架 #define SEW_HEAD 1 // 缝纫机头板 #if (CUR_CORE_BOARD == CORE_BOARD_APP) #define BOARD_USE_FOR SEW_HEAD #else #define BOARD_USE_FOR TEST_BOARD #endif //--------------------------------------------------------------- #define USE_IWDOG 0 // 使用看门狗 //--------------------------------------------------------------- #if (BOARD_USE_FOR == SEW_HEAD) #define RS485_CMD_NUM 21 #endif //--------------------------------------------------------------- #ifndef SYSCLK #define SYSCLK 72000000L #endif //--------------------------------------------------------------- // bootloader 大小 #define STM32_BOOT_SIZE (0*1024) #define VERSION_LEN 32 //--------------------------------------------------------------- // 通讯端口选择 #if (1) // 通讯端口选择 #define COMM_NONE 0 // 不使用,无效 #define COMM_USART1 1 // 串口1, #define COMM_USART2 2 // 串口2, 485 #define COMM_USART3 3 // 串口3, 485 #define CONSOLE_PORT COMM_USART1 // 控制台通讯口 #define USART2_485OutEn SetEn485OutOff #define USART2_485OutDis SetEn485OutOn #define USART3_485OutEn SetEn485_2_OutOff #define USART3_485OutDis SetEn485_2_OutOn #define COMM_485 1 #define COMM_CAN 2 #define CONTROL_BUS COMM_CAN #endif //--------------------------------------------------------------- #if (CONTROL_BUS == COMM_485) #define MODBUS_S_PORT #elif (CONTROL_BUS == COMM_CAN) #define CUR_EXA1_NODE_ID 0x21 #define BN_DEVICE_EXA1 0xA1 #endif //--------------------------------------------------------------- #if (BOARD_USE_FOR == SEW_HEAD) #define MODBUS_M #endif //--------------------------------------------------------------- //--------------------------------------------------------------- #define STM32_SOFT_PWM 1 #define STM32_MOTOS_NUM 1 #define MOTO1_TIM TIM1 #define SPEED_PSC 48 #define MOOT_TIM_PSC 80 //--------------------------------------------------------------- #if (BOARD_USE_FOR == SEW_HEAD) #define PWM_TIMER_CTRL 1 #endif //--------------------------------------------------------------- #if (BOARD_USE_FOR == SEW_HEAD) #define VER_TYPE 'S','E','W' #define VER_PROD 'H','E','A','D',' ' #else #define VER_TYPE 'Y','R','A' #define VER_PROD 'D','3','2',' ',' ' #endif //--------------------------------------------------------------- void GetVersionStr(char * str); void GetBuildStr(char * str); //--------------------------------------------------------------- //--------------------------------------------------------------- #include "main.h" #endif