embeddedlibrary
reusable software modules for embedded systems
union16_t Union Reference

#include <int_def.h>

Data Fields

uint16_t word
 
uint8_t b [2]
 byte array member, b[0] LSB, b[1] MSB
 
union8_t ub [2]
 8-bit union array member, More...
 
struct {
   uint16_t   b0:1
 
   uint16_t   b1:1
 
   uint16_t   b2:1
 
   uint16_t   b3:1
 
   uint16_t   b4:1
 
   uint16_t   b5:1
 
   uint16_t   b6:1
 
   uint16_t   b7:1
 
   uint16_t   b8:1
 
   uint16_t   b9:1
 
   uint16_t   b10:1
 
   uint16_t   b11:1
 
   uint16_t   b12:1
 
   uint16_t   b13:1
 
   uint16_t   b14:1
 
   uint16_t   b15:1
 
bits
 bitfield member, b0 LSb, b15 MSb
 

Detailed Description

16-bit union type

Example usage

x.word = 1; // same as x.bits.b0 = 1 or x.b[0] = 1
x.bits.b2 = 1; // same as x.b |= 4
// x now equals 5

Field Documentation

union8_t ub[2]

8-bit union array member,

See also
union8_t

The documentation for this union was generated from the following file: