void volume_set_fixed(int percent)
Override the pot with a fixed volume (for a deterministic measurement).
Definition volume.c:126
bool volume_poll(int *out_mv, uint8_t *out_level)
Sample the pot and write the active output only if the mapped level changed.
Definition volume.c:79
void volume_set_balance(int8_t steps)
Trim the L/R balance to compensate the analog imbalance (driver is independent L/R).
Definition volume.c:158
void volume_set_bt_handler(esp_err_t(*set_abs_vol)(uint8_t volume))
Register the Bluetooth absolute-volume setter (e.g. bluetooth_set_absolute_volume).
Definition volume.c:153
uint8_t volume_get_level(void)
The level that would be applied to the active output under the current setting.
Definition volume.c:144
esp_err_t volume_init(void)
Bring up the volume pot and push the current knob position to the DAC.
Definition volume.c:56
void volume_save_balance(void)
Persist the current balance trim to NVS so it survives a reboot.
Definition volume.c:169
void volume_set_output(volume_output_t out)
Select which output volume_poll() drives. Default VOLUME_OUT_DAC.
Definition volume.c:113
volume_output_t volume_get_output(void)
The output volume_poll() currently drives (see volume_set_output()).
Definition volume.c:121
void volume_clear_fixed(void)
Release the fixed-volume override; the pot drives the level again from the next poll.
Definition volume.c:136
bool volume_read_mv(int *out_mv)
Read the pot wiper voltage without touching any output (for diagnostics).
Definition volume.c:73
int8_t volume_get_balance(void)
The current L/R balance trim in register steps (see volume_set_balance()).
Definition volume.c:164
volume_output_t
Where volume_poll() sends the knob level.
Definition volume.h:27
@ VOLUME_OUT_DAC
Definition volume.h:29
@ VOLUME_OUT_NONE
Definition volume.h:28
@ VOLUME_OUT_BT
Definition volume.h:30