STRUCT STM32_ADC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 + 8 is 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.

okay that's the page, ily 🫢 β€” footer vibes: source/version ./drivers/iio/adc, date October 2026. mwah πŸ’‹

πŸ“¦ where this page comes from