Function rustduino::atmega328p::com::i2c::prescaler[][src]

pub fn prescaler() -> (u8, bool, bool)
Expand description
  • This function reads the device clock freequency setup and provide the details in form of boolean numbers and a 8 bit unsigned integer to check the settings of the I2C carefully.
  • If the clock freequency in very low then the function panics as the I2C protocol cannot be activated properly at such low freequencies.

    Returns

    • a tuple - Consisting of the following 3 Items -
      • a u8 - Which is a 2’s exponent till 64 which defines the bandwidth rate for TWI I2C initialization.
      • a boolean - Which denotes the TWPS bit 1 settings.
      • a boolean - Which denotes the TWPS bit 2 settings.