icE1usb fw: Misc cosmetic cleanup in e1.{c,h} / usb_e1.c
Moving things around, comments, spacing, ... nothing functional.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Icc2a6ef6b03c89dd92e661a01d219e42dbf7067d
diff --git a/firmware/ice40-riscv/icE1usb/e1.h b/firmware/ice40-riscv/icE1usb/e1.h
index 4cbb6e5..9ceffdd 100644
--- a/firmware/ice40-riscv/icE1usb/e1.h
+++ b/firmware/ice40-riscv/icE1usb/e1.h
@@ -7,6 +7,9 @@
#pragma once
+
+/* control */
+
void e1_init(uint16_t rx_cr, uint16_t tx_cr);
void e1_poll(void);
void e1_debug_print(bool data);
@@ -14,6 +17,17 @@
void e1_tx_config(uint16_t cr);
void e1_rx_config(uint16_t cr);
+
+/* data flow */
+
+unsigned int e1_rx_need_data(unsigned int usb_addr, unsigned int max_len, unsigned int *pos);
+unsigned int e1_tx_feed_data(unsigned int usb_addr, unsigned int len);
+unsigned int e1_tx_level(void);
+unsigned int e1_rx_level(void);
+
+
+/* error reporting */
+
#define E1_ERR_F_ALIGN_ERR 0x01
#define E1_ERR_F_LOS 0x02
#define E1_ERR_F_RAI 0x04
@@ -28,6 +42,9 @@
const struct e1_error_count *e1_get_error_count(void);
+
+/* external function provided by the platform; used by E1 driver to control LEDs */
+
enum e1_platform_led {
E1P_LED_GREEN = 0,
E1P_LED_YELLOW = 1,
@@ -40,6 +57,5 @@
E1P_LED_ST_BLINK_FAST = 3
};
-/* external function provided by the platform; used by E1 driver to control LEDs */
extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led,
enum e1_platform_led_state state);