Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] To bit pack or not

2005-04-01 by Arie de Muynck

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

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.