From 4dc288d1744166e66ed72e95257524846d9b2b02 Mon Sep 17 00:00:00 2001 From: ConvertDevice Date: Mon, 19 Dec 2022 22:34:08 +0800 Subject: [PATCH] feat: add convertdevice xCANFD config info --- CMakeLists.txt | 2 +- README.md | 1 + include/config.h | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7385876d..5e8592e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,7 @@ endfunction() set(TGTF042_LIST "cantact" "canalyze" "canable" "usb2can" "cannette") set(TGTF072_LIST "candleLight" "CANable_MKS" "CONVERTDEVICE_xCAN" "DSD_TECH_SH_C30A" "FYSETC_UCAN") set(TGTF407_LIST "STM32F4_DevBoard") -set(TGTG0B1_LIST "budgetcan") +set(TGTG0B1_LIST "budgetcan" "CONVERTDEVICE_xCANFD") foreach (TGTNAME IN LISTS TGTF042_LIST) option(BUILD_${TGTNAME} "Build firmware for \"${TGTNAME}\" (default=yes)" ON) diff --git a/README.md b/README.md index 2bb5d0b8..8f074bf3 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This is firmware for certain STM32F042x/STM32F072xB-based USB-CAN adapters, nota - EntreƩ: https://github.com/tuna-f1sh/entree (STM32F042x6) - CANable-MKS: https://github.com/makerbase-mks/CANable-MKS (STM32F072xB) - ConvertDevice-xCAN: https://github.com/ConvertDevice/xCAN (STM32F072xB) +- ConvertDevice-xCANFD: https://github.com/ConvertDevice/xCANFD (STM32G0B1CBT6) - DSD TECH SH-C30A: https://www.deshide.com/product-details.html?pid=384242&_t=1671089557 (STM32F072xB) - FYSETC UCAN: https://www.fysetc.com/products/fysetc-ucan-board-based-on-stm32f072-usb-to-can-adapter-support-with-canable-candlelight-klipper-firmware (STM32F072xB) diff --git a/include/config.h b/include/config.h index a5666118..7aa24db3 100644 --- a/include/config.h +++ b/include/config.h @@ -109,6 +109,33 @@ THE SOFTWARE. #define LEDTX_Mode GPIO_MODE_OUTPUT_PP #define LEDTX_Active_High 0 +#elif defined(BOARD_CONVERTDEVICE_xCANFD) + #define USBD_PRODUCT_STRING_FS (uint8_t*) "ConvertDevice xCANFD" + #define USBD_MANUFACTURER_STRING (uint8_t*) "ConvertDevice" + #define DFU_INTERFACE_STRING_FS (uint8_t*) "ConvertDevice xCANFD firmware upgrade interface" + #define CAN_INTERFACE FDCAN1 + #define CAN_CLOCK_SPEED 64000000 + #define NUM_CAN_CHANNEL 1 + #define CANFD_SUPPORT + + #define LEDRX_GPIO_Port GPIOA + #define LEDRX_Pin GPIO_PIN_0 + #define LEDRX_Mode GPIO_MODE_OUTPUT_PP + #define LEDRX_Active_High 0 + + #define LEDTX_GPIO_Port GPIOA + #define LEDTX_Pin GPIO_PIN_1 + #define LEDTX_Mode GPIO_MODE_OUTPUT_PP + #define LEDTX_Active_High 0 + + #define USB_GPIO_Port GPIOA + #define USB_Pin_DM GPIO_PIN_11 + #define USB_Pin_DP GPIO_PIN_12 + + #define CANFDIF_GPIO_Port GPIOB + #define CANFDIFRX_Pin GPIO_PIN_8 + #define CANFDIFTX_Pin GPIO_PIN_9 + #elif defined(BOARD_DSD_TECH_SH_C30A) #define USBD_PRODUCT_STRING_FS (uint8_t*) "SH-C30A USB to CAN adapter" #define USBD_MANUFACTURER_STRING (uint8_t*) "DSD TECH"