Created
May 26, 2014 17:02
-
-
Save ultramcu/7550e51663717e54d3a7 to your computer and use it in GitHub Desktop.
Access bit by union
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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