This option bit-bands all non const global structure
objects. It enables a word of memory to be mapped to a single bit
in the bit-band region. This enables efficient atomic access to
single-bit values in SRAM and Peripheral regions of the memory architecture.
For peripherals that are width sensitive, byte, halfword,
and word stores or loads to the alias space are generated for char, short,
and int types of bitfields of bit-banded structs respectively.
Restrictions
The following restrictions apply:
This
option only affects struct types. Any union type or
other aggregate type with a union as a member cannot be bit-banded.
Members of structs cannot be bit-banded individually.
Bit-banded accesses are generated only for single-bit
bitfields.
Bit-banded accesses are not generated for const objects,
pointers, and local objects.
Bit-banding is only available on some processors.
For example, the Cortex-M4 and Cortex-M3 processors.
Example
In Example 1 the
writes to bitfields i and k are
bit-banded when compiled using the --bitband command-line
option.
Example 1. Bit-banding example
typedef struct {
int i : 1;
int j : 2;
int k : 1;
} BB;
BB value;
void update_value(void)
{
value.i = 1;
value.k = 1;
}
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.