The --bitband command-line option bit-bands
all non const global structure objects.
When --bitband is applied to foo.c in Example 9, the write to value.i is
bit-banded. That is, the value 0x00000001 is
written to the bit-band alias word that value.i maps
to in the bit-band region.
Accesses to value.j and value.k are
not bit-banded.
Example 9. Using the --bitband command-line
option
/* foo.c */
typedef struct {
int i : 1;
int j : 2;
int k : 3;
} BB;
BB value __attribute__((at(0x20000040))); // Placed object
void update_value(void)
{
value.i = 1;
value.j = 0;
}
/* end of foo.c */
armcc supports the bit-banding of objects
accessed through absolute addresses. When --bitband is
applied to foo.c in Example 10, the access to rts is
bit-banded.
Example 10. Bit-banding of objects accessed
through absolute addresses
/* foo.c */
typedef struct {
int rts : 1;
int cts : 1;
unsigned int data;
} uart;
#define com2 (*((volatile uart *)0x20002000))
void put_com2(int n)
{
com2.rts = 1;
com2.data = n;
}
/* end of foo.c */
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.