/* ************************************************************** */ /* * Module XMAGPARAM * This module contains functions to assist in parameter handling * for the XMAG module. * * Zachary Wolf * 4/13/01 */ /* ************************************************************** */ /* INCLUDES */ #include #include "xmag.h" /* ************************************************************** */ /* PUBLIC FUNCTIONS */ /* ************************************************************** */ /* * xmagparam_fill_param_struct * This function fills the parameter structure using # defined * parameters. * * Zachary Wolf * 11/16/00 */ void xmagparam_fill_param_struct(struct xmag_param_struct* xmag_param) { /* Declare variables */ int i; /* Include parameter definitions */ #include "param.h" /* Set the XMAG parameters */ xmag_param->board_addr = XMAG_BOARD_ADDR; xmag_param->vrz404a_addr = XMAG_VRZ404a_ADDR; xmag_param->vrz404b_addr = XMAG_VRZ404b_ADDR; xmag_param->device_type = XMAG_DEVICE_TYPE; if (XMAG_NUM_DEV <= XMAG_MAX_NUM_DEV) { xmag_param->num_dev = XMAG_NUM_DEV; } else { printf("\nError: Too many xmag devices requested!\n"); printf("No measurements will be made.\n"); xmag_param->num_dev = 0; } for (i = 0; i < xmag_param->num_dev; i++) { strcpy(xmag_param->dev_name[i], XMAG_DEV_NAME[i]); } /* Done */ return; }