[−][src]Module nrf52810_hal::saadc
HAL interface to the SAADC peripheral.
Example usage:
ⓘThis example is not tested
// subsititute `hal` with the HAL of your board, e.g. `nrf52840_hal` use hal::{ pac::Peripherals, prelude::*, gpio::p0::Parts as P0Parts, saadc::{SaadcConfig, Saadc}, }; let board = Peripherals::take().unwrap(); let gpios = P0Parts::new(board.P0); // initialize saadc interface let saadc_config = SaadcConfig::default(); let mut saadc = Saadc::new(board.SAADC, saadc_config); let mut saadc_pin = gpios.p0_02; // the pin your analog device is connected to // blocking read from saadc for `saadc_config.time` microseconds let _saadc_result = saadc.read(&mut saadc_pin);
Structs
InternalVdd | Channel that doesn't sample a pin, but the internal VDD voltage. |
Saadc | Interface for the SAADC peripheral. |
SaadcConfig | Used to configure the SAADC peripheral. |
Enums
Gain | Gain control |
Oversample | Oversample control |
Reference | Reference control |
Resistor | Positive channel resistor control |
Resolution | Set the resolution |
Time | Acquisition time, the time the ADC uses to sample the input voltage |