Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Bit set/clear w/ gcc

2006-01-06 by ee_gary

Hi everybody,

I'm wondering what is the best way to set and clear I/O bits without
keeping track of what port they are on.  For example, something like:

#define myOutput1 IO2PIN.1
#define myOutput2 IO3PIN.28

main(){
  myOutput1 = 0;
  myOutput2 = 1;
}

I'm currently using the appropriate SET, CLR, and PIN registers each
time I want to set/clear, but I'd prefer to #define them once and use
the more readable form suggested above.  I'm using GCC.  Thanks!

Gary

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.