STRUCT STM32_ADC_CFG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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: those optional function pointers are actually optional β€” prepare and unprepare β€” 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