grainuum: add support libraries

Add supporting files for grainuum.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
2019-01-01 23:31:51 +08:00
parent 397d153a44
commit 249c289aa7
5 changed files with 351 additions and 12 deletions

View File

@ -42,6 +42,8 @@
#define GRAINUUM_STATE_EXTRA
#endif /* GRAINUUM_STATE_EXTRA */
#define GRAINUUM_PACKET_SIZE_MAX 64
/**
* @brief Extra fields for GrainuumUSB struct.
* @note Use this to store context and thread information.
@ -152,9 +154,9 @@ struct usb_packet {
union {
struct {
uint8_t pid;
uint8_t data[10]; /* Including CRC */
uint8_t data[GRAINUUM_PACKET_SIZE_MAX + 2]; /* Including CRC */
} __attribute((packed, aligned(4)));
uint8_t raw_data[11];
uint8_t raw_data[GRAINUUM_PACKET_SIZE_MAX + 3];
} __attribute((packed, aligned(4)));
uint8_t size; /* Not including pid (so may be 0) */
/* Checksum omitted */