Go to the source code of this file.
Functions | |
int | lrs2365_set (int crate, int slot, WORD coeff[18]) |
int lrs2365_set | ( | int | crate, | |
int | slot, | |||
WORD | coeff[18] | |||
) |
Definition at line 23 of file lrs2365.c.
00026 : 00027 00028 Load the logic matrix of the LRS2365 with 18 coefficients according 00029 to the specifications in the manual. After loading, the matrix 00030 is verified. 00031 00032 \**********************************************************************/ 00033 { 00034 int i, status; 00035 WORD data; 00036 00037 /* Initialize 2365 */ 00038 camc(crate, slot, 0, 9); 00039 00040 /* Set mode control to zero (front-panel input) */ 00041 camo(crate, slot, 3, 16, 0); 00042 00043 /* Write coefficients */ 00044 for (i = 0; i < 18; i++) 00045 camo(crate, slot, 0, 16, coeff[i]); 00046 00047 /* validate coefficients */ 00048 status = SUCCESS; 00049 for (i = 0; i < 18; i++) { 00050 cami(crate, slot, 0, 0, &data); 00051 if (data != coeff[i]) { 00052 cm_msg(MERROR, "lrs2365_set", 00053 "Error verifying coefficients: should be %d, read %d", coeff[i], data); 00054 status = 0; 00055 } 00056 } 00057 00058 return status; 00059 } }