[][src]Struct ds1307::Ds1307

pub struct Ds1307<I2C> { /* fields omitted */ }

DS1307 driver

Methods

impl<I2C, E> Ds1307<I2C> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn read_ram(
    &mut self,
    address_offset: u8,
    data: &mut [u8]
) -> Result<(), Error<E>>
[src]

Read a data array from the user RAM starting at the given offset.

There is a total of 56 bytes of user RAM available so the valid ranges for the parameters are: address_offset: [0-55] and data array length: [0-56].

Will return an Error::InvalidInputData if attempting to access a position not available or if attempting to read too much data.

pub fn write_ram(
    &mut self,
    address_offset: u8,
    data: &[u8]
) -> Result<(), Error<E>>
[src]

Write a data array to the user RAM starting at the given offset.

There is a total of 56 bytes of user RAM available so the valid ranges for the parameters are: address_offset: [0-55] and data array length: [0-56].

Will return an Error::InvalidInputData if attempting to access a position not available or if attempting to write too much data.

impl<I2C, E> Ds1307<I2C> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn running(&mut self) -> Result<bool, Error<E>>[src]

Read if the clock is running.

pub fn set_running(&mut self) -> Result<(), Error<E>>[src]

Set the clock to run (default on power-on). (Does not alter the device register if already running).

pub fn halt(&mut self) -> Result<(), Error<E>>[src]

Halt the clock. (Does not alter the device register if already halted).

impl<I2C, E> Ds1307<I2C> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn square_wave_output_enabled(&mut self) -> Result<bool, Error<E>>[src]

Read whether the square-wave output is enabled.

pub fn enable_square_wave_output(&mut self) -> Result<(), Error<E>>[src]

Enable the square-wave output. (Does not alter the device register if already enabled).

pub fn disable_square_wave_output(&mut self) -> Result<(), Error<E>>[src]

Disable the square-wave output. (Does not alter the device register if already disabled).

pub fn get_square_wave_output_level(&mut self) -> Result<SqwOutLevel, Error<E>>[src]

Read status of square-wave output level control bit.

pub fn set_square_wave_output_level(
    &mut self,
    level: SqwOutLevel
) -> Result<(), Error<E>>
[src]

Set square-wave output level. (Does not alter the device register if same level is already configured).

pub fn get_square_wave_output_rate(&mut self) -> Result<SqwOutRate, Error<E>>[src]

Read square-wave output rate control bits.

pub fn set_square_wave_output_rate(
    &mut self,
    rate: SqwOutRate
) -> Result<(), Error<E>>
[src]

Set square-wave output rate.

impl<I2C, E> Ds1307<I2C> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

pub fn new(i2c: I2C) -> Self[src]

Create a new instance.

pub fn destroy(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

Trait Implementations

impl<I2C: Debug> Debug for Ds1307<I2C>[src]

impl<I2C: Default> Default for Ds1307<I2C>[src]

impl<I2C, E> Rtcc for Ds1307<I2C> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

type Error = Error<E>

Error type

Auto Trait Implementations

impl<I2C> RefUnwindSafe for Ds1307<I2C> where
    I2C: RefUnwindSafe

impl<I2C> Send for Ds1307<I2C> where
    I2C: Send

impl<I2C> Sync for Ds1307<I2C> where
    I2C: Sync

impl<I2C> Unpin for Ds1307<I2C> where
    I2C: Unpin

impl<I2C> UnwindSafe for Ds1307<I2C> where
    I2C: UnwindSafe

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, 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.