PreviousNext
addressBitmap
Help > OS functions > Other > addressBitmap

Function

 

Calculate the position (byte address and bit mask) from the bit index in a bitmap

Purpose

 

E.g., to find the position of the given Node in the bitmap of Nodes

Syntax

 

uns8 addressBitmap(uns8 bitIndex)

Parameters

 

bitIndex: Numerical order (position) in a bitmap (0 to 255).

                  Typically used for the index of the given Node (1 to 239).

Return value

 

The same as bitmapBitMask

Output values

 

     bitmapByteIndex:    Address of the byte in the bitmap, i.e. (bitIndex / 8)

     bitmapBitMask:        Bit mask value of the given position in the bitmap,

                  i.e. (1 << (bitIndex % 8))

Preconditions

 

  –

Remarks

 

  –

Side effects

 

  –

See also

 

  –

Example

 

addressBitmap(100);

// bitmapByteIndex = 12

// Return value = bitmapBitMask = 10h = 0b0001.0000