Skip to content

Instantly share code, notes, and snippets.

@ultramcu
Created May 26, 2014 17:02
Show Gist options
  • Save ultramcu/7550e51663717e54d3a7 to your computer and use it in GitHub Desktop.
Save ultramcu/7550e51663717e54d3a7 to your computer and use it in GitHub Desktop.
Access bit by union
typedef union {
struct {
uint8_t bit_0: 1;
uint8_t bit_1: 1;
uint8_t bit_2: 1;
uint8_t bit_3: 1;
uint8_t bit_4: 1;
uint8_t bit_5: 1;
uint8_t bit_6: 1;
uint8_t bit_7: 1;
};
uint8_t byte_0;
}st_data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment