TB2026-YDS Firmware
Toggle main menu visibility
Loading...
Searching...
No Matches
adc.h
Go to the documentation of this file.
1
9
#pragma once
10
11
#include <stdint.h>
12
#include "esp_err.h"
13
#include "esp_adc/adc_oneshot.h"
14
21
28
esp_err_t
adc_pot_init
(adc_oneshot_unit_handle_t *out_handle);
29
37
esp_err_t
adc_pot_read
(adc_oneshot_unit_handle_t handle,
int
*out_mv);
38
47
uint8_t
adc_pot_to_volume
(
int
mv);
48
59
uint8_t
adc_pot_to_avrcp_volume
(
int
mv);
60
71
uint8_t
adc_frac_to_volume
(
float
frac);
72
78
uint8_t
adc_frac_to_avrcp_volume
(
float
frac);
79
adc_frac_to_volume
uint8_t adc_frac_to_volume(float frac)
Map a 0..1 volume fraction directly to a PCM5242 register byte, bypassing the pot.
Definition
adc.c:113
adc_pot_read
esp_err_t adc_pot_read(adc_oneshot_unit_handle_t handle, int *out_mv)
Read the averaged, calibrated wiper voltage.
Definition
adc.c:66
adc_pot_to_avrcp_volume
uint8_t adc_pot_to_avrcp_volume(int mv)
Map a wiper voltage to an AVRCP absolute-volume value (0..0x7F) for a Bluetooth sink.
Definition
adc.c:92
adc_pot_to_volume
uint8_t adc_pot_to_volume(int mv)
Map a wiper voltage to a PCM5242 digital-volume register byte.
Definition
adc.c:78
adc_frac_to_avrcp_volume
uint8_t adc_frac_to_avrcp_volume(float frac)
Map a 0..1 volume fraction directly to an AVRCP absolute-volume value, bypassing the pot.
Definition
adc.c:118
adc_pot_init
esp_err_t adc_pot_init(adc_oneshot_unit_handle_t *out_handle)
Bring up ADC1 for the volume potentiometer (GPIO36) with line-fitting calibration.
Definition
adc.c:42
components
bsp
adc.h
Generated by
1.17.0