SmartOS/Drivers/74HC165.h

31 lines
545 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _74HC165_H_
#define _74HC165_H_
#include "Device\Port.h"
#include "Device\Power.h"
// 温湿度传感器
class IC74HC165
{
private:
OutputPort _PL;
OutputPort _SCK;
InputPort _In;
OutputPort _CE;
public:
bool Opened;
// pl采集cp时钟Q7输出ce使能
IC74HC165(Pin pl, Pin sck, Pin in, Pin ce = P0);
bool Open();
bool Close();
// 级联读取 buf,数据放置位置count级联ic数
bool Read(byte *buf, byte count);
// 读一个IC 的数据
byte Read();
};
#endif