stm32: add STM32H723 support

Signed-off-by: Chen.BJ from BigTreeTech chenbj@biqu3d.com
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
bigtreetech
2022-11-23 11:29:44 +08:00
committed by Kevin O'Connor
parent 50b2e2e67e
commit a42f615881
5 changed files with 119 additions and 61 deletions

View File

@@ -15,21 +15,31 @@
#include "sched.h" // DECL_INIT
#if CONFIG_STM32_USB_PB14_PB15
#define USB_PERIPH_BASE USB_OTG_HS_PERIPH_BASE
#define OTG_IRQn OTG_HS_IRQn
#define USBOTGEN RCC_AHB1ENR_USB1OTGHSEN
#define GPIO_D_NEG GPIO('B', 14)
#define GPIO_D_POS GPIO('B', 15)
#define GPIO_FUNC GPIO_FUNCTION(12)
DECL_CONSTANT_STR("RESERVE_PINS_USB1", "PB14,PB15");
#define IS_OTG_HS 1
#define GPIO_D_NEG GPIO('B', 14)
#define GPIO_D_POS GPIO('B', 15)
#define GPIO_FUNC GPIO_FUNCTION(12)
DECL_CONSTANT_STR("RESERVE_PINS_USB1", "PB14,PB15");
#else
#define USB_PERIPH_BASE USB_OTG_FS_PERIPH_BASE
#define OTG_IRQn OTG_FS_IRQn
#define USBOTGEN RCC_AHB1ENR_USB2OTGHSEN
#define GPIO_D_NEG GPIO('A', 11)
#define GPIO_D_POS GPIO('A', 12)
#define GPIO_FUNC GPIO_FUNCTION(10)
DECL_CONSTANT_STR("RESERVE_PINS_USB", "PA11,PA12");
#if CONFIG_MACH_STM32H723
#define IS_OTG_HS 1
#else
#define IS_OTG_HS 0
#endif
#define GPIO_D_NEG GPIO('A', 11)
#define GPIO_D_POS GPIO('A', 12)
#define GPIO_FUNC GPIO_FUNCTION(10)
DECL_CONSTANT_STR("RESERVE_PINS_USB", "PA11,PA12");
#endif
#if IS_OTG_HS
#define USB_PERIPH_BASE USB_OTG_HS_PERIPH_BASE
#define OTG_IRQn OTG_HS_IRQn
#define USBOTGEN RCC_AHB1ENR_USB1OTGHSEN
#else
#define USB_PERIPH_BASE USB_OTG_FS_PERIPH_BASE
#define OTG_IRQn OTG_FS_IRQn
#define USBOTGEN RCC_AHB1ENR_USB2OTGHSEN
#endif
static void