Go to the source code of this file.
Functions | |
void | myStub_sis3803 (void) |
INLINE DWORD | sis3803_module_ID (const DWORD base_adr) |
INLINE void | sis3803_module_reset (const DWORD base_adr) |
INLINE DWORD | sis3803_IRQ_REG_read (const DWORD base_adr) |
INLINE DWORD | sis3803_IRQ_REG_write (const DWORD base_adr, DWORD irq) |
INLINE DWORD | sis3803_input_mode (const DWORD base_adr, DWORD mode) |
INLINE DWORD | sis3803_ref1 (const DWORD base_adr, DWORD endis) |
INLINE void | sis3803_channel_enable (const DWORD base_adr, DWORD pat) |
INLINE void | sis3803_channel_disable (const DWORD base_adr, DWORD pat) |
INLINE DWORD | sis3803_CSR_read (const DWORD base_adr, const DWORD what) |
INLINE DWORD | sis3803_CSR_write (const DWORD base_adr, const DWORD what) |
INLINE void | sis3803_all_clear (const DWORD base_adr) |
INLINE void | sis3803_test_enable (const DWORD base_adr) |
INLINE void | sis3803_test_disable (const DWORD base_adr) |
INLINE void | sis3803_all_enable (const DWORD base_adr) |
INLINE void | sis3803_all_disable (const DWORD base_adr) |
INLINE void | sis3803_grp1_clear (const DWORD base_adr) |
INLINE void | sis3803_grp2_clear (const DWORD base_adr) |
INLINE void | sis3803_single_clear (const DWORD base_adr, const INT ch) |
INLINE void | sis3803_single_OVFL_clear (const DWORD base_adr, INT ch) |
INLINE void | sis3803_counter_read (const DWORD base_adr, INT ch, DWORD *pvalue) |
INLINE void | sis3803_all_read (const DWORD base_adr, DWORD *pvalue) |
INLINE void | sis3803_grp1_read (const DWORD base_adr, DWORD *pvalue) |
INLINE void | sis3803_grp2_read (const DWORD base_adr, DWORD *pvalue) |
INLINE void | sis3803_all_read_clear (const DWORD base_adr, DWORD *pvalue) |
INLINE void | sis3803_OVFL_grp1_read (const DWORD base_adr, DWORD *reg) |
INLINE void | sis3803_OVFL_grp2_read (const DWORD base_adr, DWORD *reg) |
INLINE void | sis3803_int_source_enable (const DWORD base_adr, const int intnum) |
INLINE void | sis3803_int_source_disable (const DWORD base_adr, const int intnum) |
INLINE void | sis3803_int_source (const DWORD base_adr, DWORD int_source) |
INLINE void | sis3803_int_attach (const DWORD base_adr, DWORD base_vect, int level, void(*isr)(void)) |
INLINE void | sis3803_int_detach (const DWORD base_adr, DWORD base_vect, int level) |
INLINE void | sis3803_int_clear (const DWORD base_adr, const int intnum) |
void | sis3803_setup (const DWORD base_adr, int mode, int dsp) |
void | sis3803 (void) |
void | SIS3803_setup (const DWORD base_adr, int mode) |
void | SIS3803_CSR_read (const DWORD base_adr) |
void | SIS3803_all_read (const DWORD base_adr) |
void | SIS3803_all_read_clear (const DWORD base_adr) |
void | SIS3803_all_bread (const DWORD base_adr) |
void | SIS3803_all_bcread (const DWORD base_adr) |
void | test (DWORD mem) |
Variables | |
DWORD * | p = NULL |
void myStub_sis3803 | ( | void | ) |
Definition at line 21 of file sis3803.c.
Referenced by sis3803_int_detach().
00022 { 00023 static int sis3803_private_counter = 0; 00024 #ifdef OS_VXWORKS 00025 sis3803_int_source_disable(0, 0); 00026 logMsg("sis3803 IRQ#%i served\n", sis3803_private_counter++, 0, 0, 0, 0, 0); 00027 sis3803_int_source_enable(0, 0); 00028 #endif 00029 }
void sis3803 | ( | void | ) |
Definition at line 790 of file sis3803.c.
00792 : Display SIS3803 build-in commands 00793 Input: 00794 none 00795 Output: 00796 none 00797 Function value: 00798 none 00799 \**************************************************************/ 00800 { 00801 printf("\n---> SIS 3803 32 MultiScalers (sis3803.c) <---\n"); 00802 printf("Inline : sis3803_module_ID (vmeBase);\n"); 00803 printf("Inline : sis3803_IRQ_REG_read(vmeBase);\n"); 00804 printf("Inline : sis3803_IRQ_REG_write(vmeBase, irq);\n"); 00805 printf("Inline : sis3803_module_reset (vmeBase);\n"); 00806 printf("Inline : sis3803_ref1 (vmeBase, enable/disable);\n"); 00807 printf("Inline : sis3803_channel_enable (vmeBase, pattern);\n"); 00808 printf("Inline : sis3803_channel_disable (vmeBase, pattern);\n"); 00809 printf("Inline : sis3803_CSR_read (vmeBase, what);\n"); 00810 printf("Inline : sis3803_CSR_write (vmeBase, what);\n"); 00811 printf("Inline : sis3803_test_enable(vmeBase);\n"); 00812 printf("Inline : sis3803_test_disable(vmeBase);\n"); 00813 printf("Inline : sis3803_all_clear(vmeBase);\n"); 00814 printf("Inline : sis3803_all_enable(vmeBase);\n"); 00815 printf("Inline : sis3803_all_disable(vmeBase);\n"); 00816 printf("Inline : sis3803_grp1_clear(vmeBase);\n"); 00817 printf("Inline : sis3803_grp2_clear(vmeBase);\n"); 00818 printf("Inline : sis3803_single_clear(vmeBase, ch);\n"); 00819 printf("Inline : sis3803_single_OVFL_clear(vmeBase, ch);\n"); 00820 printf("Inline : sis3803_counter_read(vmeBase, ch, *p);\n"); 00821 printf("Inline : sis3803_all_read(vmeBase, *p);\n"); 00822 printf("Inline : sis3803_grp1_read(vmeBase, *p);\n"); 00823 printf("Inline : sis3803_grp2_read(vmeBase, *p);\n"); 00824 printf("Inline : sis3803_all_read_clear(vmeBase, *p);\n"); 00825 printf("Inline : sis3803_OVFL_grp1_read(vmeBase, *p);\n"); 00826 printf("Inline : sis3803_OVFL_grp2_read(vmeBase, *p);\n"); 00827 printf("Inline : sis3803_int_source (vmeBase, enable/disable);\n"); 00828 printf("Inline : sis3803_int_source_enable (vmeBase, source (0..3));\n"); 00829 printf("Inline : sis3803_int_source_disable (vmeBase, source (0..3));\n"); 00830 printf("Inline : sis3803_int_attach (vmeBase, vect, level, void (*isr)(void));\n"); 00831 printf("Inline : sis3803_int_detach (vmeBase, vect, level);\n"); 00832 printf("Inline : sis3803_int_clear (vmeBase, source (0..3));\n"); 00833 printf(" sis3803_setup(vmeBase, mode, display);\n"); 00834 printf("calls : SIS3803_setup( base_adr, mode)\n"); 00835 printf("calls : SIS3803_CSR_read( base_adr)\n"); 00836 printf("calls : SIS3803_all_read( base_adr) 'sis3803_counter_read()'\n"); 00837 printf("calls : SIS3803_all_read_clear( base_adr) 'sis3803_single_clear'\n"); 00838 printf("calls : SIS3803_all_bread( base_adr) 'sis3803_all_read'\n"); 00839 printf("calls : SIS3803_all_bcread( base_adr) 'sis3803_all_read_clear'\n"); 00840 }
void SIS3803_all_bcread | ( | const DWORD | base_adr | ) |
Definition at line 905 of file sis3803.c.
00906 { 00907 DWORD count[16]; 00908 INT i; 00909 00910 sis3803_all_read_clear(base_adr, &(count[0])); 00911 for (i = 0; i < 16; i++) { 00912 printf("Counter[%i] : %u\n", i, count[i]); 00913 } 00914 }
void SIS3803_all_bread | ( | const DWORD | base_adr | ) |
Definition at line 894 of file sis3803.c.
00895 { 00896 DWORD count[16]; 00897 INT i; 00898 00899 sis3803_all_read(base_adr, &(count[0])); 00900 for (i = 0; i < 16; i++) { 00901 printf("Counter[%i] : %u 0x%x\n", i, count[i], count[i]); 00902 } 00903 }
INLINE void sis3803_all_clear | ( | const DWORD | base_adr | ) |
Definition at line 242 of file sis3803.c.
00244 : Clear all module + overflow bits 00245 Input: 00246 DWORD base_addr : base address of the SIS3803 00247 Output: 00248 none 00249 Function value: 00250 none 00251 \**************************************************************/ 00252 { 00253 volatile DWORD *spec_adr; 00254 00255 spec_adr = (DWORD *) (A32D24 + base_adr + ALL_CLEAR); 00256 *spec_adr = 0x0; 00257 }
INLINE void sis3803_all_disable | ( | const DWORD | base_adr | ) |
Definition at line 314 of file sis3803.c.
00316 : Disable global counting 00317 Input: 00318 DWORD base_addr : base address of the SIS3803 00319 Output: 00320 none 00321 Function value: 00322 none 00323 \**************************************************************/ 00324 { 00325 volatile DWORD *spec_adr; 00326 00327 spec_adr = (DWORD *) (A32D24 + base_adr + DISABLE_GBL_COUNT); 00328 *spec_adr = 0x0; 00329 }
INLINE void sis3803_all_enable | ( | const DWORD | base_adr | ) |
Definition at line 296 of file sis3803.c.
Referenced by sis3803_setup().
00298 : Enable global counting 00299 Input: 00300 DWORD base_addr : base address of the SIS3803 00301 Output: 00302 none 00303 Function value: 00304 none 00305 \**************************************************************/ 00306 { 00307 volatile DWORD *spec_adr; 00308 00309 spec_adr = (DWORD *) (A32D24 + base_adr + ENABLE_GBL_COUNT); 00310 *spec_adr = 0x0; 00311 }
void SIS3803_all_read | ( | const DWORD | base_adr | ) |
Definition at line 871 of file sis3803.c.
00872 { 00873 DWORD count; 00874 INT i; 00875 00876 for (i = 0; i < 16; i++) { 00877 sis3803_counter_read(base_adr, i, &count); 00878 printf("Counter[%i] : %u\n", i, count); 00879 } 00880 }
Definition at line 430 of file sis3803.c.
Referenced by SIS3803_all_bread().
00432 : Reads all 16 channels scaler 00433 Input: 00434 DWORD base_addr : base address of the SIS3803 00435 DWORD *pvalue : destination pointer 00436 Output: 00437 none 00438 Function value: 00439 none 00440 \**************************************************************/ 00441 { 00442 INT i; 00443 volatile DWORD *spec_adr; 00444 00445 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_READ); 00446 for (i = 0; i < 16; i++) { 00447 *pvalue++ = *spec_adr++; 00448 } 00449 }
void SIS3803_all_read_clear | ( | const DWORD | base_adr | ) |
Definition at line 882 of file sis3803.c.
00883 { 00884 DWORD count; 00885 INT i; 00886 00887 for (i = 0; i < 16; i++) { 00888 sis3803_counter_read(base_adr, i, &count); 00889 sis3803_single_clear(base_adr, i); 00890 printf("Counter[%i] : %u\n", i, count); 00891 } 00892 }
Definition at line 496 of file sis3803.c.
Referenced by SIS3803_all_bcread().
00498 : Reads & clear all 16 channels scaler 00499 Input: 00500 DWORD base_addr : base address of the SIS3803 00501 DWORD *pvalue : destination pointer 00502 Output: 00503 none 00504 Function value: 00505 none 00506 \**************************************************************/ 00507 { 00508 INT i; 00509 volatile DWORD *spec_adr; 00510 00511 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_READ_CLEAR); 00512 for (i = 0; i < 16; i++) { 00513 *pvalue++ = *spec_adr++; 00514 } 00515 }
Definition at line 179 of file sis3803.c.
00181 : Disable pat channel for acquistion. 00182 blind command! 0x0..0xffff 00183 Input: 00184 DWORD base_addr : base address of the SIS3803 00185 DWORD pat : channel pattern 00186 Output: 00187 none 00188 Function value: 00189 none 00190 \**************************************************************/ 00191 { 00192 volatile DWORD *spec_adr; 00193 00194 spec_adr = (DWORD *) (A32D24 + base_adr + SELECT_COUNT_DIS_REG); 00195 *spec_adr = pat & 0xffff; 00196 }
Definition at line 158 of file sis3803.c.
Referenced by sis3803_setup().
00160 : Enable pat channel for acquistion. 00161 blind command! 0x0..0xffff 00162 Input: 00163 DWORD base_addr : base address of the SIS3803 00164 DWORD pat : channel pattern 00165 Output: 00166 none 00167 Function value: 00168 none 00169 \**************************************************************/ 00170 { 00171 volatile DWORD *spec_adr; 00172 00173 spec_adr = (DWORD *) (A32D24 + base_adr + SELECT_COUNT_DIS_REG); 00174 *spec_adr = (~pat & 0xffff); 00175 }
Definition at line 408 of file sis3803.c.
Referenced by SIS3803_all_read(), and SIS3803_all_read_clear().
00410 : Reads one individual scaler 00411 Input: 00412 DWORD base_addr : base address of the SIS3803 00413 INT ch : Channel to be read 00414 DWORD *pvalue : destination pointer 00415 Output: 00416 none 00417 Function value: 00418 none 00419 \**************************************************************/ 00420 { 00421 volatile DWORD *spec_adr; 00422 00423 if (ch < 16) { 00424 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_READ + (ch << 2)); 00425 *pvalue = *spec_adr; 00426 } 00427 }
void SIS3803_CSR_read | ( | const DWORD | base_adr | ) |
Definition at line 848 of file sis3803.c.
Referenced by sis3803_setup().
00849 { 00850 DWORD csr; 00851 00852 csr = sis3803_CSR_read(base_adr, CSR_FULL); 00853 00854 printf("Module Version : %d\t", ((sis3803_module_ID(base_adr) & 0xf000) >> 12)); 00855 printf("Module ID : %4.4x\n", (sis3803_module_ID(base_adr) >> 16)); 00856 printf("LED : %s \t", (csr & IS_LED) ? "Y" : "N"); 00857 printf("Input mode : %d \n", sis3803_input_mode(base_adr, 1)); 00858 printf("Reference pulse 1: %s \t", (csr & IS_REF1) ? "Y" : "N"); 00859 printf("Global Enable : %s \t", (csr & IS_GBL_ENABLE) ? "Y" : "N"); 00860 printf("Global OVFL bit : %s \n", (csr & IS_GBL_OVFL) ? "Y" : "N"); 00861 printf("IRQ enable BS0 : %s \t", (csr & IS_IRQ_EN_BS0) ? "Y" : "N"); 00862 printf("IRQ enable BS1 : %s \t", (csr & IS_IRQ_EN_BS1) ? "Y" : "N"); 00863 printf("IRQ enable BS2 : %s \n", (csr & IS_IRQ_EN_BS2) ? "Y" : "N"); 00864 printf("IRQ Bit Source 0 : %s \t", (csr & IS_IRQ_BS0) ? "Y" : "N"); 00865 printf("IRQ Bit Source 1 : %s \t", (csr & IS_IRQ_BS1) ? "Y" : "N"); 00866 printf("IRQ Bit Source 2 : %s \n", (csr & IS_IRQ_BS2) ? "Y" : "N"); 00867 printf("internal VME IRQ : %s \t", (csr & 0x4000000) ? "Y" : "N"); 00868 printf("VME IRQ : %s \n", (csr & 0x8000000) ? "Y" : "N"); 00869 }
Definition at line 199 of file sis3803.c.
Referenced by SIS3803_CSR_read(), and sis3803_CSR_write().
00201 : Read the CSR and return 1/0 based on what. 00202 except for what == CSR_FULL where it returns current CSR 00203 Input: 00204 DWORD base_addr : base address of the SIS3803 00205 DWORD what : bitwise field (see sis3803.h) 00206 Output: 00207 none 00208 Function value: 00209 DWORD : CSR 32bit current content 00210 \**************************************************************/ 00211 { 00212 volatile DWORD *spec_adr; 00213 00214 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_READ); 00215 if (what == CSR_FULL) 00216 return *spec_adr; 00217 else 00218 return ((*spec_adr & what) ? 1 : 0); 00219 }
Definition at line 222 of file sis3803.c.
00224 : Write to the CSR and return CSR_FULL. 00225 Input: 00226 DWORD base_addr : base address of the SIS3803 00227 DWORD what : bitwise field 00228 Output: 00229 none 00230 Function value: 00231 DWORD : CSR 32bit current content 00232 \**************************************************************/ 00233 { 00234 volatile DWORD *spec_adr; 00235 00236 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00237 *spec_adr = what; 00238 return sis3803_CSR_read(base_adr, CSR_FULL); 00239 }
INLINE void sis3803_grp1_clear | ( | const DWORD | base_adr | ) |
Definition at line 332 of file sis3803.c.
00334 : Clear group 1 (1-8) channels + overflow bits 00335 Input: 00336 DWORD base_addr : base address of the SIS3803 00337 Output: 00338 none 00339 Function value: 00340 none 00341 \**************************************************************/ 00342 { 00343 volatile DWORD *spec_adr; 00344 00345 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_GRP1_CLEAR); 00346 *spec_adr = 0x0; 00347 }
Definition at line 452 of file sis3803.c.
00454 : Reads group 1 (1..8) channels scaler 00455 Input: 00456 DWORD base_addr : base address of the SIS3803 00457 DWORD *pvalue : destination pointer 00458 Output: 00459 none 00460 Function value: 00461 none 00462 \**************************************************************/ 00463 { 00464 INT i; 00465 volatile DWORD *spec_adr; 00466 00467 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_READ); 00468 for (i = 0; i < 8; i++) { 00469 *pvalue++ = *spec_adr++; 00470 } 00471 }
INLINE void sis3803_grp2_clear | ( | const DWORD | base_adr | ) |
Definition at line 350 of file sis3803.c.
00352 : Clear group 2 (9-16) channels + overflow bits 00353 Input: 00354 DWORD base_addr : base address of the SIS3803 00355 Output: 00356 none 00357 Function value: 00358 none 00359 \**************************************************************/ 00360 { 00361 volatile DWORD *spec_adr; 00362 00363 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_GRP2_CLEAR); 00364 *spec_adr = 0x0; 00365 }
Definition at line 474 of file sis3803.c.
00476 : Reads group 1 (1..8) channels scaler 00477 Input: 00478 DWORD base_addr : base address of the SIS3803 00479 DWORD *pvalue : destination pointer 00480 Output: 00481 none 00482 Function value: 00483 none 00484 \**************************************************************/ 00485 { 00486 INT i; 00487 volatile DWORD *spec_adr; 00488 00489 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_GRP2_READ); 00490 for (i = 0; i < 8; i++) { 00491 *pvalue++ = *spec_adr++; 00492 } 00493 }
Definition at line 108 of file sis3803.c.
Referenced by SIS3803_CSR_read(), and sis3803_setup().
00110 : Set input configuration mode (only mode 1 available) 00111 Input: 00112 DWORD base_addr : base address of the SIS3803 00113 DWORD mode : Mode 0-3 00114 Output: 00115 none 00116 Function value: 00117 DWORD : current mode 00118 \**************************************************************/ 00119 { 00120 volatile DWORD *spec_adr; 00121 00122 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00123 if (mode < 4) 00124 mode <<= 2; 00125 *spec_adr = mode; 00126 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_READ); 00127 return ((*spec_adr & GET_MODE) >> 2); 00128 }
INLINE void sis3803_int_attach | ( | const DWORD | base_adr, | |
DWORD | base_vect, | |||
int | level, | |||
void(*)(void) | isr | |||
) |
Definition at line 649 of file sis3803.c.
00652 : Book an ISR for a bitwise set of interrupt input (0xff). 00653 The interrupt vector is then the VECTOR_BASE+intnum 00654 Input: 00655 DWORD * base_addr : base address of the sis3803 00656 DWORD base_vect : base vector of the module 00657 int level : IRQ level (1..7) 00658 DWORD isr_routine : interrupt routine pointer 00659 Output: 00660 none 00661 Function value: 00662 none 00663 \**************************************************************/ 00664 { 00665 volatile DWORD *spec_adr; 00666 00667 /* disable all IRQ sources */ 00668 /* Should be done but not in attach 00669 sis3803_int_source(base_adr 00670 , DISABLE_IRQ_DI_BS0 00671 | DISABLE_IRQ_DI_BS1 00672 | DISABLE_IRQ_DI_BS2); 00673 */ 00674 00675 #ifdef OS_VXWORKS 00676 if ((level < 8) && (level > 0) && (base_vect < 0x100)) { 00677 spec_adr = (DWORD *) (A32D24 + base_adr + IRQ_REG); 00678 *spec_adr = (level << 8) | VME_IRQ_ENABLE | base_vect; 00679 sysIntEnable(level); /* interrupt level */ 00680 } 00681 intConnect(INUM_TO_IVEC(base_vect), (VOIDFUNCPTR) isr, 0); 00682 #else 00683 printf("Not implemented for this OS\n"); 00684 #endif 00685 }
INLINE void sis3803_int_clear | ( | const DWORD | base_adr, | |
const int | intnum | |||
) |
Definition at line 723 of file sis3803.c.
00725 : Disable the interrupt for the bitwise input intnum (0xff). 00726 The interrupt vector is then the VECTOR_BASE+intnum 00727 Input: 00728 DWORD * base_addr : base address of the sis3803 00729 int * intnum : interrupt number (input 0..3) 00730 Output: 00731 none 00732 Function value: 00733 none 00734 \**************************************************************/ 00735 { 00736 volatile DWORD *spec_adr; 00737 DWORD int_source; 00738 00739 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00740 switch (intnum) { 00741 case 0: 00742 int_source = DISABLE_IRQ_DI_BS0; 00743 *spec_adr = int_source; 00744 int_source = ENABLE_IRQ_EN_BS0; 00745 *spec_adr = int_source; 00746 break; 00747 case 1: 00748 int_source = DISABLE_IRQ_DI_BS1; 00749 *spec_adr = int_source; 00750 int_source = ENABLE_IRQ_EN_BS1; 00751 *spec_adr = int_source; 00752 break; 00753 case 2: 00754 int_source = DISABLE_IRQ_DI_BS2; 00755 *spec_adr = int_source; 00756 int_source = ENABLE_IRQ_EN_BS2; 00757 *spec_adr = int_source; 00758 break; 00759 default: 00760 logMsg("Unknown interrupt source (%d)\n", int_source, 0, 0, 0, 0, 0); 00761 } 00762 }
Definition at line 688 of file sis3803.c.
00690 : Unbook an ISR for a bitwise set of interrupt input (0xff). 00691 The interrupt vector is then the VECTOR_BASE+intnum 00692 Input: 00693 DWORD * base_addr : base address of the sis3803 00694 DWORD base_vect : base vector of the module 00695 int level : IRQ level (1..7) 00696 Output: 00697 none 00698 Function value: 00699 none 00700 \**************************************************************/ 00701 { 00702 00703 /* disable all IRQ sources */ 00704 /* Should be done but not in detach 00705 sis3803_int_source(base_adr , DISABLE_IRQ_DI_BS0 00706 | DISABLE_IRQ_DI_BS1 00707 | DISABLE_IRQ_DI_BS2); 00708 */ 00709 00710 #ifdef OS_VXWORKS 00711 /* Suppose to save the default isr before attach but would 00712 * required isr table in case of multiple IRQ 00713 * for now restore with myStub() 00714 */ 00715 intConnect(INUM_TO_IVEC(base_vect), (VOIDFUNCPTR) myStub_sis3803, 0); 00716 sysIntDisable(level); /* interrupt level */ 00717 #else 00718 printf("vector : 0x%x\n", base_vect + intnum); 00719 #endif 00720 }
Definition at line 625 of file sis3803.c.
00627 : Enable the one of the 4 interrupt using the 00628 predefined parameters (see sis3803.h) 00629 Input: 00630 DWORD * base_addr : base address of the sis3803 00631 DWORD * intnum : interrupt number (input 0..3) 00632 Output: 00633 none 00634 Function value: 00635 none 00636 \**************************************************************/ 00637 { 00638 volatile DWORD *spec_adr; 00639 00640 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00641 00642 int_source &= (ENABLE_IRQ_EN_BS0 | ENABLE_IRQ_EN_BS1 00643 | ENABLE_IRQ_EN_BS2 00644 | DISABLE_IRQ_DI_BS0 | DISABLE_IRQ_DI_BS1 | DISABLE_IRQ_DI_BS2); 00645 *spec_adr = int_source; 00646 }
INLINE void sis3803_int_source_disable | ( | const DWORD | base_adr, | |
const int | intnum | |||
) |
Definition at line 590 of file sis3803.c.
Referenced by myStub_sis3803().
00592 : Disable the interrupt for the bitwise input intnum (0xff). 00593 The interrupt vector is then the VECTOR_BASE+intnum 00594 Input: 00595 DWORD * base_addr : base address of the sis3803 00596 int level : IRQ level (1..7) 00597 int * intnum : interrupt number (input 0..3) 00598 Output: 00599 none 00600 Function value: 00601 none 00602 \**************************************************************/ 00603 { 00604 volatile DWORD *spec_adr; 00605 DWORD int_source; 00606 00607 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00608 switch (intnum) { 00609 case 0: 00610 int_source = DISABLE_IRQ_DI_BS0; 00611 break; 00612 case 1: 00613 int_source = DISABLE_IRQ_DI_BS1; 00614 break; 00615 case 2: 00616 int_source = DISABLE_IRQ_DI_BS2; 00617 break; 00618 default: 00619 logMsg("Unknown interrupt source (%d)\n", int_source, 0, 0, 0, 0, 0); 00620 } 00621 *spec_adr = int_source; 00622 }
INLINE void sis3803_int_source_enable | ( | const DWORD | base_adr, | |
const int | intnum | |||
) |
Definition at line 556 of file sis3803.c.
Referenced by myStub_sis3803().
00558 : Enable the interrupt for the bitwise input intnum (0xff). 00559 The interrupt vector is then the VECTOR_BASE 00560 Input: 00561 DWORD * base_addr : base address of the sis3803 00562 DWORD * intnum : interrupt number (input 0:7) 00563 Output: 00564 none 00565 Function value: 00566 none 00567 \**************************************************************/ 00568 { 00569 volatile DWORD *spec_adr; 00570 DWORD int_source; 00571 00572 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00573 switch (intnum) { 00574 case 0: 00575 int_source = ENABLE_IRQ_EN_BS0; 00576 break; 00577 case 1: 00578 int_source = ENABLE_IRQ_EN_BS1; 00579 break; 00580 case 2: 00581 int_source = ENABLE_IRQ_EN_BS2; 00582 break; 00583 default: 00584 logMsg("Unknown interrupt source (%d)\n", int_source, 0, 0, 0, 0, 0); 00585 } 00586 *spec_adr = int_source; 00587 }
Definition at line 69 of file sis3803.c.
00071 : return the lower 12 bits corresponding to 00072 VME IRQ enable, levels, vector(lower 8bits) 00073 Input: 00074 DWORD base_addr : base address of the SIS3803 00075 Output: 00076 none 00077 Function value: 00078 DWORD : 0xE(1)L(3)V(8) 00079 \**************************************************************/ 00080 { 00081 volatile DWORD *spec_adr; 00082 00083 spec_adr = (DWORD *) (A32D24 + base_adr + IRQ_REG); 00084 return (*spec_adr & 0xFFF); 00085 }
Definition at line 88 of file sis3803.c.
00090 : write irq (ELV) to the register and read back 00091 Input: 00092 DWORD base_addr : base address of the SIS3803 00093 DWORD irq : reg 00094 Output: 00095 none 00096 Function value: 00097 DWORD : 0xE(1)L(3)V(8) 00098 \**************************************************************/ 00099 { 00100 volatile DWORD *spec_adr; 00101 00102 spec_adr = (DWORD *) (A32D24 + base_adr + IRQ_REG); 00103 *spec_adr = irq; 00104 return (*spec_adr & 0xFFF); 00105 }
Definition at line 32 of file sis3803.c.
Referenced by SIS3803_CSR_read().
00034 : return the Module ID number (I) version (V) 00035 IRQ level (L) IRQ vector# (BB) 00036 Input: 00037 DWORD base_addr : base address of the SIS3803 00038 Output: 00039 none 00040 Function value: 00041 DWORD : 0xIIIIVLBB 00042 \**************************************************************/ 00043 { 00044 volatile DWORD *spec_adr; 00045 00046 spec_adr = (DWORD *) (A32D24 + base_adr + MODULE_ID); 00047 return *spec_adr; 00048 }
INLINE void sis3803_module_reset | ( | const DWORD | base_adr | ) |
Definition at line 51 of file sis3803.c.
Referenced by sis3803_setup().
00053 : General Module reset 00054 Input: 00055 DWORD base_addr : base address of the SIS3803 00056 Output: 00057 none 00058 Function value: 00059 none 00060 \**************************************************************/ 00061 { 00062 volatile DWORD *spec_adr; 00063 00064 spec_adr = (DWORD *) (A32D24 + base_adr + MODULE_RESET); 00065 *spec_adr = 0x0; 00066 }
Definition at line 518 of file sis3803.c.
00520 : Read Overflow reg for group 1 (1-8) 00521 Input: 00522 DWORD base_addr : base address of the SIS3803 00523 Output: 00524 reg : pointer to overflow reg 00525 Function value: 00526 none 00527 \**************************************************************/ 00528 { 00529 volatile DWORD *spec_adr; 00530 00531 spec_adr = (DWORD *) (A32D24 + base_adr + OVERFLOW_REG1_8); 00532 *reg = *spec_adr; 00533 *reg >>= 24; 00534 }
Definition at line 537 of file sis3803.c.
00539 : Read Overflow reg for group 2 (9-16) 00540 Input: 00541 DWORD base_addr : base address of the SIS3803 00542 Output: 00543 reg : pointer to overflow reg 00544 Function value: 00545 none 00546 \**************************************************************/ 00547 { 00548 volatile DWORD *spec_adr; 00549 00550 spec_adr = (DWORD *) (A32D24 + base_adr + OVERFLOW_REG9_16); 00551 *reg = *spec_adr; 00552 *reg >>= 24; 00553 }
Definition at line 131 of file sis3803.c.
00133 : Enable/Disable Reference on Channel 1 00134 Input: 00135 DWORD base_addr : base address of the SIS3803 00136 DWORD endis : action either ENABLE_REF_CH1 00137 DISABLE_REF_CH1 00138 Output: 00139 none 00140 Function value: 00141 : status of the ref1 1=enable, 0=disable 00142 \**************************************************************/ 00143 { 00144 volatile DWORD *spec_adr; 00145 00146 if ((endis == ENABLE_REF_CH1) || (endis == DISABLE_REF_CH1)) { 00147 spec_adr = (DWORD *) (A32D24 + base_adr + endis); 00148 *spec_adr = 0x0; 00149 } else 00150 printf("sis3803_ref1: unknown command %d\n", endis); 00151 00152 /* read back the status */ 00153 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_READ); 00154 return ((*spec_adr & IS_REF1) ? 1 : 0); 00155 }
void SIS3803_setup | ( | const DWORD | base_adr, | |
int | mode | |||
) |
void sis3803_setup | ( | const DWORD | base_adr, | |
int | mode, | |||
int | dsp | |||
) |
Definition at line 765 of file sis3803.c.
Referenced by SIS3803_setup().
00766 { 00767 switch (mode) { 00768 case 1: 00769 /* */ 00770 if (dsp) { 00771 printf("Setting : %d \t", mode); 00772 printf("Info : PAA/June 2000\n"); 00773 } 00774 sis3803_module_reset(base_adr); 00775 sis3803_input_mode(base_adr, 1); /* mode 1 ONLY */ 00776 sis3803_all_enable(base_adr); 00777 sis3803_channel_enable(base_adr, 0xf); /* 4 channels */ 00778 if (dsp) 00779 SIS3803_CSR_read(base_adr); 00780 if (dsp) 00781 printf("# of active ch. : 4\n"); 00782 break; 00783 default: 00784 printf("Undefined mode %d (known mode :1, 2, 3, 4, 5)\n", mode); 00785 break; 00786 } 00787 }
Definition at line 368 of file sis3803.c.
Referenced by SIS3803_all_read_clear().
00370 : Clear single scaler channels + overflow bits 00371 Input: 00372 DWORD base_addr : base address of the SIS3803 00373 Output: 00374 none 00375 Function value: 00376 none 00377 \**************************************************************/ 00378 { 00379 volatile DWORD *spec_adr; 00380 00381 if (ch < 16) { 00382 spec_adr = (DWORD *) (A32D24 + base_adr + COUNTER_CLEAR + (ch << 2)); 00383 *spec_adr = 0x0; 00384 } 00385 }
Definition at line 388 of file sis3803.c.
00390 : Clear single scaler channels + overflow bits 00391 Input: 00392 DWORD base_addr : base address of the SIS3803 00393 Output: 00394 none 00395 Function value: 00396 none 00397 \**************************************************************/ 00398 { 00399 volatile DWORD *spec_adr; 00400 00401 if (ch < 16) { 00402 spec_adr = (DWORD *) (A32D24 + base_adr + OVERFLOW_CLEAR + (ch << 2)); 00403 *spec_adr = 0x0; 00404 } 00405 }
INLINE void sis3803_test_disable | ( | const DWORD | base_adr | ) |
Definition at line 278 of file sis3803.c.
00280 : Disable test pulse and input test 00281 Input: 00282 DWORD base_addr : base address of the SIS3803 00283 Output: 00284 none 00285 Function value: 00286 none 00287 \**************************************************************/ 00288 { 00289 volatile DWORD *spec_adr; 00290 00291 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00292 *spec_adr = DISABLE_TEST_PULSE; 00293 }
INLINE void sis3803_test_enable | ( | const DWORD | base_adr | ) |
Definition at line 260 of file sis3803.c.
00262 : Enable test pulse and input test 00263 Input: 00264 DWORD base_addr : base address of the SIS3803 00265 Output: 00266 none 00267 Function value: 00268 none 00269 \**************************************************************/ 00270 { 00271 volatile DWORD *spec_adr; 00272 00273 spec_adr = (DWORD *) (A32D24 + base_adr + CSR_WRITE); 00274 *spec_adr = ENABLE_TEST_PULSE; 00275 }
void test | ( | DWORD | mem | ) |
Definition at line 916 of file sis3803.c.
Referenced by bm_open_buffer(), cm_msg_retrieve1(), command_loop(), condition_test(), decode_get(), decode_post(), el_submit(), export_hist(), gdImageBrushApply(), gdImageFill(), gdImageFilledPolygon(), gdImagePolygon(), gdImageSetPixel(), gdImageTileApply(), generate_hist_graph(), get_elog_url(), interprete(), interrupt_routine(), load_done_list(), md_file_wclose(), ReadIndex(), readout_thread(), receive_trigger_event(), rsputs2(), save_list(), search_callback(), sendmail(), server_loop(), show_create_page(), show_custom_page(), show_elog_new(), show_find_page(), show_hist_config_page(), show_hist_page(), show_odb_page(), show_odb_tag(), show_rawfile(), show_sc_page(), show_set_page(), show_status_page(), submit_elog(), and urlEncode().