Commit Graph

1235 Commits

Author SHA1 Message Date
0686bd9369 Merge pull request #516 from PanRe/tusb_fifo_unmaksed_pointers
Tusb fifo unmaksed pointers
2020-10-06 00:01:51 +07:00
9c4aceaaa8 Merge pull request #518 from kasjer/kasjer/nrf5x-iso-support
nrf5x iso support
2020-10-02 21:17:24 +07:00
96da1ca4b8 nrf5x: Add support for ISO endpoints
ISO endpoints were not covered so far by the driver code.
This adds support for ISO IN and OUT endpoint handling.
Registers for ISO IN(OUT) endpoints are placed just after normal IN(OUT)
so in some cases common code could be used for handling all type of
transfers.
Generally code synchronizes ISO endpoint handling to SOF interrupt.
This code does not change the way of how non-ISO endpoints are treated.

Code uses strategy outlined in nRF52840 Produce Specification v1.0
sections 6.35.11.1 and 6.35.11.2.
2020-10-01 09:22:55 +02:00
6f5ee09511 nrf5x: Increase size of mps to 16 bits
msp stores max packet size.
For ISO endpoints 8 bits is not enough so it's changed to 16 bits.
2020-10-01 09:22:55 +02:00
fceb8853c7 nrf5x: Add dcd_edpt_close
Closing endpoints can be important when there are alternate
instances. This adds functionality of closing endpoints
similar to what exists in other drivers.
2020-10-01 09:22:55 +02:00
b2ce7a39b0 device: Make number of endpoints configurable
Currently number of endpoints was hard coded to 8.
NRF52 has 9 IN and 9 OUT endpoints.
ISO endpoints are 0x08 and 0x88 and without this change those
two ISO endpoint could not be used.
2020-10-01 09:22:49 +02:00
8dcb104933 Change modulo substitute to while ( idx >= depth) idx -= depth; 2020-09-26 11:00:31 +02:00
9ddcfc09d7 Fix wrong comments, rename pos to offset, rename overflow(). 2020-09-25 15:58:28 +02:00
52c9a467b4 Fix bug in modulo substitute. 2020-09-23 21:36:30 +02:00
9bdeafb295 Change maximum depth to 2^15 which allows for a fast modulo substitute.
Thus, however, overflows are detectable only for one time FIFO depth.
2020-09-23 20:48:03 +02:00
8b2c822557 Merge pull request #512 from mzero/fix-midi-sysex
Fix a bug in writing SysEx messages.
2020-09-23 11:23:53 +07:00
21299f90fa Final cleanup. 2020-09-19 11:46:43 +02:00
9dfb78e9d8 Tested, working. 2020-09-15 20:40:41 +02:00
62a76c0e04 nrf52: Fix edpt_dma_start() wrong condition check
Operator < used in while condition was obviously incorrect.
Loop starts with checking if unsigned variable is less then 0.
This condition is always false.

This reverses condition to follow intention of of the code.
2020-09-15 16:08:23 +02:00
745c15d5b5 Merge pull request #508 from hathach/fix-edpt-race
Fix edpt xfer race condition
2020-09-14 23:56:21 +07:00
349c0f640e Implementation done, yet to be tested. 2020-09-14 18:24:08 +02:00
9c0d15fc43 more const 2020-09-14 22:23:59 +07:00
23e6ee2ea2 cdc device: claim endpoint before checking fifo availability
- add pre-check to reduce mutex lock in usbd_edpt_claim
2020-09-14 22:14:31 +07:00
3b0216d3bf Update midi_device.c
Fix a bug in writing SysEx messages.

At the start of a new USB packet (4 bytes), while in the middle of a SysEx, the code mistakenly
set the buffer length to 4, not the target length. As a consequence, the 3rd and 4th bytes from
the last packet were included, after every byte of the SysEx after the first packet of three.

