Browse
STMicroelectronics Community
FAQs
Sign In
Product forums
STM32 MCUs
STM32 MCUs Products
STM32 MCUs Boards and hardware tools
STM32 MCUs Software development tools
STM32 MCUs Embedded software
STM32 MCUs TouchGFX and GUI
STM32 MCUs Motor control
STM32 MCUs Security
STM32 MCUs Wireless
STM32 MPUs
STM32 MPUs Products
STM32 MPUs Boards and hardware tools
STM32 MPUs Embedded software and solutions
STM32 MPUs Software development tools
MEMS and sensors
MEMS (sensors)
Imaging (sensors)
Automotive and Transportation
Automotive MCUs
AutoDevKit Ecosystem
GNSS positioning
Edge AI
Interface and connectivity ICs
Power management
ST25 NFC/RFID tags and readers
STM8 MCUs
Others: hardware and software
Analog and audio
Knowledge base
STM32 MCUs
STM32 MPUs
MEMS and sensors
Analog and audio
EMI filtering and signal conditioning
Interface and connectivity ICs
Power management
Quality & reliability
Academy
About
Community guidelines
Feedback forum
Community blog
Developer news
LVasc.1
Associate II
since
2023-06-05
2023-06-14
User statistics
3
Posts
0
Solutions
0
Kudos given
0
Kudos received
STMicroelectronics Community
About LVasc.1
Options
Report User
User Activity
Posts
Replies
How to use a Union to access and change the bits?
2023-06-05
My header file:typedef union { struct { uint8_t u_bit1:1; uint8_t u_bit2:1; uint8_t u_bit3:1; uint8_t u_bit4:1; uint8_t u_bit5:1; uint8_t u_bit6:1; uint8_t u_bit7:1; uint8_t u_bit8:1; } bits;} u_serialSequenceBits;My .c file...
Re: How to use a Union to access and change the bits?
2023-06-06
It worked, Thanks!The use of union on my project it's because i want to send a serial data to a 74hc595 and give the manager to change the bits in others .c files.
Re: How to use a Union to access and change the bits?
2023-06-05
No. It's just inside the source file ".c".Sorry, i'm a beginner. What's GCC? I'm usign the STM32CubeIDE software.