summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware/remote.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-10-18 23:47:05 +0200
committerMichael Buesch <mb@bu3sch.de>2008-10-18 23:47:05 +0200
commit4b0babc1b1daaece0d8de672f98adaf6cff5cdac (patch)
tree58c4bbac00ca8a76af06b006a392279ae6729907 /pressure_control/firmware/remote.h
parent4a914e8c559cd48173bed088e2122d1d35c8de9b (diff)
downloadcnc-4b0babc1b1daaece0d8de672f98adaf6cff5cdac.tar.xz
cnc-4b0babc1b1daaece0d8de672f98adaf6cff5cdac.zip
Add a loooot of stuff to pressure_control
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control/firmware/remote.h')
-rw-r--r--pressure_control/firmware/remote.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/pressure_control/firmware/remote.h b/pressure_control/firmware/remote.h
new file mode 100644
index 0000000..af18abf
--- /dev/null
+++ b/pressure_control/firmware/remote.h
@@ -0,0 +1,68 @@
+#ifndef REMOTE_H_
+#define REMOTE_H_
+
+#include <stdint.h>
+
+#include <avr/pgmspace.h>
+
+
+enum remote_message_id {
+ MSG_INVALID = 0, /* Discard me */
+ MSG_ERROR,
+ MSG_LOGMESSAGE,
+ MSG_PING,
+ MSG_PONG,
+ MSG_GET_CURRENT_PRESSURE,
+ MSG_CURRENT_PRESSURE,
+ MSG_GET_DESIRED_PRESSURE,
+ MSG_DESIRED_PRESSURE,
+ MSG_SET_DESIRED_PRESSURE,
+ MSG_GET_HYSTERESIS,
+ MSG_HYSTERESIS,
+ MSG_SET_HYSTERESIS,
+ MSG_GET_CONFIG_FLAGS,
+ MSG_CONFIG_FLAGS,
+ MSG_SET_CONFIG_FLAGS,
+};
+
+enum remote_message_error {
+ MSG_ERR_NONE = 0,
+ MSG_ERR_CHKSUM,
+};
+
+enum remote_message_config_flags {
+ CFG_FLAG_AUTOADJUST_ENABLE = 0,
+};
+
+struct remote_message {
+ uint8_t id;
+ uint8_t __padding0[3];
+
+ union {
+ struct {
+ uint8_t code;
+ } __attribute__((packed)) error;
+ struct {
+ char str[32];
+ } __attribute__((packed)) logmessage;
+ struct {
+ uint16_t mbar;
+ } __attribute__((packed)) pressure;
+ struct {
+ uint32_t flags;
+ } __attribute__((packed)) config;
+
+ uint8_t __padding1[32];
+ } __attribute__((packed));
+
+ uint16_t crc;
+} __attribute__((packed));
+
+
+void print_pgm(const prog_char *msg);
+#define print(string_literal) print_pgm(PSTR(string_literal))
+
+void remote_work(void);
+void remote_init(void);
+
+#endif /* REMOTE_H_ */
bues.ch cgit interface