Struct stm32_hal2::dac::Dac[][src]

pub struct Dac { /* fields omitted */ }

Digital to Analog converter peripheral

Implementations

impl Dac[src]

pub fn new(regs: DAC1, channel: Channel, bits: Bits, vref: f32) -> Self[src]

Create a new DAC instance. Create a new DAC instance, without checking the output pin

pub fn enable(&mut self, rcc: &mut RCC)[src]

Enable the DAC.

pub fn disable(&mut self, rcc: &mut RCC)[src]

Disable the DAC

pub fn set_value(&mut self, val: u32)[src]

Set the DAC value as an integer.

pub fn set_voltage(&mut self, volts: f32)[src]

Set the DAC voltage. v is in Volts.

pub fn set_trigger(&mut self, trigger: Trigger)[src]

Select and activate a trigger. See f303 Reference manual, section 16.5.4.

pub fn trigger_lfsr(&mut self, trigger: Trigger, data: u32)[src]

Independent trigger with single LFSR generation See f303 Reference Manual section 16.5.2

pub fn trigger_triangle(&mut self, trigger: Trigger, data: u32)[src]

Independent trigger with single triangle generation See f303 Reference Manual section 16.5.2

Trait Implementations

impl SingleChannelDac<u32> for Dac[src]

type Error = DacError

Error type returned by DAC methods

fn try_set_value(&mut self, val: u32) -> Result<(), DacError>[src]

Set the DAC value as an integer.

Auto Trait Implementations

impl Send for Dac

impl !Sync for Dac

impl Unpin for Dac

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.