Hi,
I've been working on an Arduino (Sanguino)-based extreme low-power + energy harvesting board, test version available here until I get a google code repository set up.
Playing with some of the Arduino libraries that would be most relevant to it, I ran into an issue with the new SD library that comes standard with Arduino since 0022: almost all the pin numbers are hardcoded in the library! I.e, without even the option to use different pins / non commercially made I/O shield. I could understand this in "some guy's" library written for a specific pet project and put online as an afterthought, but I wasn't really expecting it in officially supported libraries. Is this a common practice in the major libraries?
Likewise, should I assume major libraries make other assumptions, such as any GPIOs used by the library all residing on the same physical port, or Arduino pin numberings (in multiples of 8) mapping 1:1 with GPIO port bits? (e.g. Arduino pin # 8~15 = PORTB[0:7] OK, pin # 8~15 = PORTB[2:0], PORTC[5:1] not OK)
I didn't even consider this possibility when assigning pins; I had ass-umed the whole purpose of Arduino's pin-numbering abstraction (digitalWrite, etc.) was to free users from having to know or care how the numeric values marked on the board map to phyiscal GPIO port/pins, and free designers from having to copy the most popular guy's pinout to stay compatible. Is the SD library an isolated case / potentially a bug report, or would I be well advised to copy Sanguino / other board's pin mappings for a future / 'final' version?