Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
169 f9daq 1
//==============================================================================
2
//
3
// Title:               sis3153.c
4
// Purpose:             A short description of the implementation.
5
//
6
// Created on:  10.7.2016 at 8:53:29 by Samo Korpar.
7
// Copyright:   . All Rights Reserved.
8
//
9
//==============================================================================
10
 
11
//==============================================================================
12
// Include files
13
 
14
#include <ansi_c.h>
15
#include <stdint.h>
16
//#include <wtypes.h>
17
#include "sis3153.h"
18
#include "sis3153w.h"
19
 
20
//==============================================================================
21
// Constants
22
#define MAX_SIS_DEV 5
23
//==============================================================================
24
// Types
25
 
26
//==============================================================================
27
// Static global variables
28
static unsigned int SISndev;
29
static SIS3153W_STATUS SISstat;
30
static struct SIS3153USB_Device_Struct SISdevs[MAX_SIS_DEV];
31
static HANDLE SIShandle=NULL;
32
 
33
//==============================================================================
34
// Static functions
35
 
36
//==============================================================================
37
// Global variables
38
 
39
//==============================================================================
40
// Global functions
41
 
42
/// HIFN  What does your function do?
43
/// HIPAR x/What inputs does your function expect?
44
/// HIRET What does your function return?
45
 
46
int SIS3153_USB_VME_START (char *node)
47
{
48
  SISstat=FindAll_SIS3153USB_Devices(SISdevs,&SISndev,MAX_SIS_DEV);
49
  printf("SISndev=%d\n",SISndev);
50
  SISstat=Sis3153usb_OpenDriver(&SISdevs[0]);
51
  SIShandle=SISdevs[0].hUsb;
52
  return 0;
53
}
54
 
55
int SIS3153_USB_VME_STOP (void)
56
{
57
  SISstat=Sis3153usb_CloseDriver(SIShandle);
58
        return 0;
59
}
60
 
61
short __stdcall SIS3153_USB_VME_R(uint16_t AM, uint16_t DW,  uint32_t VME_Address, uint32_t *Data)
62
{
63
  SISstat=sis3153Usb_Vme_Single_Read(SIShandle,VME_Address,AM,DW,Data);
64
  return 0;
65
}
66
 
67
short __stdcall SIS3153_USB_VME_W(uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data)
68
{
69
  SISstat=sis3153Usb_Vme_Single_Write(SIShandle,VME_Address,AM,DW,Data);
70
        return 0;
71
}
72
 
73
short __stdcall SIS3153_USB_VME_MWRST(void)
74
{
75
        return 0;
76
}
77
 
78
short __stdcall SIS3153_USB_VME_MW(uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data)
79
{
80
  SISstat=sis3153Usb_Vme_Single_Write(SIShandle,VME_Address,AM,DW,Data);
81
        return 0;
82
}
83
 
84
short __stdcall SIS3153_USB_VME_MWEXEC(void)
85
{
86
        return 0;
87
}
88
 
89
short __stdcall SIS3153_USB_VME_MRRST(void)
90
{
91
        return 0;
92
}
93
 
94
short __stdcall SIS3153_USB_VME_MR(uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data)
95
{
96
  SISstat=sis3153Usb_Vme_Single_Read(SIShandle,VME_Address,AM,DW,Data);
97
        return 0;
98
}
99
 
100
short __stdcall SIS3153_USB_VME_MREXEC(uint32_t *Data)
101
{
102
        return 0;
103
}