stm32f103rct6驱动LCD屏NT35310初始化序列
时间: 2023-06-18 20:03:01 浏览: 70
以下是STM32F103RCT6驱动NT35310 LCD屏的初始化序列:
```c
/* 初始化NT35310 LCD屏幕 */
void NT35310_Init(void)
{
/* 发送复位信号 */
NT35310_WriteCommand(0x01); // 软复位
HAL_Delay(10); // 等待LCD屏幕重启
/* 使能时钟 */
NT35310_WriteCommand(0x11); // 开启时钟
HAL_Delay(10); // 等待时钟启动
/* 滤波器设置 */
NT35310_WriteCommand(0xB3);
NT35310_WriteData(0x00);
NT35310_WriteData(0x20);
NT35310_WriteData(0x00);
NT35310_WriteData(0x23);
NT35310_WriteData(0x00);
NT35310_WriteData(0x00);
/* 设置屏幕参数 */
NT35310_WriteCommand(0xB1);
NT35310_WriteData(0x00);
NT35310_WriteData(0x16);
NT35310_WriteData(0x0D);
/* 电源设置 */
NT35310_WriteCommand(0xB4);
NT35310_WriteData(0x11);
NT35310_WriteData(0x07);
NT35310_WriteData(0x43);
/* GAMMA设置 */
NT35310_WriteCommand(0xC0);
NT35310_WriteData(0x00);
NT35310_WriteData(0x0C);
NT35310_WriteData(0x0F);
NT35310_WriteData(0x08);
NT35310_WriteData(0x23);
NT35310_WriteData(0x0F);
NT35310_WriteData(0x3F);
NT35310_WriteData(0xC0);
NT35310_WriteData(0x05);
NT35310_WriteData(0x08);
NT35310_WriteData(0x08);
NT35310_WriteData(0x32);
NT35310_WriteData(0x13);
NT35310_WriteData(0x10);
NT35310_WriteData(0x00);
/* 显示方向设置 */
NT35310_WriteCommand(0x36);
NT35310_WriteData(0x08);
/* 位图格式设置 */
NT35310_WriteCommand(0x3A);
NT35310_WriteData(0x55);
/* 设置列地址 */
NT35310_WriteCommand(0x2A);
NT35310_WriteData(0x00);
NT35310_WriteData(0x00);
NT35310_WriteData(0x01);
NT35310_WriteData(0x3F);
/* 设置行地址 */
NT35310_WriteCommand(0x2B);
NT35310_WriteData(0x00);
NT35310_WriteData(0x00);
NT35310_WriteData(0x01);
NT35310_WriteData(0xDF);
/* 设置写数据 */
NT35310_WriteCommand(0x29);
}
```
需要注意的是,`NT35310_WriteCommand()`和`NT35310_WriteData()`是NT35310 LCD屏幕的写命令和写数据函数,需要根据具体的硬件实现进行编写。同时,代码中的延时时间需要根据具体的硬件实现进行调整。