STRUCT STM32_ADC(9)
π NAME π
okay so bestie, this is struct stm32_adc(9) from the Kernel API Manual, and it is literally the private data of each ADC IIO instance. no cap, this struct is the little main-character bundle for one ADC instance. π
πΈ SYNOPSIS πΈ
here's the exact shape, bestie β do not touch the tokens, just vibe with them:
struct stm32_adc {
struct stm32_adc_common *common;
u32 offset;
const struct stm32_adc_cfg *cfg;
struct completion completion;
u16 buffer[STM32_ADC_MAX_SQ + 4];
struct clk *clk;
int irq;
spinlock_t lock;
unsigned int bufi;
unsigned int num_conv;
u32 res;
u32 trigger_polarity;
struct dma_chan *dma_chan;
u8 *rx_buf;
dma_addr_t rx_dma_buf;
unsigned int rx_buf_sz;
u32 difsel;
u32 pcsel;
u32 smpr_val[2];
struct stm32_adc_calib cal;
struct stm32_adc_vrefint vrefint;
char chan_name[STM32_ADC_CH_MAX][STM32_ADC_CH_SZ];
u32 num_diff;
int int_ch[STM32_ADC_INT_CH_NB];
int nsmps;
int ovs_idx;
};
π§ Members π§
okay member-by-member, no skipping, periodt:
commonβ a reference to the ADC block's common data. the shared group-chat info, basically.offsetβ the ADC instance register offset in the ADC block. where this instance sits in the register map.cfgβ compatible configuration data. the config that matches the compatible.completionβ end of single conversion completion. the "we're done with this one conversion" signal.bufferβ data buffer + 8 bytes for timestamp if enabled. yes, the+ 8is literally for the timestamp when that's enabled.clkβ clock for this adc instance. gotta have the clock, obvi.irqβ interrupt for this adc instance.lockβ spinlock.bufiβ data buffer index.num_convβ expected number of scan conversions.resβ data resolution (e.g. RES bitfield value).trigger_polarityβ external trigger polarity (e.g. exten).dma_chanβ dma channel.rx_bufβ dma rx buffer cpu address.rx_dma_bufβ dma rx buffer bus address.rx_buf_szβ dma rx buffer size.difselβ bitmask to set single-ended/differential channel.pcselβ bitmask to preselect channels on some devices.smpr_valβ sampling time settings (e.g. smpr1 / smpr2).calβ optional calibration data on some devices.vrefintβ internal reference voltage data.chan_nameβ channel name array.num_diffβ number of differential channels.int_chβ internal channel indexes array.nsmpsβ number of channels with optional sample time.ovs_idxβ current oversampling ratio index (in oversampling array). the oversampling-array index, slay.
π₯ SEE ALSO π₯
Kernel file: ./drivers/iio/adc/stm32-adc.c β go read the source, bestie, it's right there.
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_cfg(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)
okay that's the page, ily π«Ά β footer vibes: source/version ./drivers/iio/adc, date October 2026. mwah π
π¦ 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