Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration option CFG_TUH_CDC_FTDI_PID_LIST to tusb_option.h #2368

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/class/cdc/cdc_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static bool acm_set_baudrate(cdch_interface_t* p_cdc, uint32_t baudrate, tuh_xfe
#if CFG_TUH_CDC_FTDI
#include "serial/ftdi_sio.h"

static uint16_t const ftdi_pids[] = { TU_FTDI_PID_LIST };
static uint16_t const ftdi_pids[] = { CFG_TUH_CDC_FTDI_PID_LIST };
enum {
FTDI_PID_COUNT = sizeof(ftdi_pids) / sizeof(ftdi_pids[0])
};
Expand Down
5 changes: 1 addition & 4 deletions src/class/cdc/serial/ftdi_sio.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
#ifndef TUSB_FTDI_SIO_H
#define TUSB_FTDI_SIO_H

// VID/PID for matching FTDI devices
// VID for matching FTDI devices
#define TU_FTDI_VID 0x0403
#define TU_FTDI_PID_LIST \
0x6001, 0x6006, 0x6010, 0x6011, 0x6014, 0x6015, 0x8372, 0xFBFA, \
0xcd18

// Commands
#define FTDI_SIO_RESET 0 /* Reset the port */
Expand Down
6 changes: 6 additions & 0 deletions src/tusb_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,12 @@
#define CFG_TUH_CDC_FTDI 0
#endif

#ifndef CFG_TUH_CDC_FTDI_PID_LIST
// List of product IDs that can use the FTDI CDC driver
#define CFG_TUH_CDC_FTDI_PID_LIST \
0x6001, 0x6006, 0x6010, 0x6011, 0x6014, 0x6015, 0x8372, 0xFBFA, 0xCD18
#endif

#ifndef CFG_TUH_CDC_CP210X
// CP210X is not part of CDC class, only to re-use CDC driver API
#define CFG_TUH_CDC_CP210X 0
Expand Down