7279.h
来自「单片机控制按键显示芯片HD7279A」· C头文件 代码 · 共 39 行
H
39 行
#include <reg51.h>
#ifndef _7279_
#define _7279_
#define uchar unsigned char
#define uint unsigned int
//****** I/O口定义 ******
sbit DAT = P2^2;
sbit KEY = P2^3;
sbit CS = P2^0;
sbit CLK = P2^1;
//****** HD7279A指令 ******
#define CMD_RESET 0xa4
#define CMD_TEST 0xbf
#define DECODE0 0x80
#define DECODE1 0xc8
#define CMD_READ 0x15
#define UNDECODE 0x90
#define RTL_CYCLE 0xa3
#define RTR_CYCLE 0xa2
#define RTL_UNCYL 0xa1
#define RTR_UNCYL 0xa0
#define ACTCTL 0x98
#define SEGON 0xe0
#define SEGOFF 0xc0
#define BLINKCTL 0x88
//****** 函数定义 ******
//void shortdelay();//8us
//void longdelay();//50us
void send7279(uchar ch);//写入一个字节
//uchar receive7279();//读出一个字节
void write7279(uchar cmd,uchar dta);//写一个命令,一个数据
uchar read7279(uchar cmd);//写一个命令,读出一个数据
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?