Re: port I/O abstraction macros
- From: "DAC" <Mister@xxxxxxxxxx>
- Date: Sat, 3 Jun 2006 19:25:56 +1000
"Tom Torfs" <tomtorfs@xxxxxxxxx> wrote in message
news:1149274847.733281.46970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Everyone,
Earlier I posted some macros that allow you to easily define binary
constants in C (see http://cprog.tomsweb.net/binconst.txt). Playing
similar tricks with the preprocessor, I now created some macros that
allow you to make easy abstraction of port I/O's. It's written for the
MSP430 but the concept can be applied to other embedded architectures.
You simply define your signal location like:
#define LED P1,0
and then use them like:
SETDIR(LED);
CLR(LED);
TOGGLE(LED);
We take on alot of intern students and student projects etc. and I have
always found their ability to do bitwise manipulation in C to be completely
hopeless. What are universities teaching them these days? Its the year 2006
and they still come out knowing how to program an 8051 in assembly but not
knowing what c &= ~(1<<4); does.
.
- Follow-Ups:
- Re: port I/O abstraction macros
- From: Tom Lucas
- Re: port I/O abstraction macros
- From: Mark McDougall
- Re: port I/O abstraction macros
- From: Tom Torfs
- Re: port I/O abstraction macros
- References:
- port I/O abstraction macros
- From: Tom Torfs
- port I/O abstraction macros
- Prev by Date: Re: what's wrong with a pic ?
- Next by Date: Re: combination of C and assembly
- Previous by thread: Re: port I/O abstraction macros
- Next by thread: Re: port I/O abstraction macros
- Index(es):
Relevant Pages
|