本帖最后由 香水城 于 2020-2-19 22:58 编辑
怎么可能呢? 比方:下面是标准库的部分内容。
******************************************************************************
* @file stm32l152_eval_glass_lcd.c
* @author MCD Application Team
* @version V5.0.2
* @date 09-March-2012
* @brief This file includes the LCD Glass driver for Pacific Display
* (LCD_PD878, PD878-DP-FH-W-LV-6-RH) Module of STM32L152-EVAL board RevB.
******************************************************************************
void LCD_GLASS_Init(void)
{
LCD_InitTypeDef LCD_InitStructure;
LCD_GPIOConfig(); /*!< Configure the LCD Glass GPIO pins */
/*!< Configure the LCD interface -------------------------------------------*/
RCC_APB1PeriphClockCmd(RCC_APB1Periph_LCD, ENABLE); /*!< Enable LCD APB1 Clock */
LCD_InitStructure.LCD_Prescaler = LCD_Prescaler_8;
LCD_InitStructure.LCD_Divider = LCD_Divider_16;
LCD_InitStructure.LCD_Duty = LCD_Duty_1_4;
LCD_InitStructure.LCD_Bias = LCD_Bias_1_3;
LCD_InitStructure.LCD_VoltageSource = LCD_VoltageSource_Internal;
LCD_Init(&LCD_InitStructure);
/*!< Configure the Pulse On Duration */
LCD_PulseOnDurationConfig(LCD_PulseOnDuration_2);
/*!< Configure the LCD Contrast (3.51V) */
LCD_ContrastConfig(LCD_Contrast_Level_7);
/*!< Wait Until the LCD FCR register is synchronized */
LCD_WaitForSynchro();
/*!< Enable LCD peripheral */
LCD_Cmd(ENABLE);
/*!< Wait Until the LCD is enabled */
while(LCD_GetFlagStatus(LCD_FLAG_ENS) == RESET)
{
}
/*!< Wait Until the LCD Booster is ready */
while(LCD_GetFlagStatus(LCD_FLAG_RDY) == RESET)
{
}
}
LCD相关驱动文件在板级支持包BSP目录下,比方Cube库,\STM32Cube_FW_L1_V1.9.0\Drivers\BSP\STM32L152C-Discovery
|