GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / dev > latc_cmn / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

map.h File Reference

Configuration map creation, initialisation and manipulation functions. More...

#include <LATC/lrd.h>
#include <stdio.h>

Typedefs

typedef struct LATC_map_ LATC_map
 Forward declaration of the LATC_map structure, a bit-map of all the LAT components.

Functions

LATC_mapLATC_newMap (void)
 Allocate and initialise a new LATC_map.
void LATC_deleteMap (LATC_map *map)
 Free the memory allocated for the LATC_map structure.
unsigned LATC_setBit (LATC_map *map, LATC_type type, const LATC_addr *addr)
 Set a bit in the map.
unsigned LATC_clearBit (LATC_map *map, LATC_type type, const LATC_addr *addr)
 Clear a bit in the map.
int LATC_checkBit (const LATC_map *map, LATC_type type, const LATC_addr *addr)
 Check a bit in the map.
int LATC_countBits (const LATC_map *map, LATC_type type)
 Clear a bit in the map.
void LATC_setACD (LATC_map *map)
 Set all the bits in the ARC and AFE submaps.
void LATC_clearACD (LATC_map *map)
 Clear all the bits in the ARC and AFE submaps.
unsigned LATC_setTWR (LATC_map *map, unsigned twr)
 Set all the bits in TEM, TIC, CCC, CRC, CFE, TCC TRC and TFE submaps corresponding to a particular tower.
unsigned LATC_clearTWR (LATC_map *map, unsigned twr)
 Clear all the bits in TEM, TIC, CCC, CRC, CFE, TCC TRC and TFE submaps corresponding to a particular tower.
unsigned LATC_setByTWR (LATC_map *map, LATC_type type, unsigned twr)
unsigned LATC_clearByTWR (LATC_map *map, LATC_type type, unsigned twr)
void LATC_setMap (LATC_map *map)
 Set the map.
void LATC_clearMap (LATC_map *map)
 Clear the map.
void LATC_dumpMap (LATC_map *map, FILE *fp)
 Print out the map.


Detailed Description

Configuration map creation, initialisation and manipulation functions.

Author:
James Swain -- jswain@slac.stanford.edu

Function Documentation

int LATC_checkBit ( const LATC_map map,
LATC_type  type,
const LATC_addr addr 
)

Check a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to check
Return values:
0 if the bit is clear
1 if the bit is set

References checkBit(), mapIndex(), and LATC_map_::ptr.

void LATC_clearACD ( LATC_map map  ) 

Clear all the bits in the ARC and AFE submaps.

Parameters:
map Pointer to a LATC_map structure

References clearMap(), and LATC_map_::ptr.

unsigned LATC_clearBit ( LATC_map map,
LATC_type  type,
const LATC_addr addr 
)

Clear a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to clear
Returns:
One of LATC_msgs, LATC_SUCCESS on success

References clearBit(), mapIndex(), and LATC_map_::ptr.

unsigned LATC_clearByTWR ( LATC_map map,
LATC_type  type,
unsigned  twr 
)

Parameters:
map Pointer to a LATC_map structure
type Identifies the sub-map to manipulate
twr Index of a tower
Return values:
LATC_BADTYPE if the type does not exist
LATC_MAPLESS if there is no sub-map corresponding to this type
LATC_BADADDR if the twr ID is out of range
LATC_SUCCESS if everything goes well

References clearBit(), mapRange(), and LATC_map_::ptr.

Referenced by LATC_clearTWR().

void LATC_clearMap ( LATC_map map  ) 

Clear the map.

Parameters:
map Structure being manipulated

References clearMap(), and LATC_map_::ptr.

Referenced by LATC_clearIMM().

unsigned LATC_clearTWR ( LATC_map map,
unsigned  twr 
)

Clear all the bits in TEM, TIC, CCC, CRC, CFE, TCC TRC and TFE submaps corresponding to a particular tower.

Parameters:
map Pointer to a LATC_map structure
twr Index of a tower
Return values:
LATC_BADADDR if the twr ID is out of range
LATC_SUCCESS if everything goes well

References LATC_clearByTWR().

int LATC_countBits ( const LATC_map map,
LATC_type  type 
)

Clear a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to count
Returns:
Number of bits set in the map, or -1 for an illegal type

References countMap(), and LATC_map_::ptr.

void LATC_deleteMap ( LATC_map map  ) 

Free the memory allocated for the LATC_map structure.

Parameters:
map Pointer to a map created by LATC_newMap

Referenced by LATC_deleteIMM().

void LATC_dumpMap ( LATC_map map,
FILE *  fp 
)

Print out the map.

Parameters:
map Pointer to an initialised map structure
fp Pointer to file where the map should be written

References LATC_map_::ptr, and sizeofMap().

LATC_map* LATC_newMap ( void   ) 

Allocate and initialise a new LATC_map.

Returns:
Pointer to an initialised LATC_map allocated with MBA_alloc, or NULL if the memory allocation failed.

References LATC_map_::ptr, and sizeofMap().

Referenced by LATC_newIMM().

void LATC_setACD ( LATC_map map  ) 

Set all the bits in the ARC and AFE submaps.

Parameters:
map Pointer to a LATC_map structure

References LATC_map_::ptr, and setMap().

unsigned LATC_setBit ( LATC_map map,
LATC_type  type,
const LATC_addr addr 
)

Set a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to set
Returns:
One of LATC_msgs, LATC_SUCCESS on success

References mapIndex(), LATC_map_::ptr, and setBit().

unsigned LATC_setByTWR ( LATC_map map,
LATC_type  type,
unsigned  twr 
)

Parameters:
map Pointer to a LATC_map structure
type Identifies the sub-map to manipulate
twr Index of a tower
Return values:
LATC_BADTYPE if the type does not exist
LATC_MAPLESS if there is no sub-map corresponding to this type
LATC_BADADDR if the twr ID is out of range
LATC_SUCCESS if everything goes well

References mapRange(), LATC_map_::ptr, and setBit().

Referenced by LATC_setTWR().

void LATC_setMap ( LATC_map map  ) 

Set the map.

Parameters:
map Pointer to a LATC_map structure

References LATC_map_::ptr, and setMap().

unsigned LATC_setTWR ( LATC_map map,
unsigned  twr 
)

Set all the bits in TEM, TIC, CCC, CRC, CFE, TCC TRC and TFE submaps corresponding to a particular tower.

Parameters:
map Pointer to a LATC_map structure
twr Index of a tower
Return values:
LATC_BADADDR if the twr ID is out of range
LATC_SUCCESS if everything goes well

References LATC_setByTWR().


Generated on Thu Apr 7 17:31:28 2011 by  doxygen 1.5.8