GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LSEP / V1-0-2

Constituent: lsepw     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

BFP.h File Reference

Bit Field Pack Routines. More...

This graph shows which files directly or indirectly include this file:


Functions

static __inline unsigned int BFP_maskL (int width)
 Produce a left justified mask of the specified width.
static __inline unsigned int BFP_maskR (int width)
 Produce a right justified mask of the specified width.
static __inline unsigned int BFP_wordL (unsigned int *w, unsigned int position, unsigned int field, unsigned int width)
 Packs a left justified bit field into the current position. The width of the bit field must be less than or equal to 32 bits.
static __inline unsigned int BFP_wordR (unsigned int *w, unsigned int position, unsigned int field, unsigned int width)
 Packs a right justified bit field into the current position. The width of the bit field must be less than or equal to 32 bits.
static __inline unsigned int BFP_wordLP (unsigned int *w, unsigned int position, unsigned int field, unsigned int width)
 Packs a left justified bit field into the current position limiting the field to the specified width. The width of the bit field must be less than or equal to 32 bits.
static __inline unsigned int BFP_wordRP (unsigned int *w, unsigned int position, unsigned int field, unsigned int width)
 Packs a right justified bit field into the current position limiting the field to the specified width. The width of the bit field must be less than or equal to 32 bits.
static __inline unsigned int BFP_wordB (unsigned int *w, unsigned int position, unsigned int bit)
 Packs the value of the bit into the current bit position. The value of the bit is either 0 or 1, or said in a negative fashion, it is not the left justified version, i.e. 0x80000000 or 0.

Detailed Description

Bit Field Pack Routines.

Author:
JJRussell - russell@slac.stanford.edu
Inline functions to (left justified) pack bit fields into a 32-bit output vector. These routines assume that any bits ahead of the current bit position index can be overwritten. In this sense these routines are not equivalent to a bit field insert routine which only write the bits in the designated bit field.
The routines come in a 2 x 2 set. One can insert a field of a specified width that is either left or right justified. In addition one can use unprotected or protected routines, the distinction being that the unprotected routines are faster, but demand that the user guarantee that no more than the specified bits are non-zero. Conversely, the protected routines limit the bit field to the specified width.

Function Documentation

static __inline unsigned int BFP_maskL int  width  )  [static]
 

Produce a left justified mask of the specified width.

Returns:
A left justified mask of the specified width
Parameters:
width The width of the mask
The BFP_word packing routines do not protect themselves against stray bits (i.e. bits set outside the specified width) for efficiency reasons. On most occasions this protection occurs naturally as part of composing the field, so this would be a waste of time. However, when it is needed this inline provides a tidy way to produce the necessary mask.

static __inline unsigned int BFP_maskR int  width  )  [static]
 

Produce a right justified mask of the specified width.

Returns:
A right justified mask of the specified width
Parameters:
width The width of the mask, must be between 0 and 31.
The BFP_word packing routines do not protect themselves against stray bits (i.e. bits set outside the specified width) for efficiency reasons. On most occasions this protection occurs naturally as part of composing the field, so this would be a waste of time. However, when it is needed this inline provides a tidy way to produce the necessary mask.

static __inline unsigned int BFP_wordB unsigned int *  w,
unsigned int  position,
unsigned int  bit
[static]
 

Packs the value of the bit into the current bit position. The value of the bit is either 0 or 1, or said in a negative fashion, it is not the left justified version, i.e. 0x80000000 or 0.

Parameters:
w The output word
position The current bit position
bit The value of the bit to insert (0 or 1)
Returns:
The updated bit position

static __inline unsigned int BFP_wordL unsigned int *  w,
unsigned int  position,
unsigned int  field,
unsigned int  width
[static]
 

Packs a left justified bit field into the current position. The width of the bit field must be less than or equal to 32 bits.

Parameters:
w The output word array to insert the bit field into
position The current bit position in the output bit field
field The left justified field to insert
width The width of the field to insert
Returns:
The new bit position (essentially position + width).

static __inline unsigned int BFP_wordLP unsigned int *  w,
unsigned int  position,
unsigned int  field,
unsigned int  width
[static]
 

Packs a left justified bit field into the current position limiting the field to the specified width. The width of the bit field must be less than or equal to 32 bits.

Parameters:
w The output word array to insert the bit field into
position The current bit position in the output bit field
field The left justified field to insert
width The width of the field to insert
Returns:
The new bit position (essentially position + width).

static __inline unsigned int BFP_wordR unsigned int *  w,
unsigned int  position,
unsigned int  field,
unsigned int  width
[static]
 

Packs a right justified bit field into the current position. The width of the bit field must be less than or equal to 32 bits.

Parameters:
w The output word array to insert the bit field into
position The current bit position in the output bit field
field The left justified field to insert
width The width of the field to insert
Returns:
The new bit position (essentially position + width).

static __inline unsigned int BFP_wordRP unsigned int *  w,
unsigned int  position,
unsigned int  field,
unsigned int  width
[static]
 

Packs a right justified bit field into the current position limiting the field to the specified width. The width of the bit field must be less than or equal to 32 bits.

Parameters:
w The output word array to insert the bit field into
position The current bit position in the output bit field
field The right justified field to insert
width The width of the field to insert
Returns:
The new bit position (essentially position + width).


Generated on Thu Jan 5 20:54:37 2006 by  doxygen 1.4.4