官方LCD例程里的初始化函数,这个频率是怎么计算的?
假如我需要LCD的刷新频率是75Hz,应该怎样配置?谢谢!
void LCD_GLASS_Init(void)
{
/*
The LCD is configured as follow:
- clock source = LSE (32.768 KHz)
- Voltage source = Internal
- Prescaler = 2
- Divider = 18 (16 + 2)
- Mode = 1/8 Duty, 1/4 Bias
- LCD frequency = (clock source * Duty) / (Prescaler * Divider)
= 114 Hz ==> Frame frequency = 28,5 Hz*/
/* Enable LCD clock */
CLK_PeripheralClockConfig(CLK_Peripheral_LCD, ENABLE);
CLK_RTCClockConfig(CLK_RTCCLKSource_LSE, CLK_RTCCLKDiv_1);
/* Initialize the LCD */
LCD_Init(LCD_Prescaler_2, LCD_Divider_18, LCD_Duty_1_8,
LCD_Bias_1_4, LCD_VoltageSource_Internal);
/* Mask register*/
LCD_PortMaskConfig(LCD_PortMaskRegister_0, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_1, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_3, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_4, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_5, 0x0F);
LCD_ContrastConfig(LCD_Contrast_Level_7);
LCD_PulseOnDurationConfig(LCD_PulseOnDuration_7);
LCD_Cmd(ENABLE); /*!< Enable LCD peripheral */
}
|