NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
pixie16sys_common.h
1 #ifndef PIXIE16SYS_COMMON_H
2 #define PIXIE16SYS_COMMON_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_common.h
44 *
45 * Description:
46 *
47 * Declaration of prototypes of common functions.
48 *
49 * $Rev: 15626 $
50 * $Id: pixie16sys_common.h 15626 2010-05-07 18:51:20Z 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  unsigned short SYS16_SetBit(unsigned short bit, unsigned short value);
60  unsigned short SYS16_ClrBit(unsigned short bit, unsigned short value);
61  unsigned short SYS16_TstBit(unsigned short bit, unsigned short value);
62  unsigned int SYS32_SetBit(unsigned short bit, unsigned int value);
63  unsigned int SYS32_ClrBit(unsigned short bit, unsigned int value);
64  unsigned int SYS32_TstBit(unsigned short bit, unsigned int value);
65 
66 
67  int get_ns_per_cycle(double *ns_per_cycle);
68  void wait_for_a_short_time(int cycles);
69 
70  int Pixie_DSP_Memory_Burst_Read (
71  unsigned int *dsp_data, // DSP data for the I/O
72  unsigned int dsp_address, // DSP data memory address
73  unsigned int nWords, // Number of DSP data words for the I/O
74  unsigned short ModNum ); // The Pixie module for the I/O
75 
76 
77  int I2CM24C64_start(unsigned short ModNum);
78 
79  int I2CM24C64_stop(unsigned short ModNum);
80  int I2CM24C64_byte_write(unsigned short ModNum, char ByteToSend);
81  int I2CM24C64_byte_read(unsigned short ModNum, char *ByteToReceive);
82 
83  char I2CM24C64_getACK(unsigned short ModNum);
84  char I2CM24C64_sendACK(unsigned short ModNum);
85 
86 
87 #ifdef __cplusplus
88 }
89 #endif // End of notice for C++ compilers
90 
91 #endif // End of pixie16sys_common.h