2018-02-26 21:09:49 -08:00
|
|
|
#ifndef __CDBA_H__
|
|
|
|
|
#define __CDBA_H__
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#define __packed __attribute__((packed))
|
|
|
|
|
|
|
|
|
|
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
|
|
|
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
|
|
|
|
|
|
|
|
|
struct msg {
|
|
|
|
|
uint8_t type;
|
|
|
|
|
uint16_t len;
|
|
|
|
|
uint8_t data[];
|
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
MSG_SELECT_BOARD = 1,
|
|
|
|
|
MSG_CONSOLE,
|
|
|
|
|
MSG_HARDRESET,
|
|
|
|
|
MSG_POWER_ON,
|
|
|
|
|
MSG_POWER_OFF,
|
|
|
|
|
MSG_FASTBOOT_PRESENT,
|
|
|
|
|
MSG_FASTBOOT_DOWNLOAD,
|
|
|
|
|
MSG_FASTBOOT_BOOT,
|
|
|
|
|
MSG_STATUS_UPDATE,
|
|
|
|
|
MSG_VBUS_ON,
|
|
|
|
|
MSG_VBUS_OFF,
|
|
|
|
|
MSG_FASTBOOT_REBOOT,
|
2019-08-26 10:10:49 -07:00
|
|
|
MSG_SEND_BREAK,
|
2020-06-28 23:45:59 -07:00
|
|
|
MSG_LIST_DEVICES,
|
2020-06-29 01:01:01 -07:00
|
|
|
MSG_BOARD_INFO,
|
2024-01-01 15:25:02 +00:00
|
|
|
MSG_FASTBOOT_CONTINUE,
|
2018-02-26 21:09:49 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|