Go to the source code of this file.
Functions | |
static uint32_t | regRead (MVME_INTERFACE *mvme, uint32_t base, int offset) |
static void | regWrite (MVME_INTERFACE *mvme, uint32_t base, int offset, uint32_t value) |
uint32_t | sis3320_RegisterRead (MVME_INTERFACE *mvme, uint32_t base, int offset) |
void | sis3320_RegisterWrite (MVME_INTERFACE *mvme, uint32_t base, int offset, uint32_t value) |
void | sis3320_Reset (MVME_INTERFACE *mvme, uint32_t base) |
void | sis3320_Status (MVME_INTERFACE *mvme, uint32_t base) |
int | sis3320_Setup (MVME_INTERFACE *mvme, uint32_t base, int mode) |
static uint32_t regRead | ( | MVME_INTERFACE * | mvme, | |
uint32_t | base, | |||
int | offset | |||
) | [static] |
Definition at line 24 of file sis3320.c.
00025 { 00026 mvme_set_am(mvme, MVME_AM_A32); 00027 mvme_set_dmode(mvme, MVME_DMODE_D32); 00028 return mvme_read_value(mvme, base + offset); 00029 }
static void regWrite | ( | MVME_INTERFACE * | mvme, | |
uint32_t | base, | |||
int | offset, | |||
uint32_t | value | |||
) | [static] |
Definition at line 35 of file sis3320.c.
00036 { 00037 mvme_set_am(mvme, MVME_AM_A32); 00038 mvme_set_dmode(mvme, MVME_DMODE_D32); 00039 mvme_write_value(mvme, base + offset, value); 00040 }
uint32_t sis3320_RegisterRead | ( | MVME_INTERFACE * | mvme, | |
uint32_t | base, | |||
int | offset | |||
) |
void sis3320_RegisterWrite | ( | MVME_INTERFACE * | mvme, | |
uint32_t | base, | |||
int | offset, | |||
uint32_t | value | |||
) |
void sis3320_Reset | ( | MVME_INTERFACE * | mvme, | |
uint32_t | base | |||
) |
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.
*mvme | VME structure | |
base | Module base address | |
mode | Configuration mode number | |
*nentry | number of entries requested and returned. |
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 | base | |||
) |
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 }