github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/adc.go (about)

     1  package machine
     2  
     3  // Hardware abstraction layer for the analog-to-digital conversion (ADC)
     4  // peripheral.
     5  
     6  // ADCConfig holds ADC configuration parameters. If left unspecified, the zero
     7  // value of each parameter will use the peripheral's default settings.
     8  type ADCConfig struct {
     9  	Reference  uint32 // analog reference voltage (AREF) in millivolts
    10  	Resolution uint32 // number of bits for a single conversion (e.g., 8, 10, 12)
    11  	Samples    uint32 // number of samples for a single conversion (e.g., 4, 8, 16, 32)
    12  	SampleTime uint32 // sample time, in microseconds (µs)
    13  }