SmartOS/App/FlushPort.h

35 lines
766 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 __FlushPort_H__
#define __FlushPort_H__
#include "Kernel\Sys.h"
#include "Device\Port.h"
#include "Message\DataStore.h"
// 闪烁端口
// 默认慢闪Start后快闪一定时间-1时间表示一直快闪Stop停止
// 支持数据操作指令,参数为快闪毫秒数
class FlushPort : public IDataPort
{
private:
uint _tid;
public:
OutputPort* Port;
int Fast; // 快闪间隔默认50毫秒
int Slow; // 慢闪间隔默认1000毫秒
int Count; // 剩余快闪次数
FlushPort();
virtual ~FlushPort();
void Start(int ms = 1000);
// mode 0xff 为不改变Port状态 0为Write false 1为Write true
void Stop(byte mode = 0xff);
void Flush();
virtual int Write(byte* data);
};
#endif