The fix is simple, as it was just a typo, as can bee seen from the other branches in the same
section of if/else statements: At the start of a new packet, the code should set up the target
length... the buffer length should be left at 2 (as set on line 180).
2020-09-13 15:05:18 -07:00
5931d19666 correct the TUD_HID_REPORT_DESC_GAMEPAD 2020-09-13 15:01:20 +07:00
1804dba615 typo 2020-09-12 08:48:49 +07:00
ce4a9b9c3a clean up 2020-09-11 00:14:07 +07:00
801f8b5b38 update claim edpt for hid and midi 2020-09-10 23:32:08 +07:00
ed6d48b81e typo 2020-09-09 16:45:54 +07:00
fe1b5dfa23 clean up 2020-09-09 16:29:45 +07:00
33f0a18523 update cdc edpt read 2020-09-09 16:25:31 +07:00
8b9893cada introduce optional usbd_edpt_claim, usbd_edpt_release which can be used to gain exclusive access to usbd_edpt_xfer 2020-09-09 15:48:11 +07:00
a8e538efe7 clean up 2020-09-04 01:35:32 +07:00
35aee4a6af more hid host work 2020-09-03 23:57:51 +07:00
ef651e0734 fix #449 remove obsolete pipehandle from hid host 2020-09-03 17:07:29 +07:00
1d83ad0ebb rename tuh_isr/hcd_isr to tuh_int_handler/hcd_int_handler 2020-09-03 13:12:25 +07:00
c492aef4c7 revert to use float-abi
define __USE_CMSIS instead of __USE_LPCOPEN will have startup enable FPU
on startup properly. Although it is only relevant to lpx43/40 series,
change all to __USE_CMSIS for consistency
2020-09-02 00:46:08 +07:00
84425c50b3 add more logging to host stack
tested host with lpc4357, don't use fpu with lpc m4 since it seems to
cause hardfault (stack does not make use of fpu anyway).
2020-09-01 19:16:50 +07:00
be708bb8a4 Merge branch 'master' into update-host 2020-09-01 12:02:25 +07:00
2d8787cdeb fix typo 2020-08-24 15:29:34 +07:00
a1b7e767af improve midi
- fix #436 tud_midi_rx_cb() not invoked
- fix xfer_cb() not handle ep in
- add ZLP if needed
2020-08-24 14:31:46 +07:00
19f08a02f6 Merge pull request #486 from kasjer/kasjer/add-endpoint-close-to-synopsys
Add dcd_edpt_close() to synopsys
2020-08-24 13:10:46 +07:00
9d3a9cf546 add OPT_MCU_SAMD11
skip ci build for example that need more ROM/RAM could fit into SAMD11
2020-08-22 18:46:19 +07:00
e5d622b749 Merge pull request #434 from gh2o/master
Add TX callback to CDC device
2020-08-21 11:14:06 +07:00
72183c7bb4 Slight optimization for cdc tx refill 2020-08-20 09:59:23 -07:00
15b063beb2 Smarter CDC TX refill logic 2020-08-20 02:20:01 -07:00
e8d50a3c57 Add dcd_edpt_close() to synopsys
Endpoint close was implemented only in one driver so far.
This function is needed for interfaces with several alternate settings.

The way FIFO is allocated in dcd_edpt_open() allows to correctly close
only one IN endpoint (the one that was opened last).
2020-08-14 14:29:35 +02:00
88c5e2a37f Fix synopsys fifo flush during stall
Wrong FIFO was flushed in dcd_edpt_stall().
(epnum - 1) should only be used when accessing DIEPTXF registers.

For DIEPCTL and GRSTCTL epnum is correct index.
2020-08-12 10:26:36 +02:00
61e96e97cb use usbd_edpt_open in bth driver 2020-08-11 22:09:16 +07:00
a9d362185b update note for app driver list mustbe accesible at all time. 2020-08-07 15:06:19 +07:00
01b9b77d3b allow application driver to overwrite built-in one
- position application driver before built-in
- remove dcd.h from public include.
2020-08-07 14:47:32 +07:00
9df8057702 Merge branch 'master' into add-app-driver 2020-08-07 12:13:13 +07:00
6f3378f71d Merge pull request #476 from kasjer/kasjer/fix-synopsys-fix-iso-frame-bit
Fix synopsys odd/even frame bit for IN ISO endpoints
2020-08-05 22:36:05 +07:00
e9aa36a6e8 Fix synopsys odd/even frame bit for IN ISO endpoints
For ISO endpoint driver has to specify when data
is to be transmitted (odd or even frame).
Currently code was not updating this bit resulting in
data being sent every other frame.
If interval was 1ms full data packed was sent every 2ms, and
ZLP was sent in between.
2020-08-04 09:32:41 +02:00
7d9efd0697 manually submit unplugged event for nrf dcd_disconnect() 2020-08-04 14:18:12 +07:00