GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / dev > latc_cmn / rhel4-32
#include <LATC/LATC_msgs.h>
#include <map_p.h>
#include <addr.h>
#include <number.ic>
#include <AG_latcType_s.h>
#include <PBS/MBA.h>
#include <LEM/msg_macros.h>
#include <string.h>
Functions | |
LATC_map * | LATC_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_countBits (const LATC_map *map, LATC_type type) |
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. | |
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. | |
unsigned | mapIndex (const LATC_map *map, LATC_type type, const LATC_addr *addr, unsigned *index) |
Convert the address into an index appropriate for this type of map as well as performing various checks on the input parameters. | |
unsigned | mapRange (const LATC_map *map, LATC_type type, unsigned twr, unsigned *start, unsigned *end) |
Find start and end indicies to use in a loop over all the bits in one tower (ie the first bit of the tower and the bit one past the last bit of the same tower). |
Check a bit in the map.
map | Structure being manipulated | |
type | Identifies map to manipulate | |
addr | bit to check |
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.
map | Pointer to a LATC_map structure |
References clearMap(), and LATC_map_::ptr.
Clear a bit in the map.
map | Structure being manipulated | |
type | Identifies map to manipulate | |
addr | bit to clear |
References clearBit(), mapIndex(), and LATC_map_::ptr.
map | Pointer to a LATC_map structure | |
type | Identifies the sub-map to manipulate | |
twr | Index of a tower |
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.
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.
map | Pointer to a LATC_map structure | |
twr | Index of a tower |
LATC_BADADDR | if the twr ID is out of range | |
LATC_SUCCESS | if everything goes well |
References LATC_clearByTWR().
Clear a bit in the map.
map | Structure being manipulated | |
type | Identifies map to count |
References countMap(), and LATC_map_::ptr.
void LATC_deleteMap | ( | LATC_map * | map | ) |
Free the memory allocated for the LATC_map structure.
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.
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.
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.
map | Pointer to a LATC_map structure |
References LATC_map_::ptr, and setMap().
Set a bit in the map.
map | Structure being manipulated | |
type | Identifies map to manipulate | |
addr | bit to set |
References mapIndex(), LATC_map_::ptr, and setBit().
map | Pointer to a LATC_map structure | |
type | Identifies the sub-map to manipulate | |
twr | Index of a tower |
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.
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.
map | Pointer to a LATC_map structure | |
twr | Index of a tower |
LATC_BADADDR | if the twr ID is out of range | |
LATC_SUCCESS | if everything goes well |
References LATC_setByTWR().
unsigned mapIndex | ( | const LATC_map * | map, | |
LATC_type | type, | |||
const LATC_addr * | addr, | |||
unsigned * | index | |||
) |
Convert the address into an index appropriate for this type of map as well as performing various checks on the input parameters.
map | Pointer to a map structure | |
type | Type of the map | |
addr | Pointer to an address structure identifying the required bit | |
index | Pointer to location to store the calculated index |
LATC_BADTYPE | if the type does not exist | |
LATC_MAPLESS | if there is no sub-map corresponding to this type | |
LATC_BADBCAST | if the address contains a mixture of broadcast and singlecast addresses | |
LATC_BADADDR | if any component of the address is out of range | |
LATC_BADINDEX | if the final index exceeds the total number of bits in the map | |
LATC_SUCCESS | if everything goes well |
References LATC_getIndex().
Referenced by LATC_checkBit(), LATC_clearBit(), LATC_setBit(), and mapRange().
unsigned mapRange | ( | const LATC_map * | map, | |
LATC_type | type, | |||
unsigned | twr, | |||
unsigned * | start, | |||
unsigned * | end | |||
) |
Find start and end indicies to use in a loop over all the bits in one tower (ie the first bit of the tower and the bit one past the last bit of the same tower).
map | Pointer to a map structure | |
type | Type of the map | |
twr | Tower ID | |
start | Pointer to location to store the index of the start bit | |
end | Pointer to location to store the index of the end bit |
LATC_BADTYPE | if the type does not exist | |
LATC_MAPLESS | if there is no sub-map corresponding to this type | |
LATC_BADBCAST | if the address contains a mixture of broadcast and singlecast addresses | |
LATC_BADADDR | if any component of the address is out of range | |
LATC_BADINDEX | if the final index exceeds the total number of bits in the map | |
LATC_SUCCESS | if everything goes well |
References LATC_addr::cpt, LATC_getIndex(), and mapIndex().
Referenced by LATC_clearByTWR(), and LATC_setByTWR().