You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
1.9 KiB
C++
110 lines
1.9 KiB
C++
//
|
|
// ±êÖ¾ÎïͨÐÅ - TFT£¨A/B£© - ZigBee
|
|
//
|
|
|
|
#include "TFTCommand.h"
|
|
|
|
TFTCommand::TFTCommand()
|
|
{
|
|
SetDevice(CommandData::Devices::TFT_A);
|
|
}
|
|
|
|
void TFTCommand::UsingA()
|
|
{
|
|
SetDevice(CommandData::Devices::TFT_A);
|
|
}
|
|
|
|
void TFTCommand::UsingB()
|
|
{
|
|
SetDevice(CommandData::Devices::TFT_B);
|
|
}
|
|
|
|
byte* TFTCommand::CMD_DisplaySpecPicture(byte no)
|
|
{
|
|
SetCommand(0x10, 0x00, no);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_PageUp()
|
|
{
|
|
SetCommand(0x10, 0x01);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_PageDown()
|
|
{
|
|
SetCommand(0x10, 0x02);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_AutoPaging()
|
|
{
|
|
SetCommand(0x10, 0x03);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_CarLicenseMode_1to3(byte d1, byte d2, byte d3)
|
|
{
|
|
SetCommand(0x20, d1, d2, d3);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_CarLicenseMode_4to6(byte d4, byte d5, byte d6)
|
|
{
|
|
SetCommand(0x21, d4, d5, d6);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_TimerOn()
|
|
{
|
|
SetCommand(0x30, 0x01);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_TimerOff()
|
|
{
|
|
SetCommand(0x30);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_TimerClear()
|
|
{
|
|
SetCommand(0x30, 0x02);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_DisplayHex(uint32_t hex)
|
|
{
|
|
if (hex >= 0xFFFFFF)
|
|
SetCommand(0x40, 0xFF, 0xFF, 0xFF);
|
|
else
|
|
{
|
|
byte d1 = ((hex > 0xFFFF) ? (hex / 0x10000) : 0x00);
|
|
hex -= (d1 * 0x10000);
|
|
byte d2 = ((hex > 0xFF) ? (hex / 0x100) : 0x00);
|
|
byte d3 = hex % 0x100;
|
|
SetCommand(0x40, d1, d2, d3);
|
|
}
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_DisplayDistence(uint16_t dis)
|
|
{
|
|
if (dis >= 0x999)
|
|
SetCommand(0x50, 0x00, 0x09, 0x99);
|
|
else
|
|
{
|
|
byte d1 = ((dis > 0x99) ? (dis / 0x100) : 0);
|
|
dis -= (d1 * 0x100);
|
|
byte d2 = dis % 0x100;
|
|
SetCommand(0x50, 0x00, d1, d2);
|
|
}
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* TFTCommand::CMD_DisplayTrafficSign(TrafficSign sign)
|
|
{
|
|
SetCommand(0x60, (byte)sign);
|
|
return GetCommandArray();
|
|
}
|