/* Driver for ETAS GmbH ES58X USB CAN(-FD) Bus Interfaces. * * File es58x_fd.h: Definitions and declarations specific to ETAS * ES582.1 and ES584.1 (naming convention: we use the term "ES58X FD" * when referring to those two variants together). * * Copyright (c) 2019 Robert Bosch Engineering and Business Solutions. All rights reserved. * Copyright (c) 2020 ETAS K.K.. All rights reserved. * Copyright (c) 2020, 2021 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
*/
struct es58x_fd_tx_can_msg {
u8 packet_idx;
__le32 can_id;
u8 flags; union {
u8 dlc; /* Only if cmd_id is ES58X_FD_CMD_TYPE_CAN */
u8 len; /* Only if cmd_id is ES58X_FD_CMD_TYPE_CANFD */
} __packed;
u8 data[CANFD_MAX_DLEN];
} __packed;
struct es58x_fd_rx_can_msg {
__le64 timestamp;
__le32 can_id;
u8 flags; union {
u8 dlc; /* Only if cmd_id is ES58X_FD_CMD_TYPE_CAN */
u8 len; /* Only if cmd_id is ES58X_FD_CMD_TYPE_CANFD */
} __packed;
u8 data[CANFD_MAX_DLEN];
} __packed;
struct es58x_fd_tx_ack_msg {
__le32 rx_cmd_ret_le32; /* type enum es58x_cmd_ret_code_u32 */
__le16 tx_free_entries; /* Number of remaining free entries in the device TX queue */
} __packed;
/** * struct es58x_fd_urb_cmd - Commands received from or sent to the * ES58X FD device. * @SOF: Start of Frame. * @cmd_type: Command Type (type: enum es58x_fd_cmd_type). The CRC * calculation starts at this position. * @cmd_id: Command ID (type: enum es58x_fd_cmd_id). * @channel_idx: Channel index starting at 0. * @msg_len: Length of the message, excluding CRC (i.e. length of the * union). * @tx_conf_msg: Channel configuration. * @tx_can_msg_buf: Concatenation of Tx messages. Type is "u8[]" * instead of "struct es58x_fd_tx_msg[]" because the structure * has a flexible size. * @rx_can_msg_buf: Concatenation Rx messages. Type is "u8[]" instead * of "struct es58x_fd_rx_msg[]" because the structure has a * flexible size. * @echo_msg: Array of echo messages (e.g. Tx messages being looped * back). * @rx_event_msg: Error or event message. * @tx_ack_msg: Tx acknowledgment message. * @timestamp: Timestamp reply. * @rx_cmd_ret_le32: Rx 32 bits return code (type: enum * es58x_cmd_ret_code_u32). * @raw_msg: Message raw payload. * @reserved_for_crc16_do_not_use: The structure ends with a * CRC16. Because the structures in above union are of variable * lengths, we can not predict the offset of the CRC in * advance. Use functions es58x_get_crc() and es58x_set_crc() to * manipulate it.
*/ struct es58x_fd_urb_cmd {
__le16 SOF;
u8 cmd_type;
u8 cmd_id;
u8 channel_idx;
__le16 msg_len;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.