GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MEM / V3-1-0

Constituent: mem     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

memload.c File Reference

Memory Load functions. More...

#include <string.h>
#include "CCSDS/CCSDS_pkt.h"
#include "MEM/MEMCMD.h"
#include "MEM/MEM_load.h"
#include "MEM/MEM_msgs.h"
#include "MSG/MSG_pubdefs.h"
#include "mempriv.h"
#include "PBS/MBA.h"

Include dependency graph for memload.c:

Include dependency graph

Data Structures

struct  _mem_LoadContext
 Memory Load context. More...


Defines

#define MEM_LOAD_KEY_VALID   (0x124578ab)
 Load info 'valid' key value.

#define MEM_LOAD_MEM_WRITE_MAX_WORDS   (4096 / 4)
 Maximum number of words that can be loaded with a Memory Write telecommand.


Typedefs

typedef _mem_LoadContext mem_LoadContext
 Typedef for _mem_LoadContext.


Enumerations

enum  mem_LoadState {
  MEM_LOAD_IDLE,
  MEM_LOAD_ACTIVE
}

Functions

unsigned int mem_loadCheckHandle (const MEM_LoadHandle handle, mem_LoadContext **context_pp, int check_state, mem_LoadState exp_state)
 Validate a Memory Load context handle.

unsigned int mem_loadUpdateStatus (mem_LoadContext *context_p, const unsigned int status)
 Update load context status.

unsigned int mem_loadResetContext (mem_LoadContext *context_p)
 Reset the state of a load context.

unsigned int MEM_loadInit (void)
 Start the Memory Load system.

unsigned int MEM_loadGetContext (MEM_LoadHandle *handle_p)
 Allocate a Memory Load context.

unsigned int MEM_loadReleaseContext (MEM_LoadHandle handle)
 Release a Memory Load context.

unsigned int MEM_loadGetInfo (const MEM_LoadHandle handle, MEM_LoadInfo *info_p)
 Get detailed information about a Memory Load context.

unsigned int MEM_loadStartMemory (MEM_LoadHandle handle, const unsigned int address, const unsigned int word_count, const unsigned int *data_p)
unsigned int mem_loadPktMemory (MEM_LoadHandle handle, const unsigned short body_bytes, const void *body_p)
unsigned int mem_loadPktPCI (MEM_LoadHandle handle, const unsigned short body_bytes, const void *body)
unsigned int mem_loadPktReg (MEM_LoadHandle handle, const unsigned short body_bytes, const void *body)
unsigned int MEM_loadPkt (MEM_LoadHandle handle, const unsigned short apid, const unsigned short func_code, const unsigned short body_bytes, const void *body_p)
 Handle Memory Load telecommand packets.

unsigned int MEM_loadWrite (MEM_LoadHandle handle)
 Write data for a Memory Load context.


Detailed Description

Memory Load functions.

These functions handle Memory Load telecommands and the resulting load operations.

  CVS $Id: memload.c,v 1.9 2004/11/19 22:01:04 dmay Exp $
  

Typedef Documentation

mem_LoadContext
 

Typedef for _mem_LoadContext.

The typedef for _mem_LoadContext.


Enumeration Type Documentation

enum mem_LoadState
 

The typedef for the load state enum, which is a list of all possible states for a load.

Enumeration values:
MEM_LOAD_IDLE  Load is idle, i.e. not active.
MEM_LOAD_ACTIVE  Load is active, i.e. in progress.


Function Documentation

unsigned int mem_loadCheckHandle const MEM_LoadHandle  handle,
mem_LoadContext **  context_pp,
int  check_state,
mem_LoadState  exp_state
[static]
 

Validate a Memory Load context handle.

Validate a Memory Load context handle and return a pointer to the corresponding context.

Parameters:
handle Handle for the context.
context_pp Pointer to location to return context pointer.
check_state Check context state? nonzero => yes, 0 => no.
exp_state Expected context state.
Returns:
A MEM MSG code.

unsigned int MEM_loadGetContext MEM_LoadHandle handle_p  ) 
 

Allocate a Memory Load context.

Allocate a Memory Load context. This is analogous to a constructor for a context. This function returns only a handle to a context. The details of the context are hidden from the user. The MEM_loadGetInfo() function can be used to get detailed information about the context.

Parameters:
handle_p Pointer to location to return context handle.
Returns:
A MEM MSG code.

Here is the call graph for this function:

