GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > RIM / V0-0-5

Constituent: rim     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

map.h File Reference

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

#include "RIM/lrd.h"
#include <unistd.h>
#include <stdio.h>

Include dependency graph for map.h:

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


Typedefs

typedef RIM_map_ RIM_map
 Forward declaration of the RIM_map structure, a bit-map of all the LAT components.

Functions

size_t RIM_sizeofMap (void)
 Calculate the total size of a RIM_map object.
RIM_mapRIM_constructMap (void *buffer)
 Initialise the supplied memory as a RIM_map object.
unsigned RIM_setBit (RIM_map *map, RIM_type type, const RIM_addr *addr)
 Set a bit in the map.
unsigned RIM_clearBit (RIM_map *map, RIM_type type, const RIM_addr *addr)
 Clear a bit in the map.
int RIM_checkBit (const RIM_map *map, RIM_type type, const RIM_addr *addr)
 Check a bit in the map.
int RIM_countBits (const RIM_map *map, RIM_type type)
 Clear a bit in the map.
void RIM_setACD (RIM_map *map)
 Set all the bits in the ARC and AFE submaps.
void RIM_clearACD (RIM_map *map)
 Clear all the bits in the ARC and AFE submaps.
unsigned RIM_setTWR (RIM_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 RIM_clearTWR (RIM_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 RIM_setByTWR (RIM_map *map, RIM_type type, unsigned twr)
unsigned RIM_clearByTWR (RIM_map *map, RIM_type type, unsigned twr)
void RIM_setMap (RIM_map *map)
 Set the map.
void RIM_clearMap (RIM_map *map)
 Clear the map.
void RIM_dumpMap (RIM_map *map, FILE *fp)
 Print out the map.
unsigned RIM_createMap (RIM_map *map, int fd)
 Write out the data of a RIM_map structure.
unsigned RIM_consumeMap (RIM_map *map, int fd)
 Read map data into the map structure.

Detailed Description

Configuration map creation, initialisation and manipulation functions.

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

Function Documentation

int RIM_checkBit const RIM_map map,
RIM_type  type,
const RIM_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

void RIM_clearACD RIM_map map  ) 
 

Clear all the bits in the ARC and AFE submaps.

Parameters:
map Pointer to a RIM_map structure

unsigned RIM_clearBit RIM_map map,
RIM_type  type,
const RIM_addr addr
 

Clear a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to clear
Return values:
RIM_TYPE_UK if the type does not exist
RIM_MAP_NONE if there is no sub-map corresponding to this type
RIM_ADDR_BCAST if the address contains a mixture of broadcast and singlecast addresses
RIM_ADDR_RANGE if any component of the address is out of range
RIM_ADDR_INDEX if the final index exceeds the total number of bits in the map
RIM_SUCCESS if everything goes well

unsigned RIM_clearByTWR RIM_map map,
RIM_type  type,
unsigned  twr
 

Parameters:
map Pointer to a RIM_map structure
type Identifies the sub-map to manipulate
twr Index of a tower
Return values:
RIM_TYPE_UK if the type does not exist
RIM_MAP_NONE if there is no sub-map corresponding to this type
RIM_ADDR_BCAST if the address contains a mixture of broadcast and singlecast addresses
RIM_ADDR_RANGE if any component of the address is out of range
RIM_ADDR_INDEX if the final index exceeds the total number of bits in the map
RIM_SUCCESS if everything goes well

void RIM_clearMap RIM_map map  ) 
 

Clear the map.

Parameters:
map Structure being manipulated

unsigned RIM_clearTWR RIM_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 RIM_map structure
twr Index of a tower
Return values:
RIM_ADDR_RANGE if the twr ID is out of range
RIM_SUCCESS if everything goes well

RIM_map* RIM_constructMap void *  buf  ) 
 

Initialise the supplied memory as a RIM_map object.

Parameters:
buf Block of memory, at least as large as RIM_sizeofMap, to initalise as a RIM_map object
Returns:
Pointer to an initialise RIM_map object

unsigned RIM_consumeMap RIM_map map,
int  fd
 

Read map data into the map structure.

Parameters:
map Map structure to populate from file
fd Descriptor of a file opened for reading
Return values:
RIM_SUCCESS if all goes well
RIM_FILE_READ if an error occures whilst the file is being read
RIM_FILE_END if the end of the file is unexpectedly encountered

int RIM_countBits const RIM_map map,
RIM_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

unsigned RIM_createMap RIM_map map,
int  fd
 

Write out the data of a RIM_map structure.

Parameters:
map Pointer to the RIM_map whose data should be written to file
fd Descriptor of a file opened for writing
Return values:
RIM_SUCCESS if all goes well
RIM_FILE_WRITE if one of the file write operations failed

void RIM_dumpMap RIM_map map,
FILE *  fp
 

Print out the map.

Parameters:
fp Pointer to file to dump the map to
map Pointer to an initialised map structure

void RIM_setACD RIM_map map  ) 
 

Set all the bits in the ARC and AFE submaps.

Parameters:
map Pointer to a RIM_map structure

unsigned RIM_setBit RIM_map map,
RIM_type  type,
const RIM_addr addr
 

Set a bit in the map.

Parameters:
map Structure being manipulated
type Identifies map to manipulate
addr bit to set
Return values:
RIM_TYPE_UK if the type does not exist
RIM_MAP_NONE if there is no sub-map corresponding to this type
RIM_ADDR_BCAST if the address contains a mixture of broadcast and singlecast addresses
RIM_ADDR_RANGE if any component of the address is out of range
RIM_ADDR_INDEX if the final index exceeds the total number of bits in the map
RIM_SUCCESS if everything goes well

unsigned RIM_setByTWR RIM_map map,
RIM_type  type,
unsigned  twr
 

Parameters:
map Pointer to a RIM_map structure
type Identifies the sub-map to manipulate
twr Index of a tower
Return values:
RIM_TYPE_UK if the type does not exist
RIM_MAP_NONE if there is no sub-map corresponding to this type
RIM_ADDR_BCAST if the address contains a mixture of broadcast and singlecast addresses
RIM_ADDR_RANGE if any component of the address is out of range
RIM_ADDR_INDEX if the final index exceeds the total number of bits in the map
RIM_SUCCESS if everything goes well

void RIM_setMap RIM_map map  ) 
 

Set the map.

Parameters:
map Pointer to a RIM_map structure

unsigned RIM_setTWR RIM_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 RIM_map structure
twr Index of a tower
Return values:
RIM_ADDR_RANGE if the twr ID is out of range
RIM_SUCCESS if everything goes well

size_t RIM_sizeofMap void   ) 
 

Calculate the total size of a RIM_map object.

Returns:
Amount of memory required to accomodate a RIM_map object


Generated on Mon Aug 7 21:24:53 2006 by  doxygen 1.4.4