Subversion Repositories f9daq

Rev

Blame | Last modification | View Log | RSS feed

//==============================================================================
//
// Title:               sis3153.c
// Purpose:             A short description of the implementation.
//
// Created on:  10.7.2016 at 8:53:29 by Samo Korpar.
// Copyright:   . All Rights Reserved.
//
//==============================================================================

//==============================================================================
// Include files

#include <ansi_c.h>
#include <stdint.h>
//#include <wtypes.h>
#include "sis3153.h"
#include "sis3153w.h"

//==============================================================================
// Constants
#define MAX_SIS_DEV 5
//==============================================================================
// Types

//==============================================================================
// Static global variables
static unsigned int SISndev;
static SIS3153W_STATUS SISstat;
static struct SIS3153USB_Device_Struct SISdevs[MAX_SIS_DEV];
static HANDLE SIShandle=NULL;

//==============================================================================
// Static functions

//==============================================================================
// Global variables

//==============================================================================
// Global functions

/// HIFN  What does your function do?
/// HIPAR x/What inputs does your function expect?
/// HIRET What does your function return?

int SIS3153_USB_VME_START (char *node)
{
  SISstat=FindAll_SIS3153USB_Devices(SISdevs,&SISndev,MAX_SIS_DEV);
  printf("SISndev=%d\n",SISndev);
  SISstat=Sis3153usb_OpenDriver(&SISdevs[0]);
  SIShandle=SISdevs[0].hUsb;
  return 0;
}

int SIS3153_USB_VME_STOP (void)
{
  SISstat=Sis3153usb_CloseDriver(SIShandle);
        return 0;
}

short __stdcall SIS3153_USB_VME_R(uint16_t AM, uint16_t DW,  uint32_t VME_Address, uint32_t *Data)
{
  SISstat=sis3153Usb_Vme_Single_Read(SIShandle,VME_Address,AM,DW,Data);
  return 0;
}

short __stdcall SIS3153_USB_VME_W(uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data)
{
  SISstat=sis3153Usb_Vme_Single_Write(SIShandle,VME_Address,AM,DW,Data);
        return 0;
}

short __stdcall SIS3153_USB_VME_MWRST(void)
{
        return 0;
}

short __stdcall SIS3153_USB_VME_MW(uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data)
{
  SISstat=sis3153Usb_Vme_Single_Write(SIShandle,VME_Address,AM,DW,Data);
        return 0;
}

short __stdcall SIS3153_USB_VME_MWEXEC(void)
{
        return 0;
}

short __stdcall SIS3153_USB_VME_MRRST(void)
{
        return 0;
}

short __stdcall SIS3153_USB_VME_MR(uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data)
{
  SISstat=sis3153Usb_Vme_Single_Read(SIShandle,VME_Address,AM,DW,Data);
        return 0;
}

short __stdcall SIS3153_USB_VME_MREXEC(uint32_t *Data)
{
        return 0;
}