HT1621B液晶驱动(附电路图)

最近做了一个项目用到了HT1621,电路图+datasheet+code


HT1621B datasheet

HT1621B液晶驱动(附电路图)_第1张图片

#include "ht1621.h"


void ht1621_send_high_order_data(UCHAR data, UCHAR len)
{
	UCHAR i;

	for (i=0; i>= 1;
	}
}

void ht1621_send_cmd(UCHAR command)
{
	Set_Port_Val(HT_CS, 0);	
	ht1621_send_high_order_data(0x80, 4);
	ht1621_send_high_order_data(command, 8);
	Set_Port_Val(HT_CS, 1);	
}

void ht1621_write(UCHAR addr, UCHAR data)
{
	Set_Port_Val(HT_CS, 0);
	ht1621_send_high_order_data(0xA0, 3);
	ht1621_send_high_order_data(addr<<2, 6);
	ht1621_send_low_order_data(data, 8);
	Set_Port_Val(HT_CS, 1);
}

void ht1621_write_all(UCHAR addr, UCHAR *p, UCHAR len)
{
	UCHAR i;
	
	Set_Port_Val(HT_CS, 0);
	ht1621_send_high_order_data(0xA0, 3);
	ht1621_send_high_order_data(addr<<2, 6);
	
	for (i=0; i

#ifndef _HT1621_H
#define _HT1621_H


#define HT_BISA_COM			0x52		//(1<<1) | (0<<3) | (1<<4) | (0<<5) | (1<<6) | (0<<7) | (0<<8) | (0<<9) | (0<<10) | (1<<11)
#define HT_LCD_OFF			0x04		//(0<<1) | (1<<2) | (0<<4) | (0<<5) | (0<<6) | (0<<7) | (0<<8) | (0<<9) | (0<<10) | (1<<11)
#define HT_LCD_ON			0x06		//(1<<1) | (1<<2) | (0<<4) | (0<<5) | (0<<6) | (0<<7) | (0<<8) | (0<<9) | (0<<10) | (1<<11)
#define HT_WRITE_CMD		0x80		//(0<<0) | (0<<1) | (1<<2)  | (0<<3) | (1<<4) | (0<<5) | (1<<6) | (0<<7) | (1<<8)
#define HT_WRITE_DATA		0xA0
#define HT_SYS_EN			0x02
#define HT_RCOSC			0x30


#endif




你可能感兴趣的:(LCD,MCU,HT1621B,单片机,嵌入式系统,单片机,LCD,HT1621B)