pub fn init(&mut self) -> Result<(),Box<error::Error>> {
    use commands::*;

    // The initialization sequence.
    const INIT_SEQUENCE: &'static [u8] = &[
      // Turn the display off.
      DISPLAYOFF,
      // Set the oscillator division.
      SETCLOCK, 0xF1,
      // Set the multiplex ratio to 1/64 duty cycle.
      SETMULTIPLEX, 0x3F,
      // Set the display offset to 76.
      SETOFFSET, 0x4C,
      // Set the start line to 0.
      SETSTARTLINE, 0x00,
      // Set Master Config to DC/DC Converter.
      MASTERCONFIG, 0x02,
      // Set segment remap to 0x50: *1010000 (COM split, remap bottom-up, horiz. increment, no nibble remap).
      SETREMAP, 0x50,
      // Set full current range.
      SETCURRENT_FULL,
      // Set the gray color palette.
      SETGRAYTABLE, 0x01, 0x11, 0x22, 0x32, 0x43, 0x54, 0x65, 0x76,
      // Set the contrast to maximum.
      SETCONTRAST, 0x7F,
      // Set the row period.
      SETROWPERIOD, 0x51,
      // Set the phase length.
      SETPHASELEN, 0x55,
      // Set the precharge comparator to 2.
      SETPRECHARGECOMP, 0x02,
      // Enable the precharge comparator.
      SETPRECHARGECOMPENABLE, 0x28,
      // Set the high voltage level of the COM pin (`0x1C = 0.80 * Vref`).
      SETVCOMLEVEL, 0x1C,
      // Set the low voltage level of the SEG pin. Value may be wrong.
      SETVSL, (0x0D | 0x02),
      // Set the display to non-inverted configuration.
      NORMALDISPLAY,
      // Turn on the Draw Rect command only, used to clear the screen.
      GFXACCEL, 0x01,
    ];

    // Reset the display.
    self.reset()?;

    // Send the initialization sequence in command mode to the display.
    self.write_sequence(DisplayMode::Command, INIT_SEQUENCE)
  }
/// Resets and initializes the display. Blocks for approximately 600ms.
Resets and initializes the display. Blocks for approximately 600ms.
Resets and initializes the display . Blocks for approximately 600ms .
pub fn init(&mut self) -> Result<(),Box<error::Error>> {
    use commands::*;
    // The initialization sequence.
    const INIT_SEQUENCE: &'static [u8] = &[
      // Turn the display off.
      DISPLAYOFF,
      // Set the oscillator division.
      SETCLOCK, 0xF1,
      // Set the multiplex ratio to 1/64 duty cycle.
      SETMULTIPLEX, 0x3F,
      // Set the display offset to 76.
      SETOFFSET, 0x4C,
      // Set the start line to 0.
      SETSTARTLINE, 0x00,
      // Set Master Config to DC/DC Converter.
      MASTERCONFIG, 0x02,
      // Set segment remap to 0x50: *1010000 (COM split, remap bottom-up, horiz. increment, no nibble remap).
      SETREMAP, 0x50,
      // Set full current range.
      SETCURRENT_FULL,
      // Set the gray color palette.
      SETGRAYTABLE, 0x01, 0x11, 0x22, 0x32, 0x43, 0x54, 0x65, 0x76,
      // Set the contrast to maximum.
      SETCONTRAST, 0x7F,
      // Set the row period.
      SETROWPERIOD, 0x51,
      // Set the phase length.
      SETPHASELEN, 0x55,
      // Set the precharge comparator to 2.
      SETPRECHARGECOMP, 0x02,
      // Enable the precharge comparator.
      SETPRECHARGECOMPENABLE, 0x28,
      // Set the high voltage level of the COM pin (`0x1C = 0.80 * Vref`).
      SETVCOMLEVEL, 0x1C,
      // Set the low voltage level of the SEG pin. Value may be wrong.
      SETVSL, (0x0D | 0x02),
      // Set the display to non-inverted configuration.
      NORMALDISPLAY,
      // Turn on the Draw Rect command only, used to clear the screen.
      GFXACCEL, 0x01,
    ];
    // Reset the display.
    self.reset()?;
    // Send the initialization sequence in command mode to the display.
    self.write_sequence(DisplayMode::Command, INIT_SEQUENCE)
  }
pub fn init ( & mut self ) -> Result < ( ) , Box < error :: Error > > { use commands :: * ; // The initialization sequence. const INIT_SEQUENCE : & ' static [ u8 ] = & [ // Turn the display off. DISPLAYOFF , // Set the oscillator division. SETCLOCK , 0xF1 , // Set the multiplex ratio to 1/64 duty cycle. SETMULTIPLEX , 0x3F , // Set the display offset to 76. SETOFFSET , 0x4C , // Set the start line to 0. SETSTARTLINE , 0x00 , // Set Master Config to DC/DC Converter. MASTERCONFIG , 0x02 , // Set segment remap to 0x50: *1010000 (COM split, remap bottom-up, horiz. increment, no nibble remap). SETREMAP , 0x50 , // Set full current range. SETCURRENT_FULL , // Set the gray color palette. SETGRAYTABLE , 0x01 , 0x11 , 0x22 , 0x32 , 0x43 , 0x54 , 0x65 , 0x76 , // Set the contrast to maximum. SETCONTRAST , 0x7F , // Set the row period. SETROWPERIOD , 0x51 , // Set the phase length. SETPHASELEN , 0x55 , // Set the precharge comparator to 2. SETPRECHARGECOMP , 0x02 , // Enable the precharge comparator. SETPRECHARGECOMPENABLE , 0x28 , // Set the high voltage level of the COM pin (`0x1C = 0.80 * Vref`). SETVCOMLEVEL , 0x1C , // Set the low voltage level of the SEG pin. Value may be wrong. SETVSL , ( 0x0D | 0x02 ) , // Set the display to non-inverted configuration. NORMALDISPLAY , // Turn on the Draw Rect command only, used to clear the screen. GFXACCEL , 0x01 , ] ; // Reset the display. self . reset ( ) ? ; // Send the initialization sequence in command mode to the display. self . write_sequence ( DisplayMode :: Command , INIT_SEQUENCE ) }
Resets and initializes the display.
Resets and initializes the display .
&mut self
&mut self