ESOS32
ESOSOn32-bitProcessors
Data Fields
_UINT32 Union Reference

#include <all_generic.h>

Data Fields

uint32_t _uint32
 
uint32_t u32
 
struct {
   uint8_t   u8LoLsb
 
   uint8_t   u8LoMsb
 
   uint8_t   u8HiLsb
 
   uint8_t   u8HiMsb
 
}; 
 
struct {
   uint16_t   u16LoWord
 
   uint16_t   u16HiWord
 
}; 
 
struct {
   uint16_t   u16Words [2]
 
}; 
 
struct {
   uint8_t   u8Bytes [4]
 
}; 
 
struct {
   unsigned   b0: 1
 
   unsigned   b1: 1
 
   unsigned   b2: 1
 
   unsigned   b3: 1
 
   unsigned   b4: 1
 
   unsigned   b5: 1
 
   unsigned   b6: 1
 
   unsigned   b7: 1
 
   unsigned   b8: 1
 
   unsigned   b9: 1
 
   unsigned   b10: 1
 
   unsigned   b11: 1
 
   unsigned   b12: 1
 
   unsigned   b13: 1
 
   unsigned   b14: 1
 
   unsigned   b15: 1
 
   unsigned   b16: 1
 
   unsigned   b17: 1
 
   unsigned   b18: 1
 
   unsigned   b19: 1
 
   unsigned   b20: 1
 
   unsigned   b21: 1
 
   unsigned   b22: 1
 
   unsigned   b23: 1
 
   unsigned   b24: 1
 
   unsigned   b25: 1
 
   unsigned   b26: 1
 
   unsigned   b27: 1
 
   unsigned   b28: 1
 
   unsigned   b29: 1
 
   unsigned   b30: 1
 
   unsigned   b31: 1
 
}; 
 

Detailed Description

Union structure to hold an uint32 to provide access to 32-bit data with different "viewpoints" (or casts, if you will).

Note
Works on machines that store their data little-endian. If you use big-endian, the members will have to be reordered!
Prefix for all UINT32 structs is U32_
UINT32 U32_x;
uint16 u16_a;
uint8 u8_b;
UINT16 U16_y;
U32_x._uint32 = 0xDEADBEEF;
u16_a = U32_x.u16LoWord; // u16_a equals 0xBEEF
u8_b = U32_x.u8Bytes[0]; // u8_b equals 0xEF
u16_a = U32_x.u16Words[1]; // u16_a equals 0xDEAD
U16_y._uint16 = U32_x.u16LoWord; // where's the "BEEF"?
u8_b = U16_y.uMSb; // u8_b equals 0xBE
while (U32_x.b31); // infinite loop

Definition at line 229 of file all_generic.h.

Field Documentation

◆ _uint32

uint32_t _UINT32::_uint32

uint32 viewed as an uint32

Definition at line 231 of file all_generic.h.

◆ b1

unsigned _UINT32::b1

bit 1 (the LSb) of the uint32

Definition at line 263 of file all_generic.h.

◆ b10

unsigned _UINT32::b10

bit 10 of the uint32

Definition at line 290 of file all_generic.h.

◆ b11

unsigned _UINT32::b11

bit 11 of the uint32

Definition at line 293 of file all_generic.h.

◆ b12

unsigned _UINT32::b12

bit 12 of the uint32

Definition at line 296 of file all_generic.h.

◆ b13

unsigned _UINT32::b13

bit 13 of the uint32

Definition at line 299 of file all_generic.h.

◆ b14

unsigned _UINT32::b14

bit 14 of the uint32

Definition at line 302 of file all_generic.h.

◆ b15

unsigned _UINT32::b15

bit 15 of the uint32

Definition at line 305 of file all_generic.h.

◆ b16

unsigned _UINT32::b16

bit 16 of the uint32

Definition at line 308 of file all_generic.h.

◆ b17

unsigned _UINT32::b17

bit 17 of the uint32

Definition at line 311 of file all_generic.h.

◆ b18

unsigned _UINT32::b18

bit 18 of the uint32

Definition at line 314 of file all_generic.h.

◆ b19

unsigned _UINT32::b19

bit 19 of the uint32

Definition at line 317 of file all_generic.h.

◆ b2

unsigned _UINT32::b2

bit 2 of the uint32

Definition at line 266 of file all_generic.h.

◆ b20

unsigned _UINT32::b20

bit 20 of the uint32

