GPIOB->BSRR |= GPIO_PIN_8;
__nop();
__nop();
__nop();
GPIOB->BSRR |= GPIO_PIN_9; }/*******************************************************************************
* Function Name : LCD_ReadRAM
* Description : Reads the LCD RAM.
* Input : None
* Output : None
* Return : LCD RAM Value.
*******************************************************************************/u16 LCD_ReadRAM(void){
u16 temp;
GPIOB->BRR |= GPIO_PIN_9;
GPIOB->BRR |= GPIO_PIN_8;
GPIOB->BSRR |= GPIO_PIN_5;
GPIOC->ODR = R34;
GPIOB->BRR |= GPIO_PIN_5;
__nop();
__nop();
__nop();
GPIOB->BSRR |= GPIO_PIN_5;
GPIOB->BSRR |= GPIO_PIN_8;
LCD_BusIn();
GPIOA->BRR |= GPIO_PIN_8;
__nop();
__nop();
__nop();
temp = GPIOC->IDR;
GPIOA->BSRR |= GPIO_PIN_8;
LCD_BusOut();
GPIOB->BSRR |= GPIO_PIN_9;
return temp;}/*******************************************************************************
* Function Name : LCD_PowerOn
* Description : Power on the LCD.
* Input : None
* Output : None
* Return : None
*******************************************************************************/void LCD_PowerOn(void){
LCD_WriteReg(R16, 0x0000);
LCD_WriteReg(R17, 0x0000);
LCD_WriteReg(R18, 0x0000);
LCD_WriteReg(R19, 0x0000);
Delay_LCD(20);
LCD_WriteReg(R16, 0x17B0);
LCD_WriteReg(R17, 0x0137);
Delay_LCD(5);
LCD_WriteReg(R18, 0x0139);
Delay_LCD(5);
LCD_WriteReg(R19, 0x1d00);
LCD_WriteReg(R41, 0x0013);
Delay_LCD(5);
LCD_WriteReg(R7, 0x0173);}/*******************************************************************************
* Function Name : LCD_DisplayOn
* Description : Enables the Display.
* Input : None
* Output : None
* Return : None
*******************************************************************************/void LCD_DisplayOn(void){
LCD_WriteReg(R7, 0x0173);}/*******************************************************************************
* Function Name : LCD_DisplayOff
* Description : Disables the Display.
* Input : None
* Output : None
* Return : None
*******************************************************************************/void LCD_DisplayOff(void){
LCD_WriteReg(R7, 0x0); }/*******************************************************************************
* Function Name : LCD_CtrlLinesConfig
* Description : Configures LCD Control lines.
Push-Pull mode.
* Input : None
* Output : None
* Return : None
*******************************************************************************/void LCD_CtrlLinesConfig(void){
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_5 | GPIO_PIN_8 | GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_8 ;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
LCD_BusOut();
GPIOA->BSRR |= 0x0100;
GPIOB->BSRR |= 0x0220;}/*******************************************************************************
* Function Name : LCD_BusIn
* Description : Configures the Parallel interface for LCD(PortC)
* Input : None
* Output : None
* Return : None
*******************************************************************************/void LCD_BusIn(void){
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_All;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); }/*******************************************************************************
* Function Name : LCD_BusOut
* Description : Configures the Parallel interface for LCD(PortC)
* Input : None
* Output : None
* Return : None
*******************************************************************************/void LCD_BusOut(void){
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_All;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); }/*******************************************************************************
* Function Name : LCD_DrawPicture
* Description : Displays a 16 color picture.
* Input : - picture: pointer to the picture array.
* Output : None
* Return : None
*******************************************************************************/void LCD_DrawPicture(const u8* picture){
int index;
LCD_SetCursor(0x00, 0x0000);
LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
for(index = 0; index < 76800; index++)
{
LCD_WriteRAM(picture[2*index+1]<<8|picture[2*index]);
}}
上一篇:4.stm32 ADC与DAC
下一篇:2.stm32串口
推荐阅读最新更新时间:2026-03-24 22:55
- 支持 BLE 连接、由 4mA 至 20mA 电流回路供电的现场发送器参考设计
- AM2DM-0515DH60-NZ ±15 Vout、2W 双路输出 DC-DC 转换器的典型应用
- LTC6261IDC 音频耳机桥式驱动器运算放大器的典型应用
- LTC1775CS 2.5V/5A 可调输出降压稳压器的典型应用电路
- AD8601ARTZ-REEL7 符合 PC100 标准的线路输出放大器的典型应用
- 一种基于分立的 315MHz 振荡器解决方案,用于使用 BFR182 射频双极晶体管的远程无钥匙进入系统
- 使用 ROHM Semiconductor 的 BD49E39G-TR 的参考设计
- AM30EW-2405SZ 5V 三路输出 DC/DC 转换器的典型应用
- LTC3564 的电池在 1.2A 应用中达到 1.2V
- AL1676EV2,基于 AP1676 高亮度降压 LED 驱动控制器的评估板



STM32模拟串口
dm9000cep网卡通信
非常经典的关于LLC的杨波博士论文
LMH6672LDX/NOPB
ASM10DTBD-S664






京公网安备 11010802033920号