资源简介
常用LCD驱动芯片ST7701SI SPI接口底层驱动配置代码
代码片段和文件信息
#include “ST7701SI.h“
#include “stm32f4xx_hal.h“
#include “stm32f4xx_hal_gpio.h“
#include
#include “delay.h“
void SPI_SendData(unsigned char i)
{
unsigned char n;
for(n=0; n<8; n++)
{
if(i&0x80) LCD_MOSI_HIGH();
else LCD_MOSI_LOW();
i<<= 1;
LCD_CLK_LOW();
delay_us(10);
LCD_CLK_HIGH();
delay_us(10);
}
}
void SPI_write_reg(unsigned int i)
{
LCD_CS_LOW();
LCD_MOSI_LOW();
LCD_CLK_LOW();
delay_us(10);
LCD_CLK_HIGH();
delay_us(10);;
SPI_SendData(i);
LCD_CS_HIGH();
}
void SPI_write_dat(unsigned char i)
{
LCD_CS_LOW();
LCD_MOSI_HIGH();
LCD_CLK_LOW();
delay_us(10);
LCD_CLK_HIGH();
delay_us(10);
SPI_SendData(i);
LCD_CS_HIGH();
}
void ST7701SI_init(void)
{
// HW_Reset();
delay_ms(120);
SPI_write_reg (0x11);//退出睡眠模式
delay_ms(120);
SPI_write_reg (0xFF);//使能Command2
SPI_write_dat (0x77);
SPI_write_dat (0x01);
SPI_write_dat (0x00);
SPI_write_dat (0x00);
SPI_write_dat (0x13);
SPI_write_reg (0xEF);//???
SPI_write_dat (0x08);
SPI_write_reg (0xFF);
SPI_write_dat (0x77);
SPI_write_dat (0x01);
SPI_write_dat (0x00);
SPI_write_dat (0x00);
SPI_write_dat (0x10);
SPI_write_reg (0xC0);//p268
SPI_write_dat (0x63);
SPI_write_dat (0x00);
SPI_write_reg (0xC1);//p269
SPI_write_dat (0x0C);
SPI_write_dat (0x02);
SPI_write_reg (0xC2);//p270
SPI_write_dat (0x01);
SPI_write_dat (0x07);
SPI_write_reg (0xCC);//???
SPI_write_dat (0x10);
SPI_write_reg (0xB0);//p260
SPI_write_dat (0xCD);
SPI_write_dat (0x18);
SPI_write_dat (0x1F);
SPI_write_dat (0x0F);
SPI_write_dat (0x13);
SPI_write_dat (0x08);
SPI_write_dat (0x09);
SPI_write_dat (0x08);
SPI_write_dat (0x08);
SPI_write_dat (0x24);
SPI_write_dat (0x03);
SPI_write_dat (0x10);
SPI_write_dat (0x0E);
SPI_write_dat (0x21);
SPI_write_dat (0x24);
SPI_write_dat (0x0B);
SPI_write_reg (0xB1);//p262
SPI_write_dat (0xC3);
SPI_write_dat (0x0F);
SPI_write_dat (0x18);
SPI_write_dat (0x0B);
SPI_write_dat (0x0F);
SPI_write_dat (0x05);
SPI_write_dat (0x09);
SPI_write_dat (0x09);
SPI_write_dat (0x08);
SPI_write_dat (0x24);
SPI_write_dat (0x06);
SPI_write_dat (0x13);
SPI_write_dat (0x13);
SPI_write_dat (0x28);
SPI_write_dat (0x2D);
SPI_write_dat (0x15);
SPI_write_reg (0xFF);//p200
SPI_write_dat (0x77);
SPI_write_dat (0x01);
SPI_write_dat (0x00);
SPI_write_dat (0x00);
SPI_write_dat (0x11);
SPI_write_reg (0xB0);//p260
SPI_write_dat (0x5D);
SPI_write_reg (0xB1);//p262
SPI_write_dat (0x3F);
SPI_write_reg (0xB2);
SPI_write_dat (0x82);
SPI_write_reg (0xB3);
SPI_write_dat (0x80);
SPI_write_reg (0xB5);
SPI_write_dat (0x45);
SPI_write_reg (0xB7);
SPI_write_dat (0x85);
SPI_write_reg (0xB8);
SPI_write_dat (0x21);
SPI_write_reg (0xB9);
SPI_write_dat (0x10);
SPI_write_dat (0x1F);
SPI_wri
- 上一篇:stm32库函数代码自动生成器V1.2
- 下一篇:stm32实现高精度频率测定
相关资源
- Proteus仿真:LCD液晶屏显示.rar
- stm32双机spi通信
- Arduino-LM35-LCD1602数字温度计实验.doc
- AVR单片机SPI通讯程序 (C语言源代码)
- SpiderMonkey1.61.7 编译文件全部libdllh文件
- spiht算法小波图像编码算法
- 变频器源码 DSPIC30F5015电机控制专用芯
- STM32 电子密码锁设计,LCD12864显示C语
- 网络爬虫 C++ Crawler Spider
- 《大棚温湿度自动控制系统》 包括
- STM32 RTC+LCD12864 实时时钟和闹钟实验
- FPGA nios驱动LCD12864实现uart以及菜单功
- ADS1118_SPI模式_STM32
- DSPIC数字信号控制器C程序开发及应用
- TFTLCD显示-电子钟-万年历-完整
- win sockket全局代理驱动(c++ spi)
- MyImg2Lcd4.0破解版
- TFTLCD显示屏专用取字模软件
- VC++Spin(旋转)控件用法
- MCU读写SPI FLASH W25X40 的程序
- max6675+热电偶测温程序
- STM32 LCD12864并口驱动实验 完整C语言代
- LCD1602显示实时温度代码STC15W4K56S4
- C语言LCD多级菜单(完整版)
- 原创:51单片机操作ds18b20ds1302,lcd1
- 4X4矩阵键盘+LCD1602显示
- AD电压采样 及LCD12864显示.rar
- STM32F3 LCD1602 I2C驱动代码 C语言
- dsPIC30系列编程
- 项目16 基于单片机LCD数字测速仪的设
评论
共有 条评论