Definition at line 320 of file all_generic.h.

◆ b21

unsigned _UINT32::b21

bit 21 of the uint32

Definition at line 323 of file all_generic.h.

◆ b22

unsigned _UINT32::b22

bit 22 of the uint32

Definition at line 326 of file all_generic.h.

◆ b23

unsigned _UINT32::b23

bit 23 of the uint32

Definition at line 329 of file all_generic.h.

◆ b24

unsigned _UINT32::b24

bit 24 of the uint32

Definition at line 332 of file all_generic.h.

◆ b25

unsigned _UINT32::b25

bit 25 of the uint32

Definition at line 335 of file all_generic.h.

◆ b26

unsigned _UINT32::b26

bit 26 of the uint32

Definition at line 338 of file all_generic.h.

◆ b27

unsigned _UINT32::b27

bit 27 of the uint32

Definition at line 341 of file all_generic.h.

◆ b28

unsigned _UINT32::b28

bit 28 of the uint32

Definition at line 344 of file all_generic.h.

◆ b29

unsigned _UINT32::b29

bit 29 of the uint32

Definition at line 347 of file all_generic.h.

◆ b3

unsigned _UINT32::b3

bit 3 of the uint32

Definition at line 269 of file all_generic.h.

◆ b30

unsigned _UINT32::b30

bit 30 of the uint32

Definition at line 350 of file all_generic.h.

◆ b31

unsigned _UINT32::b31

bit 31 (MSb) of the uint32

Definition at line 353 of file all_generic.h.

◆ b4

unsigned _UINT32::b4

bit 4 of the uint32

Definition at line 272 of file all_generic.h.

◆ b5

unsigned _UINT32::b5

bit 5 of the uint32

Definition at line 275 of file all_generic.h.

◆ b6

unsigned _UINT32::b6

bit 6 of the uint32

Definition at line 278 of file all_generic.h.

◆ b7

unsigned _UINT32::b7

bit 7 of the uint32

Definition at line 281 of file all_generic.h.

◆ b8

unsigned _UINT32::b8

bit 8 of the uint32

Definition at line 284 of file all_generic.h.

◆ b9

unsigned _UINT32::b9

bit 9 of the uint32

Definition at line 287 of file all_generic.h.

◆ u16HiWord

uint16_t _UINT32::u16HiWord

The most-significant uint16 in the 32-bit data

Definition at line 248 of file all_generic.h.

◆ u16LoWord

uint16_t _UINT32::u16LoWord

The least-significant uint16 in the 32-bit data

Definition at line 246 of file all_generic.h.

◆ u16Words

uint16_t _UINT32::u16Words[2]

The uint32 viewed as an array of two (2) uint16s

Definition at line 252 of file all_generic.h.

◆ u32

uint32_t _UINT32::u32

uint32 viewed as an uint32

Definition at line 233 of file all_generic.h.

◆ u8Bytes

uint8_t _UINT32::u8Bytes[4]

The uint32 viewed as an array of four (4) uint8s

Definition at line 256 of file all_generic.h.

◆ u8HiLsb

uint8_t _UINT32::u8HiLsb

The LSB of the most-signficant uint16 in the 32-bit data

Definition at line 240 of file all_generic.h.

◆ u8HiMsb

uint8_t _UINT32::u8HiMsb

The MSB of the most-signficant uint16 in the 32-bit data

Definition at line 242 of file all_generic.h.

◆ u8LoLsb

uint8_t _UINT32::u8LoLsb

The LSB of the least-signficant uint16 in the 32-bit data

Definition at line 236 of file all_generic.h.

◆ u8LoMsb

uint8_t _UINT32::u8LoMsb

The MSB of the least-signficant uint16 in the 32-bit data

Definition at line 238 of file all_generic.h.


The documentation for this union was generated from the following file:
_UINT32
Definition: all_generic.h:229
_UINT32::b31
unsigned b31
Definition: all_generic.h:353
_UINT32::u16Words
uint16_t u16Words[2]
Definition: all_generic.h:252
_UINT16::_uint16
uint16_t _uint16
Definition: all_generic.h:117
_UINT32::u16LoWord
uint16_t u16LoWord
Definition: all_generic.h:246
_UINT16
Definition: all_generic.h:115
_UINT32::u8Bytes
uint8_t u8Bytes[4]
Definition: all_generic.h:256
_UINT32::_uint32
uint32_t _uint32
Definition: all_generic.h:231