金牌会员
 
- 积分
- 1087
- 金钱
- 1087
- 注册时间
- 2017-3-10
- 在线时间
- 172 小时
|
10金钱
我在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
- }
复制代码
|
|