diff options
| author | Ha Thach <[email protected]> | 2021-08-13 14:36:45 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-13 14:36:45 +0700 |
| commit | ea1dfc1fd598c825cb31e4bef0173cdbd1524b11 (patch) | |
| tree | 471b83b96b1b843fed48441cdbfbd27e39df136b /examples/device | |
| parent | 63f7dfeb8ed006b0c0b252b26109cd68aabc7e25 (diff) | |
| parent | 2e0d7e87d07346dc1abeeac279c7e7003630ce5a (diff) | |
Merge pull request #956 from kkitayam/fix_audio_format_for_renesas_rx
add settings for Renesas RX family
Diffstat (limited to 'examples/device')
| -rw-r--r-- | examples/device/uac2_headset/src/main.c | 4 | ||||
| -rw-r--r-- | examples/device/uac2_headset/src/tusb_config.h | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/examples/device/uac2_headset/src/main.c b/examples/device/uac2_headset/src/main.c index ba27350b4..790af088f 100644 --- a/examples/device/uac2_headset/src/main.c +++ b/examples/device/uac2_headset/src/main.c @@ -35,7 +35,11 @@ //--------------------------------------------------------------------+ // List of supported sample rates +#if defined(__RX__) +const uint32_t sample_rates[] = {44100, 48000}; +#else const uint32_t sample_rates[] = {44100, 48000, 88200, 96000}; +#endif uint32_t current_sample_rate = 44100; #define N_SAMPLE_RATES TU_ARRAY_SIZE(sample_rates) diff --git a/examples/device/uac2_headset/src/tusb_config.h b/examples/device/uac2_headset/src/tusb_config.h index d955a746d..e8d93f56a 100644 --- a/examples/device/uac2_headset/src/tusb_config.h +++ b/examples/device/uac2_headset/src/tusb_config.h @@ -100,7 +100,11 @@ extern "C" { #define CFG_TUD_AUDIO_FUNC_1_N_FORMATS 2 // Audio format type I specifications +#if defined(__RX__) +#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 48000 // 16bit/48kHz is the best quality for Renesas RX +#else #define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 96000 // 24bit/96kHz is the best quality for full-speed, high-speed is needed beyond this +#endif #define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1 #define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX 2 @@ -110,11 +114,19 @@ extern "C" { #define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_RX 2 #define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX 16 +#if defined(__RX__) +// 8bit in 8bit slots +#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX 1 +#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_TX 8 +#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_RX 1 +#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX 8 +#else // 24bit in 32bit slots #define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX 4 #define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_TX 24 #define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_RX 4 #define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX 24 +#endif // EP and buffer size - for isochronous EP´s, the buffer and EP size are equal (different sizes would not make sense) #define CFG_TUD_AUDIO_ENABLE_EP_IN 1 |
