Skip to content

Commit

Permalink
Boring documentation of message types.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhowse committed Dec 6, 2012
1 parent e0af24f commit b17f354
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion arduino/micro/msgtypes.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,53 @@
/* Message breakdowns are structured like this:
0xABCDEFGH
A - Message type,
B - Message size,
C - First nibble,
D - Second nibble
Etcetera.
*/

#define A_STATUS 0
// A - A_STATUS
// B - Length: 1
// C - Analogue pin number, starting at 0
// D - State as per A_SHORT, etc, below
#define A_RAW 1
// A - A_RAW
// B - Length: 2
// C - Analogue pin number, starting at 0
// DEF - Raw analogue value, 0-1023
#define D_STATUS 2
// A - D_STATUS
// B - Length: 1
// C - Digital pin number, starting at 0
// D - 0 or 1
#define CARD_NUM 3
// A - CARD_NUM
// B - Length: Varies
// C... - Raw card data.
#define D_SET 4
// A - D_SET
// B - Length: 1
// C - Digital pin number, starting at 0
// D - 0 or 1
#define D_PULSE 5
// A - D_PULSE
// B - Length: 1
// C - Digital pin number, starting at 0
// D - Padding: 0
// EFGHIJKL - unsigned long, pulse duration in milliseconds.
#define EEPROM_SET 6
// A - EEPROM_SET
// B - Length: Varies
// C - High byte of EEPROM address
// D - Low byte of EEPROM address
// E... - Value to write to EEPROM
#define MORE_MSG 7

// A - MORE_MSG
// B - Length: 0

// These aren't message types per se, they're analogue point states
#define A_SHORT 0
Expand Down

0 comments on commit b17f354

Please sign in to comment.