icE1usb fw: Expose error conditions from E1 driver

This will allow the USB interface code to report the errors to the
host PC.

Related: OS#4674
Change-Id: Iba3e00a2b28a2fef6dbd986bfc706c1619c3a3ed
diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h
index fcd4284..8ba9838 100644
--- a/firmware/ice40-riscv/icE1usb/e1.h
+++ b/firmware/ice40-riscv/icE1usb/e1.h
@@ -14,6 +14,19 @@
 void e1_tx_config(uint16_t cr);
 void e1_rx_config(uint16_t cr);
 
+#define E1_ERR_F_ALIGN_ERR	0x01
+#define E1_ERR_F_LOS		0x02
+
+struct e1_error_count {
+	uint16_t crc;
+	uint16_t align;
+	uint16_t ovfl;
+	uint16_t unfl;
+	uint8_t flags;
+};
+
+const struct e1_error_count *e1_get_error_count(void);
+
 volatile uint8_t *e1_data_ptr(int mf, int frame, int ts);
 unsigned int e1_data_ofs(int mf, int frame, int ts);