rewrite main loop
[teensytas.git] / pkts.h
1
2 enum tas_pkt_type {
3         PKT_FIXED_STATE      = 0xef01,
4         PKT_STREAM_ENABLE    = 0xef02,
5         PKT_STREAM_REQ       = 0xef03,
6         PKT_STREAM_DATA_TO   = 0xef04,
7         PKT_STREAM_DATA_FROM = 0xef05,
8         PKT_STREAM_END       = 0xef06,
9         PKT_STREAM_ABORT     = 0xef07,
10 };
11
12 struct tas_pkt {
13         uint16_t type;
14         uint16_t size; // for DATA_FROM/TO
15         union {
16                 uint8_t data[60];
17                 struct {
18                         uint32_t frame; // just fyi
19                 } req;
20                 struct {
21                         uint8_t stream_to;
22                         uint8_t stream_from;
23                         // frame increment on read
24                         uint8_t use_readinc;
25                 } enable;
26         };
27 } __attribute__((packed));