summaryrefslogtreecommitdiff
path: root/firmware/serial.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2018-04-21 16:21:48 +0200
committerjaseg <git@jaseg.net>2018-04-21 16:21:48 +0200
commit0c5b35fa3eecbe8c0035fdc5ca608a5c510df165 (patch)
tree2892e50a813959a178307958915fcd940bc1c8c7 /firmware/serial.h
parentddbb807e54245bd5b6686096827f4124ef196957 (diff)
downloadolsndot-0c5b35fa3eecbe8c0035fdc5ca608a5c510df165.tar.gz
olsndot-0c5b35fa3eecbe8c0035fdc5ca608a5c510df165.tar.bz2
olsndot-0c5b35fa3eecbe8c0035fdc5ca608a5c510df165.zip
Fix new packet-based comms protocol
Diffstat (limited to 'firmware/serial.h')
-rw-r--r--firmware/serial.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/serial.h b/firmware/serial.h
index 5066c43..94cfd57 100644
--- a/firmware/serial.h
+++ b/firmware/serial.h
@@ -27,7 +27,6 @@ void send_status_reply(void);
/* Internal low-level stuff */
void tx_char(uint8_t c);
void send_frame_formatted(uint8_t *buf, int len);
-volatile uint8_t *packet_received(int len);
/* Error counters for debugging */
extern unsigned int uart_overruns;
@@ -38,6 +37,10 @@ union tx_buf_union {
struct __attribute__((packed)) {
uint8_t firmware_version,
hardware_version;
+ uint8_t nbits;
+ uint8_t channel_spec;
+ uint8_t color_spec;
+ uint16_t nchannels;
uint32_t uptime_s,
uart_overruns,
frame_overruns,
@@ -45,6 +48,10 @@ union tx_buf_union {
int16_t vcc_mv,
temp_celsius;
} desc_reply;
+ struct __attribute__((packed)) {
+ uint32_t mac;
+ uint16_t device_type;
+ } device_type_reply;
uint8_t byte_data[0];
};
@@ -57,7 +64,7 @@ union rx_buf_union {
* |<----------------NBITS---------------->| |<>|--ignored
* | (MSB) brightness data (LSB) | |<>|--ignored
*/
- struct __attribute__((packed)) { uint32_t framebuf[32]; uint8_t end[0]; } set_fb_rq;
+ struct __attribute__((packed)) { uint16_t framebuf[32]; uint8_t end[0]; } set_fb_rq;
uint8_t byte_data[0];
uint32_t mac_data;
};