nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches
audio_rate_control.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
18
19#ifndef _AUDIO_RATE_CONTROL_H_
20#define _AUDIO_RATE_CONTROL_H_
21
22#include <stdint.h>
23#include <stdbool.h>
24
33
43
47struct audio_rate_control_cfg;
48
60 int (*initialize)(void);
61
69 int (*uninitialize)(void);
70
79 int (*reset)(void);
80
90 int (*cfg_set)(struct audio_rate_control_cfg const *const cfg);
91
101 int (*cfg_get)(struct audio_rate_control_cfg *cfg);
102
112 int (*update)(void *const control_val_u);
113};
114
122 /* Audio rate_control state */
124
125 /* Callbacks for the rate control implementation */
127};
128
137
147 struct audio_rate_control_cfg const *const cfg);
148
158 struct audio_rate_control_cfg *const cfg);
159
174int audio_rate_control_update(enum audio_rate_control_type type, void *const control_val_u);
175
185 struct audio_rate_control_ops const *const imp_ops);
186
198
207
211
212#endif /* _AUDIO_RATE_CONTROL_H_ */
int audio_rate_control_init(enum audio_rate_control_type type)
Initialize the registered audio rate control module.
int audio_rate_control_uninit(enum audio_rate_control_type type)
Uninitialize an audio rate control module.
audio_rate_control_type
Enumeration of possible audio rate control sources.
Definition audio_rate_control.h:37
@ AUDIO_PLL
Definition audio_rate_control.h:38
@ I2S
Definition audio_rate_control.h:40
@ AUDIO_RATE_CONTROL_TYPE_COUNT
Definition audio_rate_control.h:41
@ USB_ASYNC
Definition audio_rate_control.h:39
int audio_rate_control_register(enum audio_rate_control_type type, struct audio_rate_control_ops const *const imp_ops)
Register an audio rate control implementation for a specific type.
int audio_rate_control_cfg_get(enum audio_rate_control_type type, struct audio_rate_control_cfg *const cfg)
Get the configuration of an audio rate control module.
int audio_rate_control_update(enum audio_rate_control_type type, void *const control_val_u)
Update the error between timestamps for an audio rate control module.
int audio_rate_control_cfg_set(enum audio_rate_control_type type, struct audio_rate_control_cfg const *const cfg)
Configure an audio rate control after it has been initialized.
audio_rate_control_state
The state of the audio rate control.
Definition audio_rate_control.h:28
@ AUDIO_RATE_CONTROL_STATE_INITIALIZED
Definition audio_rate_control.h:31
@ AUDIO_RATE_CONTROL_STATE_UNINITIALIZED
Definition audio_rate_control.h:30
@ AUDIO_RATE_CONTROL_STATE_EMPTY
Definition audio_rate_control.h:29
int audio_rate_control_reset(enum audio_rate_control_type type)
Reset an audio rate control module back to the last valid configuration.
struct audio_rate_control_ops ops
Definition audio_rate_control.h:126
enum audio_rate_control_state state
Definition audio_rate_control.h:123
Audio rate control's private context.
Definition audio_rate_control.h:121
int(* cfg_get)(struct audio_rate_control_cfg *cfg)
Get the configuration of an active rate control implementation.
Definition audio_rate_control.h:101
int(* uninitialize)(void)
Uninitialize a rate control implementation.
Definition audio_rate_control.h:69
int(* reset)(void)
Reset a rate control module implementation back to the last valid configuration..
Definition audio_rate_control.h:79
int(* update)(void *const control_val_u)
Update the rate control value implementation.
Definition audio_rate_control.h:112
int(* cfg_set)(struct audio_rate_control_cfg const *const cfg)
Configure a rate control module after it has been initialized.
Definition audio_rate_control.h:90
int(* initialize)(void)
Initialize a rate control module implementation.
Definition audio_rate_control.h:60
Audio rate control's callback structure.
Definition audio_rate_control.h:52