在线时间0 小时
UID100450
ST金币0
蝴蝶豆0
注册时间2008-4-11
新手上路
- 最后登录
- 1970-1-1
|
a0a.1 0b0c
* Description : This file includes the LCD driver for AM-240320L8TNQW00H
* (LCD_ILI9320) Liquid Crystal Display Module of STM3210E-EVAL
* board.
//////////////////////////////////////////////////////////////////////////////////////
/* Private typedef -----------------------------------------------------------*/
typedef struct
{
vu16 LCD_REG;
vu16 LCD_RAM;
} LCD_TypeDef;
/* LCD is connected to the FSMC_Bank1_NOR/SRAM4 and NE4 is used as ship select signal */
#define LCD_BASE ((u32)(0x60000000 | 0x0C000000))
#define LCD ((LCD_TypeDef *) LCD_BASE)
////////////////////////////////////////////////////////////////////////////////////////
void LCD_WriteReg(u8 LCD_Reg, u16 LCD_RegValue)
{
/* Write 16-bit Index, then Write Reg */
LCD->LCD_REG = LCD_Reg;
/* Write 16-bit Reg */
LCD->LCD_RAM = LCD_RegValue;
}
/////////////////////////////////////////////////////////////////////////////////////////
u16 LCD_ReadReg(u8 LCD_Reg)
{
/* Write 16-bit Index (then Read Reg) */
LCD->LCD_REG = LCD_Reg;
/* Read 16-bit Reg */
return (LCD->LCD_RAM);
}
/////////////////////////////////////////////////////////////////////////////////////////
void LCD_WriteRAM_Prepare(void)
{
LCD->LCD_REG = R34;
}
/////////////////////////////////////////////////////////////////////////////////////////
void LCD_WriteRAM(u16 RGB_Code)
{
/* Write 16-bit GRAM Reg */
LCD->LCD_RAM = RGB_Code;
}
这是例程里lcd.c里的一下底层函数的实现。写LCD_ILI9320的寄存器用 LCD_WriteReg()函数,
LCD->LCD_REG = LCD_Reg;是先发送reg的编号,为什么用 LCD->LCD_RAM = LCD_RegValue; 来实现发送
reg需要修改的数据啊?
在结构体里的定义:LCD_REG地址:0x6c000000,LCD_RAM地址:0x6c000001,STM32的FSMC的地址引脚A0接
LCD_ILI9320的RS(L:访问reg;H:访问ram) ,通过给LCD_REG或LCD_RAM写数据来实现访问reg和ram,是这样理解的吗?
那么为什么 LCD_WriteReg()函数里对reg写操作,是对LCD_RAM赋值啊?不懂。还有 LCD_ReadReg(u8 LCD_Reg)的读操作,
也不大明白,怎么实现的啊?
对LCD_ILI932里的reg,ram读写操作时,要给/WR(写入),/RD(读入) 信号的,在用FSMC模块时,程序里没涉及到这些读写信号啊?
高手指点下在下啊?FSMC控制LCD_ILI9320是个什么过程啊?小弟不胜感激!
/* Write 16-bit Reg */
LCD->LCD_RAM = LCD_RegValue;
}
u16 LCD_ReadReg(u8 LCD_Reg)
{
/* Write 16-bit Index (then Read Reg) */
LCD->LCD_REG = LCD_Reg;
/* Read 16-bit Reg */
return (LCD->LCD_RAM);
}
void LCD_WriteRAM_Prepare(void)
{
LCD->LCD_REG = R34;
}
void LCD_WriteRAM(u16 RGB_Code)
{
/* Write 16-bit GRAM Reg */
LCD->LCD_RAM = RGB_Code;
}
|
|