aboutsummaryrefslogtreecommitdiff
path: root/center_fw/8seg_protocol.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2019-04-17 16:32:43 +0900
committerjaseg <git@jaseg.net>2019-04-17 16:32:43 +0900
commit9eef62547efdf8e18009b6d6d6b3f7c80bf64e13 (patch)
tree8594db8c91ddc47614859e4eabbc9e7cf36d0d09 /center_fw/8seg_protocol.h
parentf6b959086671fb1bf8b2003d5c5384c7311a7735 (diff)
download8seg-9eef62547efdf8e18009b6d6d6b3f7c80bf64e13.tar.gz
8seg-9eef62547efdf8e18009b6d6d6b3f7c80bf64e13.tar.bz2
8seg-9eef62547efdf8e18009b6d6d6b3f7c80bf64e13.zip
center/fw: Add backchannel infrastructure
Untested!
Diffstat (limited to 'center_fw/8seg_protocol.h')
-rw-r--r--center_fw/8seg_protocol.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/center_fw/8seg_protocol.h b/center_fw/8seg_protocol.h
new file mode 100644
index 0000000..2da42c4
--- /dev/null
+++ b/center_fw/8seg_protocol.h
@@ -0,0 +1,26 @@
+#ifndef __8SEG_PROTOCOL_H__
+#define __8SEG_PROTOCOL_H__
+
+enum packet_type {
+ PKT_TYPE_RESERVED = 0,
+ PKT_TYPE_SET_OUTPUTS_BINARY = 1,
+ PKT_TYPE_SET_GLOBAL_BRIGHTNESS = 2,
+ PKT_TYPE_SET_OUTPUTS = 3,
+ PKT_TYPE_GET_STATUS = 4,
+ PKT_TYPE_MAX
+};
+
+struct status_tx {
+ int16_t temp_tenths_C;
+ uint32_t uptime_s;
+ uint32_t decoding_error_cnt, protocol_error_cnt;
+ int16_t vcc_mv, vin_mv, vskew_mv;
+ uint16_t jitter_meas_avg_ns;
+};
+
+extern void set_outputs(uint8_t val[8]);
+extern void set_outputs_binary(int mask, int global_brightness);
+
+void protocol_init(void);
+
+#endif /* __8SEG_PROTOCOL_H__ */