sis3320drv.h File Reference

Go to the source code of this file.

Functions

uint32_t sis3320_RegisterRead (MVME_INTERFACE *mvme, uint32_t a32base, int offset)
void sis3320_RegisterWrite (MVME_INTERFACE *mvme, uint32_t a32base, int offset, uint32_t value)
void sis3320_Reset (MVME_INTERFACE *mvme, uint32_t a32base)
void sis3320_Status (MVME_INTERFACE *mvme, uint32_t a32base)
int sis3320_Setup (MVME_INTERFACE *mvme, uint32_t a32base, int mode)


Function Documentation

uint32_t sis3320_RegisterRead ( MVME_INTERFACE mvme,
uint32_t  a32base,
int  offset 
)

Definition at line 43 of file sis3320.c.

00044 {
00045   return regRead(mvme,base,offset);
00046 }

void sis3320_RegisterWrite ( MVME_INTERFACE mvme,
uint32_t  a32base,
int  offset,
uint32_t  value 
)

Definition at line 49 of file sis3320.c.

00050 {
00051   regWrite(mvme, base, offset, value);
00052 }

void sis3320_Reset ( MVME_INTERFACE mvme,
uint32_t  a32base 
)

Definition at line 55 of file sis3320.c.

00056 {
00057   regWrite(mvme, base, SIS3320_KEY_RESET, 0);
00058 }

int sis3320_Setup ( MVME_INTERFACE mvme,
uint32_t  base,
int  mode 
)

Sets all the necessary paramters for a given configuration. The configuration is provided by the mode argument. Add your own configuration in the case statement. Let me know your setting if you want to include it in the distribution.

Parameters:
*mvme VME structure
base Module base address
mode Configuration mode number
*nentry number of entries requested and returned.
Returns:
MVME_SUCCESS

Definition at line 83 of file sis3320.c.

00084 {
00085   switch (mode) {
00086   case 0x1:
00087     printf("--------------------------------------------\n");
00088     printf("200Msps 1evt (mode:%d)\n", mode);
00089     printf("Sample Length Stop, Sample Length 256\n");
00090     printf("Sample Start Address 0x0\n");
00091     printf("ADC input mode 32bits\n");
00092     printf("Trigger from LEMO\n");
00093     printf("--------------------------------------------\n");
00094 
00095     regWrite(mvme, base, SIS3320_MAX_NOF_EVENT, 1);
00096     regWrite(mvme, base, SIS3320_EVENT_CONFIG_ALL_ADC, EVENT_CONF_ENABLE_SAMPLE_LENGTH_STOP);
00097     regWrite(mvme, base, SIS3320_SAMPLE_LENGTH_ALL_ADC, 0x1FC);  // 0x200 or 512
00098     regWrite(mvme, base, SIS3320_SAMPLE_START_ADDRESS_ALL_ADC, 0x0);
00099     regWrite(mvme, base, SIS3320_ADC_INPUT_MODE_ALL_ADC, 0x20000);
00100     regWrite(mvme, base, SIS3320_ACQUISTION_CONTROL
00101              , SIS3320_ACQ_SET_CLOCK_TO_200MHZ | SIS3320_ACQ_ENABLE_LEMO_START_STOP);
00102     printf("\n");
00103     break;
00104   case 0x2:
00105     printf("--------------------------------------------\n");
00106     printf("50Msps 1evt (mode:%d)\n", mode);
00107     printf("Sample Length Stop, Sample Length 256\n");
00108     printf("Sample Start Address 0x0\n");
00109     printf("ADC input mode 32bits\n");
00110     printf("Trigger from LEMO\n");
00111     printf("--------------------------------------------\n");
00112 
00113     regWrite(mvme, base, SIS3320_MAX_NOF_EVENT, 1);
00114     regWrite(mvme, base, SIS3320_EVENT_CONFIG_ALL_ADC, EVENT_CONF_ENABLE_SAMPLE_LENGTH_STOP);
00115     regWrite(mvme, base, SIS3320_SAMPLE_LENGTH_ALL_ADC, 0x1FC);  // 0x200 or 512
00116     regWrite(mvme, base, SIS3320_SAMPLE_START_ADDRESS_ALL_ADC, 0x0);
00117     regWrite(mvme, base, SIS3320_ADC_INPUT_MODE_ALL_ADC, 0x20000);
00118     regWrite(mvme, base, SIS3320_ACQUISTION_CONTROL
00119              , SIS3320_ACQ_SET_CLOCK_TO_50MHZ | SIS3320_ACQ_ENABLE_LEMO_START_STOP);
00120     printf("\n");
00121     break;
00122   default:
00123     printf("Unknown setup mode\n");
00124     return -1;
00125   }
00126   sis3320_Status(mvme, base);
00127   return 0;
00128 }

void sis3320_Status ( MVME_INTERFACE mvme,
uint32_t  a32base 
)

Definition at line 61 of file sis3320.c.

Referenced by sis3320_Setup().

00062 {
00063   printf("================================================\n");
00064   printf("SIS3320 at A32 0x%x\n", (int)base);
00065   printf("CSR                  : 0x%8.8x\n", regRead(mvme, base, SIS3320_CONTROL_STATUS));
00066   printf("ModuleID and Firmware: 0x%x\n", regRead(mvme, base, SIS3320_MODID));
00067   printf("Max Event Counter    :   %d\n", regRead(mvme, base, SIS3320_MAX_NOF_EVENT));
00068   printf("================================================\n");
00069 }


Midas DOC Version 3.0.0 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Exaos Lee - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk