-
Notifications
You must be signed in to change notification settings - Fork 0
/
Command.h
56 lines (44 loc) · 1.57 KB
/
Command.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
HA-1 Command.h
Copyright: Copyright (C) 2013 Mitsuru Nakada All Rights Reserved.
License: GNU GPL v2
*/
#ifndef __Command_h__
#define __Command_h__
typedef unsigned char byte;
static const byte CmdContinue = (1 << 7);
enum Command {
CmdGetVer = 0x01,
CmdBoot = 0x02,
CmdUpdate = 0x03,
CmdRebootFW = 0x04,
CmdEraseFW = 0x05,
CmdReadMemory = 0x08,
CmdReadFlash = 0x09,
CmdIRSend = 0x10 | CmdContinue,
CmdGPOCtrl = 0x11,
CmdHACtrl = 0x12,
CmdSWCtrl = 0x13,
CmdGetStatus = 0x14,
CmdLEDTape = 0x15,
CmdValidateHA2 = 0x16,
CmdGetADCData = 0x18,
CmdKeypadCtrl = 0x19,
CmdMotorCtrl = 0x1a,
CmdI2CWrite = 0x20,
CmdI2CRead = 0x21,
CmdRebootNotification = 0x80,
CmdBootModeNotification = 0x82,
CmdIRReceiveNotification = 0x90,
CmdStatusChangeNotification = 0x94,
CmdKeypadNotification = 0x99,
CmdMotorNotification = 0x9a,
};
static const byte SeqFinal = (1 << 7);
static const byte FlagSuccess = (0 << 7);
static const byte FlagError = (1 << 7);
static const byte RebootPowerOn = (1 << 0);
static const byte RebootReset = (1 << 1);
static const byte RebootLowVoltage = (1 << 2);
static const byte RebootWDT = (1 << 3);
#endif // __Command_h__