diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-05-27 08:23:21 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-05-27 08:23:21 +0200 |
commit | f4868604384908a7477cbb4b544c6ee7aac2a883 (patch) | |
tree | 53b7df9dd58d49db5d3640f01a4cc600d088f655 /proto | |
parent | fb37e47bc13912a8d94bf1b3b7aa8456601f317a (diff) |
quickly implement some pseudo handlers for the remaining commands
Diffstat (limited to 'proto')
-rw-r--r-- | proto/puzbusv1.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/proto/puzbusv1.h b/proto/puzbusv1.h index 0985b2b..9f4f8e5 100644 --- a/proto/puzbusv1.h +++ b/proto/puzbusv1.h @@ -64,6 +64,25 @@ void pb_read_reset(struct pb_msg * target); */ bool pb_write(const struct pb_msg * target, char ** buf, size_t * buf_sz); +/** + * \brief I^2^C puzzle bus command types + * + * The first byte of a puzzle bus message's data indicates the command type. + */ +enum pb_cmd { + PB_CMD_READ, //!< read a puzzle module property + PB_CMD_WRITE, //!< write to a puzzle module property + // PB_CMD_UPDATE, //!< request an update +}; + +/** \brief Puzzle bus global states */ +enum pb_global_state { + PB_GS_NOINIT, //!< uninitialized (only used by puzzle modules) + PB_GS_IDLE, //!< puzzle not started yet + PB_GS_PLAYING, //!< puzzle actively being solved + PB_GS_SOLVED, //!< puzzle completed +}; + #ifdef __cplusplus } #endif |