8255a.c
来自「KeilC开发,51通过8255对外部4*4键盘进行控制.按键分别为0-9以及上」· C语言 代码 · 共 37 行
C
37 行
#include <reg51.h>
#include <8255A.h>
sbit RST = P1^4;
void Init8255A()
{
int i;
i = 5000;
RST = 1;
while (i--);
RST = 0;
SelectForm0(0,0,0,0);
}
void SelectForm0(char A, char C1, char C2, char B)
{
char temp;
temp = 0x80;
temp = temp | A<<4 | C1<<3 | C2 | B<<1;
Commd = temp;
}
void SetCBit(char index, bit value)
{
char temp;
temp = index << 1;
if (value) temp++;
Commd = temp;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?