18 Commits

Author SHA1 Message Date
Marc Kleine-Budde
151ec30d78 gs_usb: document switchable termination support 2022-09-29 10:10:53 +02:00
Jeroen Hofstee
9f07a4b223 use consistent whitespace
Use tabs for leading whitespace and spaces for continuation lines.
Besides that inconsistent whitespace looks odd, it causes unnecessary
merge conflicts.
2022-08-26 21:51:33 -04:00
Marc Kleine-Budde
b549cb768b gs_usb.h: document GS_CAN_FEATURE_BT_CONST_EXT and GS_USB_BREQ_BT_CONST_EXT
Some CAN-FD capable controllers have different bittiming constants for
arbitration phase and data phase to reach maximum performance at
higher speeds.
2022-01-12 09:21:30 -05:00
Marc Kleine-Budde
fea8b8603f gs_usb.h: document GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX
The documents a workaround for a NXP chip errata on LPC546xx
controllers (Errata sheet LPC546xx / USB.15).

According to the document corruption can occur when the following
conditions are met:
* A TX (IN) transfer happens after a RX (OUT) transfer.
* The RX (OUT) transfer length is 4 + N * 16 (N >= 0) bytes.

Even though the struct gs_host_frame has a size of 76 bytes for a FD
frame, which does not apply to the above rule, corruption could be
seen.

Adding a dummy byte to break the second condition also on transfer
lengths with 4 + N * 8 bytes reliably circumvents USB transfer data
corruption.

The firmware can now request this quirk by setting
GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX.
2022-01-12 09:21:30 -05:00
Marc Kleine-Budde
41f9e7d64f gs_usb.h: introduce CAN-FD support
The CANtact FD and other devices implement a gs-usb compatible USB
protocol. The protocol has been extended to support CAN-FD and the
changes on the Linux gs_usb driver will be mainlined soon.

This patch adds the new GS_CAN_MODE_*, GS_CAN_FEATURE_*,
GS_USB_BREQ_DATA_BITTIMING, and GS_CAN_FLAG_* bits as well as struct
gs_host_frame_canfd to the candlelight driver.

This is mainly for documentation purpose, as the STM32F042 and
STM32F072 don't support CAN-FD. But there are some ports to CAN-FD
capable STM32 µC that can make use of these definitions.

[1] https://github.com/linklayer/gs_usb_fd/issues/2
2022-01-12 09:21:30 -05:00
Marc Kleine-Budde
335dc50cd6 gs_usb.h: document used GS_CAN_MODE_* bits
The bits in GS_CAN_MODE_ correspond to the bits in GS_CAN_FEATURE_*.
This means the bits 5 and 6 of GS_CAN_MODE_ are not "free", document
this by adding a comment to the corresponding GS_CAN_FEATURE_*.
2022-01-12 09:21:30 -05:00
Jeroen Hofstee
7618128cf6 fix whitespace
The project uses tabs with a length of 4 spaces, and spaces for
continuation, so lets use that for the whole project. There are
many trailing whitespaces and empty lines here and there; get
rid of them as well.
2019-11-04 19:04:54 -05:00
Max Behensky
46b01339f5 Add new mode to pad output usb packets to max packet size for better WinUSB performance 2017-11-22 13:00:01 -08:00
Hubert Denkmair
37980fb2eb dummy implement user_id feature 2016-06-11 10:21:29 +02:00
Hubert Denkmair
6450f08b22 implement identify command 2016-06-03 15:02:24 +02:00
Hubert Denkmair
44431f4a43 use new feature bit and control request numbers for hardware timestamps 2016-05-14 21:49:56 +02:00
Hubert Denkmair
f4f47116cd hardware timestamp support via mode 2016-05-13 21:59:31 +02:00
Hubert Denkmair
56192e76f6 implement hardware timestamps on bulk pipes 2016-05-04 21:14:33 +02:00
Hubert Denkmair
38512d1a11 implement timestamp usb control requests 2016-05-04 20:52:12 +02:00
Hubert Denkmair
990c08cd2d add license info 2016-04-16 22:13:47 +02:00
Hubert Denkmair
01a40f66a1 generate linux error frames 2016-04-16 21:49:46 +02:00
Hubert Denkmair
e4011dec05 implement can tx/rx 2016-04-10 11:19:10 +02:00
Hubert Denkmair
70c41d0296 usb communication seems to work 2016-04-08 19:34:59 +02:00