GPIO
Off elsewhere: Capper wrote: The "bit packing" in the GPIOPinWrite command took a while to figure out how to use also. I assumed if I wrote a 0 to a pin and it went low I could just write a 1 and it would go high - wrong... You made me curious, so I took a look. Interesting; looks like GPIOPinWrite() is pretty much a straight implementation of the way the GPIO ports work (which is itself a bit unusual, I guess.) And I don't think you can write 0 to a pin and have it go low, either, can you? You still have to have the appropriate bit set in the ucPins argument.
The datasheet says this bit-selection scheme uses 256 "locations in the memory map"; I guess it means 256 longwords (1024 addresses, so to speak.)
You should be able to do #define GPIOByteWrite(p, val) GPIOPinWrite(p, 255, val)if I'm understanding things correctly...
Does the GPIO pin masking feature interact with the "bit banding" generic feature in any useful way for accessing the pins individually?
Um, I feel like I'm asking about very basic ARM things here. On the other hand, I'm also thinking that the target audience of the Luminary chips (call them "People currently using 8bit microcontrollers") is likely to be wondering about the same issues. Is there already a "ARM for PIC/AVR users" guide somewhere that will provide a quick start? Or should I make that my contest entry :-)
login or register to reply
|