diff options
| author | hathach <[email protected]> | 2025-07-02 18:18:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-07-02 18:18:52 +0700 |
| commit | cf3966efd9fc552d641ea1e76e5aaad3ace3afd2 (patch) | |
| tree | d59add439dcbfcd6e2cd9fec9aaecc413e5b5509 /src/class/cdc/cdc_device.h | |
| parent | f10467e711017fb05a6e0ee496e451e2e8834549 (diff) | |
| parent | 963971c6aa14411f0cc6f0c4f727d199c738e2a5 (diff) | |
Merge branch 'master' into fork/HiFiPhile/dcd_notif
Diffstat (limited to 'src/class/cdc/cdc_device.h')
| -rw-r--r-- | src/class/cdc/cdc_device.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/class/cdc/cdc_device.h b/src/class/cdc/cdc_device.h index 0f7dcc856..f6fa5abf8 100644 --- a/src/class/cdc/cdc_device.h +++ b/src/class/cdc/cdc_device.h @@ -48,14 +48,24 @@ //--------------------------------------------------------------------+ // Driver Configuration //--------------------------------------------------------------------+ - typedef struct TU_ATTR_PACKED { - uint8_t rx_persistent : 1; // keep rx fifo on bus reset or disconnect - uint8_t tx_persistent : 1; // keep tx fifo on bus reset or disconnect -} tud_cdc_configure_fifo_t; + uint8_t rx_persistent : 1; // keep rx fifo data even with bus reset or disconnect + uint8_t tx_persistent : 1; // keep tx fifo data even with reset or disconnect + uint8_t tx_overwritabe_if_not_connected : 1; // if not connected, tx fifo can be overwritten +} tud_cdc_configure_t; + +#define TUD_CDC_CONFIGURE_DEFAULT() { \ + .rx_persistent = 0, \ + .tx_persistent = 0, \ + .tx_overwritabe_if_not_connected = 1, \ +} + +// Configure CDC driver behavior +bool tud_cdc_configure(const tud_cdc_configure_t* driver_cfg); -// Configure CDC FIFOs behavior -bool tud_cdc_configure_fifo(tud_cdc_configure_fifo_t const* cfg); +// Backward compatible +#define tud_cdc_configure_fifo_t tud_cdc_configure_t +#define tud_cdc_configure_fifo tud_cdc_configure //--------------------------------------------------------------------+ // Application API (Multiple Ports) i.e. CFG_TUD_CDC > 1 |
