NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
pixie16sys_export.h
1 #ifndef PIXIE16SYS_EXPORT_H
2 #define PIXIE16SYS_EXPORT_H
3 
4 /*----------------------------------------------------------------------
5 * Copyright (c) 2005 - 2009, XIA LLC
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted provided
10 * that the following conditions are met:
11 *
12 * * Redistributions of source code must retain the above
13 * copyright notice, this list of conditions and the
14 * following disclaimer.
15 * * Redistributions in binary form must reproduce the
16 * above copyright notice, this list of conditions and the
17 * following disclaimer in the documentation and/or other
18 * materials provided with the distribution.
19 * * Neither the name of XIA LLC nor the names of its
20 * contributors may be used to endorse or promote
21 * products derived from this software without
22 * specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
25 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
26 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
34 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
35 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *----------------------------------------------------------------------*/
38 
39 /******************************************************************************
40 *
41 * File Name:
42 *
43 * pixie16sys_export.h
44 *
45 * Description:
46 *
47 * Function prototypes seen by user applications.
48 *
49 * $Rev: 18950 $
50 * $Id: pixie16sys_export.h 18950 2011-06-01 00:53:43Z htan $
51 ******************************************************************************/
52 
53 // If this is compiled by a C++ compiler, make it
54 // clear that these are C routines.
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 #ifndef __PIXIE16SYS_DEFS_H
60 #include "pixie16sys_defs.h"
61 #endif
62 
63 
64  PIXIE16SYS_EXPORT int Pixie_InitSystem (
65  unsigned short NumModules,
66  unsigned short *PXISlotMap,
67  unsigned short OfflineMode );
68 
69  PIXIE16SYS_EXPORT int Pixie_ClosePCIDevices (
70  unsigned short ModNum );
71 
72  PIXIE16SYS_EXPORT int Pixie_Boot_CompFPGA (
73  unsigned short ModNum,
74  unsigned int *Com_FPGA_conf,
75  unsigned int NumComFPGAconf );
76 
77  PIXIE16SYS_EXPORT int Pixie_Boot_TrigFPGA (
78  unsigned short ModNum,
79  unsigned int *Trig_FPGA_conf,
80  unsigned int NumTrigFPGAconf );
81 
82  PIXIE16SYS_EXPORT int Pixie_Boot_FIPPI (
83  unsigned short ModNum,
84  unsigned int *SP_FPGA_conf,
85  unsigned int NumSPFPGAconf );
86 
87  PIXIE16SYS_EXPORT int Pixie_Boot_DSP (
88  unsigned short ModNum,
89  unsigned int *DSP_code,
90  unsigned int NumDSPCodeWords );
91 
92  PIXIE16SYS_EXPORT int Pixie_DSP_Memory_IO (
93  unsigned int *dsp_data, // DSP data for the I/O
94  unsigned int dsp_address, // DSP data memory address
95  unsigned int nWords, // Number of DSP data words for the I/O
96  unsigned short direction, // I/O direction
97  unsigned short ModNum ); // The Pixie module for the I/O
98 
99  PIXIE16SYS_EXPORT int Pixie_Read_ExtFIFOStatus (
100  unsigned int *nFIFOWords, // Return the number of 32-bit words in the external FIFO
101  unsigned short ModNum ); // The Pixie module being addressed
102 
103  PIXIE16SYS_EXPORT int Pixie_ExtFIFO_Read (
104  unsigned int *extfifo_data,// To receive the external FIFO data
105  unsigned int nWords, // Number of external FIFO data words to read
106  unsigned short ModNum ); // The Pixie module for the I/O
107 
108  PIXIE16SYS_EXPORT int Pixie_Main_Memory_IO (
109  unsigned int *memory_data, // Memory data for the I/O
110  unsigned int memory_address, // Main memory address
111  unsigned int nWords, // Number of data words for the I/O
112  unsigned short direction, // I/O direction
113  unsigned short ModNum ); // The Pixie module for the I/O
114 
115  PIXIE16SYS_EXPORT int Pixie_Clear_Main_Memory (
116  unsigned int memory_address, // Main memory address
117  unsigned int nWords, // Number of data words for the I/O
118  unsigned short ModNum ); // The Pixie module for the I/O
119 
120  PIXIE16SYS_EXPORT int Pixie_Register_IO (
121  unsigned short ModNum, // the Pixie module to communicate to
122  unsigned int address, // register address
123  unsigned short direction, // either MOD_READ or MOD_WRITE
124  unsigned int *value ); // holds or receives the data
125 
126  PIXIE16SYS_EXPORT void Pixie_ReadCSR (
127  unsigned short ModNum,
128  unsigned int *CSR );
129 
130  PIXIE16SYS_EXPORT void Pixie_WrtCSR (
131  unsigned short ModNum,
132  unsigned int CSR );
133 
134  PIXIE16SYS_EXPORT int Pixie_Print_MSG (
135  char *message );
136 
137  PIXIE16SYS_EXPORT int I2CM24C64_Write_One_Byte (
138  unsigned short ModNum, // Pixie module module
139  unsigned short Address, // The address to write this byte
140  char *ByteValue ); // The byte value
141 
142  PIXIE16SYS_EXPORT int I2CM24C64_Read_One_Byte (
143  unsigned short ModNum, // Pixie module number
144  unsigned short Address, // The address to read this byte
145  char *ByteValue ); // The byte value
146 
147  PIXIE16SYS_EXPORT int I2CM24C64_Page_Write (
148  unsigned short ModNum, // Pixie module module
149  unsigned short Address, // The starting address to write this page
150  unsigned short NumBytesToWrite, // The number of bytes for this page to write
151  char *ByteValue ); // The byte values
152 
153  PIXIE16SYS_EXPORT int I2CM24C64_Sequential_Read (
154  unsigned short ModNum, // Pixie module number
155  unsigned short Address, // The starting address to read
156  unsigned short NumBytesToRead, // Number of bytes to read (maximum 32 bytes)
157  char *ByteValue ); // The byte values
158 
159 #ifdef __cplusplus
160 }
161 #endif // End of notice for C++ compilers
162 
163 #endif // End of pixie16sys_export.h