Commits

Anonymous committed 741ef89

4Bit,8Bit - FastIO for enable pin

  • Participants
  • Parent commits 4633f53
  • Branches fastIO

Comments (0)

Files changed (2)

File LiquidCrystal.cpp

    
    _rs_pin = rs;
    _rw_pin = rw;
-   _enable_pin = enable;
+
+   _enable_bit = fio_pinToBit(enable);
+   _enable_register = fio_pinToInputRegister(enable);
    
    // Initialize data pins for FastIO
    _data_bits[0] = fio_pinToBit(d0);
       pinMode(_rw_pin, OUTPUT);
    }
    
-   pinMode(_enable_pin, OUTPUT);
-   
    // Initialise displaymode functions to defaults: LCD_1LINE and LCD_5x8DOTS
    // -------------------------------------------------------------------------
    if (fourbitmode)
    
    // Now we pull both RS and R/W low to begin commands
    digitalWrite(_rs_pin, LOW);
-   digitalWrite(_enable_pin, LOW);
+   fio_digitalWrite_LOW(_enable_register,_enable_bit);
    
    if (_rw_pin != 255) 
    { 
 {
    // There is no need for the delays, since the digitalWrite operation
    // takes longer.
-   digitalWrite(_enable_pin, HIGH);   
+   fio_digitalWrite_HIGH(_enable_register, _enable_bit);
    waitUsec(1);          // enable pulse must be > 450ns   
-   digitalWrite(_enable_pin, LOW);
+   fio_digitalWrite_SWITCH(_enable_register, _enable_bit);
    waitUsec(40);   // commands need > 37us to settle
 }
 

File LiquidCrystal.h

    
    uint8_t _rs_pin;       // LOW: command.  HIGH: character.
    uint8_t _rw_pin;       // LOW: write to LCD.  HIGH: read from LCD.
-   uint8_t _enable_pin;   // activated by a HIGH pulse.
 
+   // Enable pin - activated by a HIGH pulse.
+   fio_bit _enable_bit;
+   fio_register _enable_register;
+
+   // data pins
    fio_bit _data_bits[8];
    fio_register _data_registers[8];
 };