matrix.c

来自「16C554VX1128MAX4359-MAX4456P89LPC952 驱动」· C语言 代码 · 共 25 行

C
25
字号
#include <REG952.H>
#include <intrins.H>
#define uchar unsigned char
#define uint unsigned int

//*************************************************************************
//函数名: matrix_write
//功 能: 配置matrix输入输出通道
//入参数: out_put=输出通道,in_put=输入通道
//出参数: 无
//*************************************************************************
void matrix_write(uchar in_put, uchar out_put)
{	
	P5=P5&0x7f;   //CS=0,使能WR信号
	P5=out_put&0x7f;	 
	P0=in_put;
	P4=P4&0xbf;   //WR=0
	_nop_();
	_nop_();
	P4=P4|0x40;   //WR=1
	P4=P4&0x7f;   //LATCH=0 
	_nop_();
	_nop_();
	P4=P4|0x80;   //LATCH=1 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?