我要弄一个串口通信的设计,我用的是STM32F373VC。我在网上看了个案例,用的是F1的,他有个文件叫STM32_Init.c我没找到,我就直接复制,拿来用了。里面的这几行出现错误。。。求别人整理好的STM32F373VC的固件库!万分感谢!
/*----------------------------------------------------------------------------
STM32 GPIO setup.
initializes the GPIOx_CRL and GPIOxCRH register
*----------------------------------------------------------------------------*/
__inline static void stm32_GpioSetup (void) {
if (__GPIO_USED & 0x01) { // GPIO Port A used
RCC->APB2ENR |= RCC_APB2ENR_IOPAEN; // enable clock for GPIOA
GPIOA->CRL = __GPIOA_CRL; // set Port configuration register low
GPIOA->CRH = __GPIOA_CRH; // set Port configuration register high
}
if (__GPIO_USED & 0x02) { // GPIO Port B used
RCC->APB2ENR |= RCC_APB2ENR_IOPBEN; // enable clock for GPIOB
GPIOB->CRL = __GPIOB_CRL; // set Port configuration register low
GPIOB->CRH = __GPIOB_CRH; // set Port configuration register high
}
if (__GPIO_USED & 0x04) { // GPIO Port C used
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN; // enable clock for GPIOC
GPIOC->CRL = __GPIOC_CRL; // set Port configuration register low
GPIOC->CRH = __GPIOC_CRH; // set Port configuration register high
}
if (__GPIO_USED & 0x08) { // GPIO Port D used
RCC->APB2ENR |= RCC_APB2ENR_IOPDEN; // enable clock for GPIOD
GPIOD->CRL = __GPIOD_CRL; // set Port configuration register low
GPIOD->CRH = __GPIOD_CRH; // set Port configuration register high
}
if (__GPIO_USED & 0x10) { // GPIO Port E used
RCC->APB2ENR |= RCC_APB2ENR_IOPEEN; // enable clock for GPIOE
GPIOE->CRL = __GPIOE_CRL; // set Port configuration register low
GPIOE->CRH = __GPIOE_CRH; // set Port configuration register high
}
if (__GPIO_USED & 0x20) { // GPIO Port F used
RCC->APB2ENR |= RCC_APB2ENR_IOPFEN; // enable clock for GPIOF
GPIOF->CRL = __GPIOF_CRL; // set Port configuration register low
GPIOF->CRH = __GPIOF_CRH; // set Port configuration register high
}
if (__GPIO_USED & 0x40) { // GPIO Port G used
RCC->APB2ENR |= RCC_APB2ENR_IOPGEN; // enable clock for GPIOG
GPIOG->CRL = __GPIOG_CRL; // set Port configuration register low
GPIOG->CRH = __GPIOG_CRH; // set Port configuration register high
}