PIC24 Support Libraries
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
UINT16 Union Reference

#include <all_generic.h>

Data Fields

uint16 _uint16
 
uint16 u16
 
uint8 u8Lsb
 
uint8 u8Msb
 
uint8 u8Bytes [2]
 
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
 

Detailed Description

Union structure to hold uint16s to provide access to 16-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 UINT16 structs is U16_
uint8 u8_a, u8_b;
UINT16 U16_y;
U16_y._uint16 = 0xF00D;
u8_b = U16_y.u8Bytes[0]; // u8_b equals 0x0D
u8_a = U16_y.u8MSb; // u8_a equals 0xF0
while (U16_y.b7); // falls through since bit 7 is 0 (FALSE)

Definition at line 109 of file all_generic.h.

Field Documentation

uint16 UINT16::_uint16

uint16 viewed as an uint16

Definition at line 111 of file all_generic.h.

unsigned UINT16::b0

bit 0 (the LSb) of the uint16

Definition at line 127 of file all_generic.h.

unsigned UINT16::b1

bit 1 of the uint16

Definition at line 130 of file all_generic.h.

unsigned UINT16::b10

bit 10 of the uint16

Definition at line 157 of file all_generic.h.

unsigned UINT16::b11

bit 11 of the uint16

Definition at line 160 of file all_generic.h.

unsigned UINT16::b12

bit 12 of the uint16

Definition at line 163 of file all_generic.h.

unsigned UINT16::b13

bit 13 of the uint16

Definition at line 166 of file all_generic.h.

unsigned UINT16::b14

bit 14 of the uint16

Definition at line 169 of file all_generic.h.

unsigned UINT16::b15

bit 15 (the MSb) of the uint16

Definition at line 172 of file all_generic.h.

unsigned UINT16::b2

bit 2 of the uint16

Definition at line 133 of file all_generic.h.

unsigned UINT16::b3

bit 3 of the uint16

Definition at line 136 of file all_generic.h.

unsigned UINT16::b4

bit 4 of the uint16

Definition at line 139 of file all_generic.h.

unsigned UINT16::b5

bit 5 of the uint16

Definition at line 142 of file all_generic.h.

unsigned UINT16::b6

bit 6 of the uint16

Definition at line 145 of file all_generic.h.

unsigned UINT16::b7

bit 7 of the uint16

Definition at line 148 of file all_generic.h.

unsigned UINT16::b8

bit 8 of the uint16

Definition at line 151 of file all_generic.h.

unsigned UINT16::b9

bit 9 of the uint16

Definition at line 154 of file all_generic.h.

uint16 UINT16::u16

uint16 viewed as an uint16

Definition at line 113 of file all_generic.h.

uint8 UINT16::u8Bytes[2]

The uint16 viewed as an array of two (2) uint8s

Definition at line 122 of file all_generic.h.

uint8 UINT16::u8Lsb

LSB (uint8) of the uint16

Definition at line 116 of file all_generic.h.

uint8 UINT16::u8Msb

MSB (uint8) of the uint16

Definition at line 118 of file all_generic.h.


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