#define USLHCOM_TX_HEADER_SIZE sizeof(u_char)
#define SET_TRANSMIT_DATA(x) (x)
#define GET_RECEIVE_DATA(x) (x)
#define SET_DEVICE_RESET 0x40
#define GET_SET_UART_ENABLE 0x41
#define GET_UART_STATUS 0x42
#define SET_CLEAR_FIFOS 0x43
#define GET_GPIO_STATE 0x44
#define SET_GPIO_STATE 0x45
#define GET_VERSION 0x46
#define GET_SET_OTP_LOCK_BYTE 0x47
#define GET_SET_UART_CONFIG 0x50
#define SET_TRANSMIT_LINE_BREAK 0x51
#define SET_STOP_LINE_BREAK 0x52
#define DEVICE_RESET_VALUE 0x00
#define UART_DISABLE 0x00
#define UART_ENABLE 0x01
struct uslhcom_uart_status {
u_char tx_fifo[2];
u_char rx_fifo[2];
u_char error_status;
u_char break_status;
} __packed;
#define ERROR_STATUS_PARITY 0x01
#define ERROR_STATUS_OVERRUN 0x02
#define BREAK_STATUS 0x01
#define CLEAR_TX_FIFO 0x01
#define CLEAR_RX_FIFO 0x02
struct uslhcom_version_info {
u_char product_id;
u_char product_revision;
} __packed;
struct uslhcom_uart_config {
u_char baud_rate[4];
u_char parity;
u_char data_control;
u_char data_bits;
u_char stop_bits;
} __packed;
#define UART_CONFIG_BAUD_RATE_MIN 50
#define UART_CONFIG_BAUD_RATE_MAX 2000000
#define UART_CONFIG_PARITY_NONE 0x00
#define UART_CONFIG_PARITY_EVEN 0x01
#define UART_CONFIG_PARITY_ODD 0x02
#define UART_CONFIG_PARITY_MARK 0x03
#define UART_CONFIG_PARITY_SPACE 0x04
#define UART_CONFIG_DATA_CONTROL_NONE 0x00
#define UART_CONFIG_DATA_CONTROL_HARD 0x01
#define UART_CONFIG_DATA_BITS_5 0x00
#define UART_CONFIG_DATA_BITS_6 0x01
#define UART_CONFIG_DATA_BITS_7 0x02
#define UART_CONFIG_DATA_BITS_8 0x03
#define UART_CONFIG_STOP_BITS_1 0x00
#define UART_CONFIG_STOP_BITS_2 0x01