STRUCT STM32_ADC_CFG(9)
π struct stm32_adc_cfg π
okay so this is a page straight outta the Kernel API Manual (section 9, bestie, we're in the deep kernel section now π«Ά) and it's all about struct stm32_adc_cfg β the literal blueprint every STM32 ADC driver hands over so the core knows what kind of diva it's dealing with. no cap, this is the vibe-check struct.
β¨ NAME β¨
struct stm32_adc_cfg β the stm32 compatible configuration data. like, the whole personality file for an ADC instance π
π SYNOPSIS π
struct stm32_adc_cfg {
const struct stm32_adc_regspec *regs;
const struct stm32_adc_info *adc_info;
const struct stm32_adc_trig_info *trigs;
bool clk_required;
bool has_vregready;
bool has_boostmode;
bool has_linearcal;
bool has_presel;
bool has_oversampling;
int (*prepare)(struct iio_dev *);
void (*start_conv)(struct iio_dev *, bool dma);
void (*stop_conv)(struct iio_dev *);
void (*unprepare)(struct iio_dev *);
void (*irq_clear)(struct iio_dev *indio_dev, u32 msk);
void (*set_ovs)(struct iio_dev *indio_dev, u32 ovs_idx);
const unsigned int *smp_cycles;
const unsigned int *ts_int_ch;
};
πΈ Members πΈ
ngl this is the part where every single field gets its moment. they all ate, no crumbs:
regsβ the registers descriptions. yeah, all of them. the map πΊοΈadc_infoβ per instance input channels definitions. who's on which channel, iconic behavior β¨trigsβ the external trigger sources. the outside world is knocking π₯clk_requiredβ clock is required. not optional, bestie, it's required β°has_vregreadyβ vregready status flag presence. it's giving "do you even have the flag" π©has_boostmodeβ boost mode support flag. turbo era β‘has_linearcalβ linear calibration support flag. straight lines only, no chaos πhas_preselβ channel preselection support flag. picking favorites, but make it hardware π―has_oversamplingβ oversampling support flag. more samples, more slay πprepareβ optional prepare routine (power-up, enable). optional!! but if it's there it's doing the wake-up ritual πstart_convβ routine to start conversions. go go go πstop_convβ routine to stop conversions. okay we're done here, periodt βunprepareβ optional unprepare routine (disable, power-down). the nap function π΄irq_clearβ routine to clear irqs. bye bye interrupts, don't text πset_ovsβ routine to set oversampling configuration. turning the dial on the oversampling situation ποΈsmp_cyclesβ programmable sampling time (ADC clock cycles). counted in ADC clock cycles, not vibes β³ts_int_chβ pointer to array of internal channels minimum sampling time in ns. nanoseconds!! tiny!! but important π«
π SEE ALSO π
the whole friend group, and honestly the kernel file that started it all:
Kernel file ./drivers/iio/adc/stm32-adc.c plus struct stm32_adc_ic(9), struct stm32_adc_trig_info(9), struct stm32_adc_calib(9), struct stm32_adc_regs(9), struct stm32_adc_vrefint(9), struct stm32_adc_regspec(9), struct stm32_adc(9), struct stm32_adc_info(9), stm32_adc_conv_irq_enable(9), stm32_adc_conv_irq_disable(9), stm32f4_adc_start_conv(9), stm32h7_adc_read_selfcalib(9), stm32h7_adc_restore_selfcalib(9), stm32h7_adc_selfcalib(9), stm32h7_adc_check_selfcalib(9), stm32h7_adc_prepare(9), stm32_adc_conf_scan_seq(9), stm32_adc_get_trig_extsel(9), stm32_adc_set_trig(9), stm32_adc_single_conv(9), stm32_adc_validate_trigger(9), stm32_adc_debugfs_reg_access(9).
π reminder bestie: thoseoptionalfunction pointers are actually optional βprepareandunprepareβ so don't come for me if your driver leaves them out. everyone else, fill 'em in.
that's the whole page, fr fr π this one lives in ./drivers/iio/adc and it's dated October 2026 β signed, sealed, and shipped with love. go read your registers, icon π§ββοΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms