MAX31855K 驱动 #include "MAX31855K.h"
***it SO =P1^0; //P3.6口与SO相连
***it SCK = P1^2; //P3.4口与SCK相连
***it CS =P1^1; //P3.5口与CS相连
***it SO1 =P1^5; //P3.6口与SO相连
***it SCK1 = P1^3; //P3.4口与SCK相连
***it CS1 =P1^4; //P3.5口与CS相连
//读取MAX31855K内存器
unsigned int MAX31855K_ReadReg(void)
{
unsigned chari;
unsigned intdat;
i =0;
dat = 0;
CS =0;
SCK = 0;
for(i=0;i<16; i++) //getD15-D0 from 6675
{
SCK = 1;
dat = dat<<1;
if( SO==1 )
dat = dat|0x01;
SCK = 0;
}
CS = 1;
returndat;
}
unsigned int MAX31855K_ReadReg1(void)
{
unsigned chari;
unsigned intdat;
i =0;
dat = 0;
CS1 = 0;
SCK1 = 0;
for(i=0;i<16; i++) //getD15-D0 from 6675
{
SCK1 = 1;
dat = dat<<1;
if( SO1==1 )
dat = dat|0x01;
SCK1 = 0;
}
CS1 = 1;
returndat;
}
#ifndef __MAX31855K_H_
#define __MAX31855K_H_
#include "reg52.h"
#include "intrins.h"
unsigned int MAX31855K_ReadReg(void);
unsigned int MAX31855K_ReadReg1(void);
#endif LCD 驱动 #include "lcd.h"
/*******************************************************************************
|