stm32xiaobai 发表于 2020-5-14 14:47

有用过LL库的么?咨询一下问题

我在keil中添加了代码,配置引脚之后拉高引脚。没有反应,用的内部时钟。
void LCD_GPIO_Init(void)
{
        LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
       

        LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA);
        LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB);
        LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOC);
        LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOH);
       
        GPIO_InitStruct.Pin = data_DB;
        GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
        GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
        GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_MEDIUM;
        LL_GPIO_Init(GPIOA, &GPIO_InitStruct);
       
        GPIO_InitStruct.Pin = RET|EN_LED;
        GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
        GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
        GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_MEDIUM;
        LL_GPIO_Init(GPIOB, &GPIO_InitStruct);
       
        GPIO_InitStruct.Pin = RS|RW|E;
        GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
        GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
        GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_MEDIUM;
        LL_GPIO_Init(GPIOC, &GPIO_InitStruct);
       
        GPIO_InitStruct.Pin = CS1|CS2;
        GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
        GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
        GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_MEDIUM;
        LL_GPIO_Init(GPIOH, &GPIO_InitStruct);
       
        LL_GPIO_SetOutputPin(GPIOB,EN_LED);//EN_LED= 1

}
页: [1]
查看完整版本: 有用过LL库的么?咨询一下问题