Skip to content

Commit

Permalink
Merge pull request #854 from hathach/more-housekeeping
Browse files Browse the repository at this point in the history
More housekeeping
  • Loading branch information
hathach committed May 27, 2021
2 parents 4e2684f + 7c66c51 commit 81d238b
Show file tree
Hide file tree
Showing 54 changed files with 155 additions and 176 deletions.
10 changes: 9 additions & 1 deletion CONTRIBUTORS.md
Expand Up @@ -25,6 +25,10 @@
- Improve Audio driver and add uac2_headset example
- Improve STM32 Synopsys DCD with various PRs

- **[J McCarthy](https://github.com/xmos-jmccarthy)**
- Add new DFU 1.1 class driver
- Add new example for dfu

- **[Kamil Tomaszewski](https://github.com/kamtom480)**
- Add new DCD port for **Sony CXD56** (spresnese board)

Expand Down Expand Up @@ -53,10 +57,14 @@

- **[Raspberry Pi Team](https://github.com/raspberrypi)**
- Add new DCD port for **Raspberry Pi RP2040**
- Add new HCD port for **Raspberry Pi RP2040**

- **[Reinhard Panhuber](https://github.com/PanRe)**
- Add new class driver for **USB Audio Class 2.0 (UAC2)**
- Enhance tu_fifo with unmasked pointer, which better support DMA
- Rework tu_fifo with unmasked pointer, add DMA support, and constant address support
- Add new DCD/USBD edpt_xfer_fifo() API for optimizing endpoint transfer
- Add and greatly improve Isochronous transfer
- Add new audio examples: audio_test and audio_4_channel_mic

- **[Scott Shawcroft](https://github.com/tannewt)**
- Add new DCD port for **SAMD21 and SAMD51**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -77,7 +77,7 @@ Supports multiple device configurations by dynamically changing usb descriptors.

TinyUSB is completely thread-safe by pushing all ISR events into a central queue, then process it later in the non-ISR context task function. It also uses semaphore/mutex to access shared resources such as CDC FIFO. Therefore the stack needs to use some of OS's basic APIs. Following OSes are already supported out of the box.

- **No OS** : Disabling USB IRQ is used as way to provide mutex
- **No OS**
- **FreeRTOS**
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its [own repo](https://github.com/hathach/mynewt-tinyusb-example)

Expand Down
63 changes: 55 additions & 8 deletions docs/changelog.md
Expand Up @@ -2,18 +2,65 @@

## WIP

- Add new port Silabs EFM32GG12, board EFM32GG12 Thunderboard Kit (SLTB009A)
- Add new port Renesas RX63N, board GR-CITRUS
- MIDI
- Fix MIDI buffer overflow issue
- Rework tu_fifo_t with separated mutex for read and write, better support DMA with read/write buffer info. And constant address mode
- Improve audio_test example and add audio_4_channel_mic example
- Add new dfu example
- Remove pico-sdk from submodule

### Device Controller Driver (DCD)

- Add new DCD port for Silabs EFM32GG12 with board Thunderboard Kit (SLTB009A)
- Add new DCD port Renesas RX63N, board GR-CITRUS
- Add new (optional) endpoint API dcd_edpt_xfer_fifo
- Fix build with nRF5340
- Fix build with lpc15 and lpc54
- Fix build with lpc177x_8x
- STM32 Synopsys: greatly improve Isochronous transfer with edpt_xfer_fifo API
- Support LPC55 port1 highspeed
- Add support for Espressif esp32s3
- nRF: fix race condition that could cause drop packet of Bulk OUT transfer

### USB Device Driver (USBD)

- Add new (optional) endpoint ADPI usbd_edpt_xfer_fifo

### Device Class Driver

CDC

- [Breaking] tud_cdc_peek(), tud_vendor_peek() dropped position parameter. If needed, tu_fifo_get_read_info() can be used to peek at random offset.

DFU

- Add new DFU 1.1 class driver (WIP)

HID

- Fix keyboard report descriptor template
- Add more hid keys constant from 0x6B to 0xA4
- [Breaking] rename API
- HID_PROTOCOL_NONE/KEYBOARD/MOUST to HID_ITF_PROTOCOL_NONE/KEYBOARD/MOUSE
- tud_hid_boot_mode() to tud_hid_get_protocol()
- tud_hid_boot_mode_cb() to tud_hid_set_protocol_cb()

MIDI

- Fix MIDI buffer overflow issue
- [Breaking] rename API
- Rename tud_midi_read() to tud_midi_stream_read()
- Rename tud_midi_write() to tud_midi_stream_write()
- Rename tud_midi_receive() to tud_midi_packet_read()
- Rename tud_midi_send() to tud_midi_packet_write()
- New board stm32f072-eval
- Breaking changes
- tud_cdc_peek(), tud_vendor_peek() dropped position parameter. If needed, tu_fifo_get_read_info() can be used to peek
at random offset.

### Host Controller Driver (HCD)

### USB Host Driver (USBH)

### Host Class Driver

HID

- Rework host hid driver, basically everything changes

## 0.9.0 - 2021.03.12

Expand Down
9 changes: 5 additions & 4 deletions src/class/audio/audio_device.c
Expand Up @@ -55,9 +55,10 @@
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
#include "device/usbd.h"
#include "device/usbd_pvt.h"

#include "audio_device.h"
//#include "common/tusb_fifo.h"

//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
Expand Down Expand Up @@ -548,7 +549,7 @@ static bool audiod_rx_done_cb(uint8_t rhport, audiod_function_t* audio, uint16_t
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
#else
// Data is already placed in EP FIFO, schedule for next receive
TU_VERIFY(usbd_edpt_iso_xfer(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
#endif

#endif
Expand Down Expand Up @@ -852,7 +853,7 @@ static bool audiod_tx_done_cb(uint8_t rhport, audiod_function_t * audio)
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_in, audio->lin_buf_in, n_bytes_tx));
#else
// Send everything in ISO EP FIFO
TU_VERIFY(usbd_edpt_iso_xfer(rhport, audio->ep_in, &audio->ep_in_ff, n_bytes_tx));
TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_in, &audio->ep_in_ff, n_bytes_tx));
#endif

#endif
Expand Down Expand Up @@ -1611,7 +1612,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
#if USE_LINEAR_BUFFER_RX
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
#else
TU_VERIFY(usbd_edpt_iso_xfer(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
#endif
}

Expand Down
4 changes: 0 additions & 4 deletions src/class/audio/audio_device.h
Expand Up @@ -28,10 +28,6 @@
#ifndef _TUSB_AUDIO_DEVICE_H_
#define _TUSB_AUDIO_DEVICE_H_

#include "assert.h"
#include "common/tusb_common.h"
#include "device/usbd.h"

#include "audio.h"

//--------------------------------------------------------------------+
Expand Down
1 change: 0 additions & 1 deletion src/class/bth/bth_device.c
Expand Up @@ -32,7 +32,6 @@
// INCLUDE
//--------------------------------------------------------------------+
#include "bth_device.h"
#include <common/tusb_types.h>
#include <device/usbd_pvt.h>

//--------------------------------------------------------------------+
Expand Down
4 changes: 3 additions & 1 deletion src/class/cdc/cdc_device.c
Expand Up @@ -28,9 +28,11 @@

#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_CDC)

#include "cdc_device.h"
#include "device/usbd.h"
#include "device/usbd_pvt.h"

#include "cdc_device.h"

//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
Expand Down
1 change: 0 additions & 1 deletion src/class/cdc/cdc_device.h
Expand Up @@ -28,7 +28,6 @@
#define _TUSB_CDC_DEVICE_H_

#include "common/tusb_common.h"
#include "device/usbd.h"
#include "cdc.h"

//--------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion src/class/cdc/cdc_host.c
Expand Up @@ -28,7 +28,7 @@

#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_CDC)

#include "common/tusb_common.h"
#include "host/usbh.h"
#include "cdc_host.h"

//--------------------------------------------------------------------+
Expand Down
2 changes: 0 additions & 2 deletions src/class/cdc/cdc_host.h
Expand Up @@ -27,8 +27,6 @@
#ifndef _TUSB_CDC_HOST_H_
#define _TUSB_CDC_HOST_H_

#include "common/tusb_common.h"
#include "host/usbh.h"
#include "cdc.h"

#ifdef __cplusplus
Expand Down
4 changes: 3 additions & 1 deletion src/class/dfu/dfu_device.c
Expand Up @@ -28,9 +28,11 @@

#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU_MODE)

#include "dfu_device.h"
#include "device/usbd.h"
#include "device/usbd_pvt.h"

#include "dfu_device.h"

//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
Expand Down
2 changes: 0 additions & 2 deletions src/class/dfu/dfu_device.h
Expand Up @@ -27,8 +27,6 @@
#ifndef _TUSB_DFU_DEVICE_H_
#define _TUSB_DFU_DEVICE_H_

#include "common/tusb_common.h"
#include "device/usbd.h"
#include "dfu.h"

#ifdef __cplusplus
Expand Down
4 changes: 3 additions & 1 deletion src/class/dfu/dfu_rt_device.c
Expand Up @@ -28,9 +28,11 @@

#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU_RUNTIME)

#include "dfu_rt_device.h"
#include "device/usbd.h"
#include "device/usbd_pvt.h"

#include "dfu_rt_device.h"

//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
Expand Down
2 changes: 0 additions & 2 deletions src/class/dfu/dfu_rt_device.h
Expand Up @@ -27,8 +27,6 @@
#ifndef _TUSB_DFU_RT_DEVICE_H_
#define _TUSB_DFU_RT_DEVICE_H_

#include "common/tusb_common.h"
#include "device/usbd.h"
#include "dfu.h"

#ifdef __cplusplus
Expand Down
5 changes: 3 additions & 2 deletions src/class/hid/hid_device.c
Expand Up @@ -31,10 +31,11 @@
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
#include "common/tusb_common.h"
#include "hid_device.h"
#include "device/usbd.h"
#include "device/usbd_pvt.h"

#include "hid_device.h"

//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
Expand Down
2 changes: 0 additions & 2 deletions src/class/hid/hid_device.h
Expand Up @@ -27,8 +27,6 @@
#ifndef _TUSB_HID_DEVICE_H_
#define _TUSB_HID_DEVICE_H_

#include "common/tusb_common.h"
#include "device/usbd.h"
#include "hid.h"

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion src/class/hid/hid_host.c
Expand Up @@ -28,7 +28,7 @@

#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_HID)

#include "common/tusb_common.h"
#include "host/usbh.h"
#include "hid_host.h"

//--------------------------------------------------------------------+
Expand Down
7 changes: 0 additions & 7 deletions src/class/hid/hid_host.h
Expand Up @@ -24,14 +24,9 @@
* This file is part of the TinyUSB stack.
*/

/** \addtogroup ClassDriver_HID
* @{ */

#ifndef _TUSB_HID_HOST_H_
#define _TUSB_HID_HOST_H_

#include "common/tusb_common.h"
#include "host/usbh.h"
#include "hid.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -134,5 +129,3 @@ void hidh_close(uint8_t dev_addr);
#endif

#endif /* _TUSB_HID_HOST_H_ */

/** @} */ // ClassDriver_HID
5 changes: 3 additions & 2 deletions src/class/midi/midi_device.c
Expand Up @@ -31,10 +31,11 @@
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
#include "midi_device.h"
#include "class/audio/audio.h"
#include "device/usbd.h"
#include "device/usbd_pvt.h"

#include "midi_device.h"

//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
Expand Down
3 changes: 0 additions & 3 deletions src/class/midi/midi_device.h
Expand Up @@ -27,9 +27,6 @@
#ifndef _TUSB_MIDI_DEVICE_H_
#define _TUSB_MIDI_DEVICE_H_

#include "common/tusb_common.h"
#include "device/usbd.h"

#include "class/audio/audio.h"
#include "midi.h"

Expand Down
10 changes: 0 additions & 10 deletions src/class/msc/msc.h
Expand Up @@ -24,13 +24,6 @@
* This file is part of the TinyUSB stack.
*/

/** \ingroup group_class
* \defgroup ClassDriver_MSC MassStorage (MSC)
* @{ */

/** \defgroup ClassDriver_MSC_Common Common Definitions
* @{ */

#ifndef _TUSB_MSC_H_
#define _TUSB_MSC_H_

Expand Down Expand Up @@ -387,6 +380,3 @@ TU_VERIFY_STATIC(sizeof(scsi_write10_t) == 10, "size is not correct");
#endif

#endif /* _TUSB_MSC_H_ */

/// @}
/// @}
5 changes: 3 additions & 2 deletions src/class/msc/msc_device.c
Expand Up @@ -28,11 +28,12 @@

#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_MSC)

#include "common/tusb_common.h"
#include "msc_device.h"
#include "device/usbd.h"
#include "device/usbd_pvt.h"
#include "device/dcd.h" // for faking dcd_event_xfer_complete

#include "msc_device.h"

//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
Expand Down

0 comments on commit 81d238b

Please sign in to comment.