pub struct Mcp794xx<DI, IC> { /* private fields */ }
Expand description

MCP794xx RTCC driver

Implementations

Returns whether the primary power has failed.

Clears the power failed status flag and power-fail time-stamp registers.

Returns date/time when the power failed went down (under Vtrip).

Note that the registers need to be cleared by calling clear_power_failed()

Returns date/time when the power went back up (above Vtrip).

Note that the registers need to be cleared by calling clear_power_failed()

Enable usage of backup battery power.

Note that this clears the power failed flag.

Disable usage of backup battery power (default).

Note that this clears the power failed flag.

Enable alarm

Disable alarm

Set alarm for date/time with a trigger rate and an output pin polarity.

Note that this clears the alarm has matched flag and the alarm needs to be enabled separately. Note that the output pin polarity will be set to the same value for both alarms.

Returns whether the alarm has matched.

Once this is true, it will stay as such until cleared. e.g. with clear_alarm_matched_flag()

Clears the alarm matched flag.

Returns whether the current year is a leap year.

Read a single byte from an address.

Valid addresses are from 0x20 to 0x5F. Otherwise an Error::InvalidInputData will be returned.

Write a single byte to an address.

Valid addresses are from 0x20 to 0x5F. Otherwise an Error::InvalidInputData will be returned.

Read SRAM starting in an address as many bytes as necessary to fill the data array provided.

Write data array to SRAM starting in an address.

Read a single byte from the current address.

The current address corresponds to the last accessed address (including addresses accessed in EEPROM) incremented by 1.

Enable the oscillator (set the clock running).

Disable the oscillator (stops the clock) (default).

Returns whether the oscillator is running.

Enable usage of external oscillator source.

Disable usage of external oscillator source (Will use internal source).

Enable square-wave output.

Note that this is not available when running on backup battery power.

Disable square-wave output.

Set square-wave output frequency.

Note that this setting will be ignored if the square-wave output is not enabled or digital trimming is enabled.

Set output pin logic level.

Note that this setting will be ignored if the square-wave output or any of the alarm interrupt outputs are enabled.

Enable coarse trim mode.

Disable coarse trim mode.

Set digital trimming value.

The sign determines whether the value will be added or substracted to or from the 32.768kHz clock signal. The argument value is always multiplied by two, so a value of 127 will add 254 clock cycles and a value of -50 will substract 100 cycles. Depending on the digital trimming setting, this will be applied either once per minute or 128 times per second. Set to 0 or -128 to disable digital trimming.

Read a single byte from an address in the protected EEPROM.

Valid addresses are in the range [0xF0-0xF7]. Error::InvalidInputData will be returned for invalid addresses.

Read protected EEPROM starting in an address as many bytes as necessary to fill the data array provided.

Valid addresses are in the range [0xF0-0xF7]. Error::InvalidInputData will be returned for invalid addresses or if the reading would overflow the size of the protected EEPROM.

Unlock protected EEPROM and write a single byte to an address.

Valid addresses are in the range [0xF0-0xF7]. Error::InvalidInputData will be returned for invalid addresses.

Write data array starting in an address in the protected EEPROM.

Valid addresses are in the range [0xF0-0xF7]. Error::InvalidInputData will be returned for invalid addresses or if the writing would overflow the size of the protected EEPROM.

Set the EEPROM block write protection

Read a single byte from an address in EEPROM.

Valid addresses are in the range [0x00-0x7F]. Error::InvalidInputData will be returned for invalid addresses.

Read EEPROM starting in an address as many bytes as necessary to fill the data array provided.

Valid addresses are in the range [0x00-0x7F]. Error::InvalidInputData will be returned for invalid addresses or if the reading would overflow the size of the EEPROM.

Write a single byte to an address in EEPROM.

Valid addresses are in the range [0x00-0x7F]. Error::InvalidInputData will be returned for invalid addresses.

Write data array starting in an address in EEPROM.

Valid addresses are in the range [0x00-0x7F]. Error::InvalidInputData will be returned for invalid addresses or if the writing would overflow the size of the EEPROM.

Read a single byte from the current address in EEPROM.

The current address corresponds to the last accessed address (including addresses accessed in SRAM/RTCC) incremented by 1.

Read pre-programmed EUI-48 node address from EEPROM.

Read pre-programmed EUI-64 node address from EEPROM.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Create a new instance of the device.

Destroy driver instance, return I²C bus instance.

Trait Implementations

This device can compensate for leap years up to 2399 but only the two last year digits are stored so we will return the year as in the range 2000-2099.

Note that this clears the power failed flag. This device can compensate for leap years up to 2399 but only the two last year digits are stored so we only support the range 2000-2099.

Error type

Formats the value using the given formatter. Read more

This device can compensate for leap years up to 2399 but only the two last year digits are stored so we will return the year as in the range 2000-2099.

Note that this clears the power failed flag.

This device can compensate for leap years up to 2399 but only the two last year digits are stored so we only support the range 2000-2099.

Read the seconds.

Read the minutes.

Read the hours.

Read the time.

Read the day of the week [1-7].

Read the day of the month [1-31].

Read the month [1-12].

Read the date.

Set the seconds [0-59].

Set the minutes [0-59].

Set the hours. Read more

Set the time.

Set the day of month [1-31].

Set the month [1-12].

Set the date.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.