unsigned int MEM_loadGetInfo const MEM_LoadHandle  handle,
MEM_LoadInfo info_p
 

Get detailed information about a Memory Load context.

Get information about a Memory Load context. The information returned is a subset of the context details that are normally hidden from the user.

Parameters:
handle Handle for context.
info_p Pointer to location to return context info.
Returns:
A MEM MSG code.

Here is the call graph for this function:

unsigned int MEM_loadInit void   ) 
 

Start the Memory Load system.

Start the Memory Load system. This function should be called once to initialize the internal state associated with the Memory Load telecommand handler.

Returns:
A MEM MSG code.

unsigned int MEM_loadPkt MEM_LoadHandle  handle,
const unsigned short  apid,
const unsigned short  func_code,
const unsigned short  body_bytes,
const void *  body_p
 

Handle Memory Load telecommand packets.

Announces the arrival of a new Memory Load telecommand CCSDS packet. Updates the Memory Load context to reflect the start of a load operation.

Parameters:
handle Handle for load context.
apid APID extracted from the packet header.
func_code Function code extracted from the packet header.
body_bytes Length of packet body and checksum, in bytes
body_p Pointer to packet body.
Returns:
A MEM MSG code.

Here is the call graph for this function:

unsigned int mem_loadPktMemory MEM_LoadHandle  handle,
const unsigned short  body_bytes,
const void *  body_p
[static]
 

Announces the arrival of a Memory Write telecommand CCSDS packet. Updates the Memory Load context to reflect the start of a load operation.

Parameters:
handle Handle for load context.
body_bytes Length of packet body and checksum, in bytes
body_p Pointer to packet body.
Returns:
A MEM MSG code.

Here is the call graph for this function:

unsigned int mem_loadPktPCI MEM_LoadHandle  handle,
const unsigned short  body_bytes,
const void *  body
[static]
 

Announces the arrival of a PCI Device Header Write telecommand CCSDS packet. Updates the Memory Load context to reflect the start of a load operation.

Parameters:
handle Handle for load context.
body_bytes Length of packet body and checksum, in bytes
body Pointer to packet body.
Returns:
A MEM MSG code.

unsigned int mem_loadPktReg MEM_LoadHandle  handle,
const unsigned short  body_bytes,
const void *  body
[static]
 

Announces the arrival of a Processor Register Write telecommand CCSDS packet. Updates the Memory Load context to reflect the start of a load operation.

Parameters:
handle Handle for load context.
body_bytes Length of packet body and checksum, in bytes
body Pointer to packet body.
Returns:
A MEM MSG code.

unsigned int MEM_loadReleaseContext MEM_LoadHandle  handle  ) 
 

Release a Memory Load context.

Release a Memory Load context so that the memory associated to it can be re-allocated. This is analogous to a destructor for a context.

Parameters:
handle Handle for context to release.
Returns:
A MEM MSG code.

Here is the call graph for this function:

unsigned int mem_loadResetContext mem_LoadContext context_p  )  [static]
 

Reset the state of a load context.

Reset the state of a load context.

Parameters:
context_p Pointer to load context.
Returns:
A MEM MSG code.

unsigned int MEM_loadStartMemory MEM_LoadHandle  handle,
const unsigned int  address,
const unsigned int  word_count,
const unsigned int *  data_p
 

Start a Memory Write operation. Updates the Memory Load context to reflect the start of a load operation.

Parameters:
handle Handle for load context.
address Address at which to write the data.
word_count Number of 32-bit words of data to write.
data_p Pointer to buffer containing the data to write.
Returns:
A MEM MSG code.

Here is the call graph for this function:

unsigned int mem_loadUpdateStatus mem_LoadContext context_p,
const unsigned int  status
[static]
 

Update load context status.

Update a load context with the specified status.

Parameters:
context_p Pointer to load context.
status Most recent function status.
Returns:
A MEM MSG code.

unsigned int MEM_loadWrite MEM_LoadHandle  handle  ) 
 

Write data for a Memory Load context.

Write another chunk of data for the specified Memory Load context. This function should be called repeatedly until all the data associated with the context has been written to memory. The status of the Memory Load operation can be obtained with the MEM_loadGetInfo() function.

Parameters:
handle Handle for context in which to write the data.
Returns:
A MEM MSG code.

Here is the call graph for this function:


Generated on Mon Dec 13 07:32:13 2004 by doxygen 1.3.3