From: "peterburdine" > While not lpc2000 specific, I wanted to see if anyone else here was > using bit packing to access registers or if they were writing macros > or just doing to shifts and masking (w/o macros). Bitfields for I/O access are a definite no-no when using GCC (at least the GCCgcc-arm-xxx versions I tried). They are optimized into smaller width accesses, and trying to R/W a byte on a 32-bit wide I/O register will cause major problems. Thus, I use macro's, or just write all the low-level stuff into a heavily commented low-level driver (with shifts and masking). Of course I first create a header file with #defines for all bit positions and register addresses. Regards, Arie de Muynck
Message
Re: [lpc2000] To bit pack or not
2005-04-01 by Arie de Muynck
Attachments
- No local attachments were found for this message.