Open GoogleCodeExporter opened 8 years ago
You are thinking too simple.
There should be functions like:
digitalWrite8Pins(pin0, pin1, pin2, pin3, pin4, pin5, pin6, pin7, byteval);
digitalRead8Pins(pin0, pin1, pin2, pin3, pin4, pin5, pin6, pin7);
pinMode8Pins(pin0, pin1, pin2, pin3, pin4, pin5, pin6, pin7, dir);
Also, the 4 bit versions as well.
(which comes in handy for things like hd44780 LCDs)
If you use some fancy macros and logic, it is possible to detect if the
pins map to contiguous bits in a port and crush down the code to single
instructions
if the pin values are all constants and all on the same port.
And if they aren't all on the same port, the logic can drop to nibble mode, or
bit
i/o in the worst case.
By doing it this way, users don't have to worry about port issues and the code
still
works with random pin assignments, but if they do know and understand about bits
within the ports, they can assign pins to a common port in the proper order to
get
better/much faster code.
Original comment by bperry...@gmail.com
on 11 May 2010 at 2:05
Original comment by dmel...@gmail.com
on 16 Dec 2011 at 10:06
Original issue reported on code.google.com by
dmel...@gmail.com
on 6 May 2010 at 6:33