embedded-software
reusable software modules for embedded systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
union16_t Union Reference

#include <int_def.h>

Collaboration diagram for union16_t:

Data Fields

uint16_t word
 
uint8_t b [2]
 byte array member, b[0] LSB, b[1] MSB More...
 
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 More...
 

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

uint8_t b[2]

byte array member, b[0] LSB, b[1] MSB

uint16_t b0
uint16_t b1
uint16_t b10
uint16_t b11
uint16_t b12
uint16_t b13
uint16_t b14
uint16_t b15
uint16_t b2
uint16_t b3
uint16_t b4
uint16_t b5
uint16_t b6
uint16_t b7
uint16_t b8
uint16_t b9
struct { ... } bits

bitfield member, b0 LSb, b15 MSb

union8_t ub[2]

8-bit union array member,

See Also
union8_t
uint16_t word

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