diff options
| author | hathach <[email protected]> | 2022-05-19 16:05:55 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-05-19 16:05:55 +0700 |
| commit | e5113a1cfc25c0e5e7e75c2644ed91d252391c28 (patch) | |
| tree | c02e0991a2e594db6a5aaf86945c28632708a3b3 /src/class/audio/audio_device.h | |
| parent | 5766c9ac4ed3525b3223ad0751f871b08a1bb5fb (diff) | |
prototype for feedback method
Diffstat (limited to 'src/class/audio/audio_device.h')
| -rw-r--r-- | src/class/audio/audio_device.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/class/audio/audio_device.h b/src/class/audio/audio_device.h index e6d3b74e6..da4a45eee 100644 --- a/src/class/audio/audio_device.h +++ b/src/class/audio/audio_device.h @@ -498,6 +498,34 @@ static inline uint8_t tud_audio_get_fb_n_frames(); // return feedback value in 16.16 for reference (0 for error) uint32_t tud_audio_feedback_update(uint8_t func_id, uint32_t cycles); +enum { + AUDIO_FEEDBACK_METHOD_DISABLED, + AUDIO_FEEDBACK_METHOD_FREQUENCY_FIXED, + AUDIO_FEEDBACK_METHOD_FREQUENCY_FLOAT, + AUDIO_FEEDBACK_METHOD_FREQUENCY_POWER_OF_2, + AUDIO_FEEDBACK_METHOD_FIFO_COUNT_FIXED, + AUDIO_FEEDBACK_METHOD_FIFO_COUNT_FLOAT +}; + +typedef struct { + uint8_t method; + union { + struct { + uint32_t sample_freq; + uint32_t mclk_freq; + }frequency; + + struct { + uint32_t nominal; + uint32_t threshold; + // variation etc .. + }fifo_count; + }; +}audio_feedback_params_t; + + +// TU_ATTR_WEAK void tud_audio_feedback_params_cb(uint8_t func_id, uint8_t alt_itf, audio_feedback_params_t* feedback_param); + // mclk_freq : Main clock frequency in Hz i.e. master clock to which sample clock is locked // sample_freq : sample frequency in Hz // fixed_point : 0 float (default), 1 fixed point (for mcu without FPU) |
