Subversion Repositories f9daq

Rev

Rev 21 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef __LIBCC32_NT_H__
#define __LIBCC32_NT_H__

/*
   libcc32_NT.h -- header for a simple access library (WINNT) for the
                                     PCICC32 PCI to CAMAC Interface from ARW Elektronik

   (c) 2000 ARW Elektronik

   this source code is published under GPL (Open Source). You can use, redistrubute and
   modify it unless this header   is not modified or deleted. No warranty is given that
   this software will work like expected.
   This product is not authorized for use as critical component in life support systems
   wihout the express written approval of ARW Elektronik Germany.
 
   Please announce changes and hints to ARW Elektronik
   
   first steps                                                                                                                  AR   30.07.2000
   added buffer, UNTIL_NOT_Q and AUTOREAD functionality                 AR   17.03.2001
   added interrupt handling                                             AR   08.06.2002
*/



/* open a path to a device. E.g. "/dev/pcicc32_1" */
int   cc32_open_NT(char *cszPath, int nModuleNumber, void **handle);

/* close the opened path */
int   cc32_close_NT(void *handle);

/* read only a word - 16 bits - from a address made out of N,A,F */
unsigned short cc32_read_word_NT(void *handle, unsigned int N, unsigned int A, unsigned int F);

/* read a long - 32 bits - from a address made out of N,A,F and get the result Q and X */
unsigned long cc32_read_long_NT(void *handle, unsigned int N, unsigned int A, unsigned int F, char *Q, char *X);

/* read a long - 32 bits - without any interpretaion */
unsigned long cc32_read_long_all_NT(void *handle, unsigned int N, unsigned int A, unsigned int F);

/* write a word - 16 bits - to a destination made out of N,A,F */
void  cc32_write_word_NT(void *handle, unsigned int N, unsigned int A, unsigned int F, unsigned short uwData);

/* write a long - 32 bits - uninterpreted to a destination made out of N,A,F */
void  cc32_write_long_NT(void *handle, unsigned int N, unsigned int A, unsigned int F, unsigned long ulData);

/* poll the state of the timeout line and the LAM state. The timeout line is cleared if it was set */
int   cc32_poll_error_NT(void *handle, char *nTimeout, char *nLam);

/* read words until not Q or *pdwLen data into a buffer */
int cc32_read_word_buffer_NT(void * handle, unsigned int N, unsigned int A, unsigned int F,
                                                                                                                                unsigned short *pwBuffer, unsigned long *pdwLen);

/* read longs until not Q or *pdwLen data into a buffer */
int cc32_read_long_buffer_NT(void * handle, unsigned int N, unsigned int A, unsigned int F,
                                                                                                                                unsigned long *pdwBuffer, unsigned long *pdwLen);

/* read longs until not Q or *pdwLen data and don't interpret Q and X information into a buffer */
int cc32_read_long_all_buffer_NT(void * handle, unsigned int N, unsigned int A, unsigned int F,
                                                                                                                                unsigned long *pdwBuffer, unsigned long *pdwLen);

/* switch UNTIL_NOT_Q or AUTOREAD on or off */
int cc32_access_switch_NT(void *handle, unsigned short uwSwitch);

/* switch interrupts on */
int cc32_enable_interrupt_NT(void *handle);

/* switch interrupts off */
int cc32_disable_interrupt_NT(void *handle);

/* wait blocking for the next interrupt */
int cc32_get_interrupt_NT(void *handle, unsigned long *dwStatus);

#endif // __LIBCC32_NT_H__