read back of csr

This commit is contained in:
Erik Frojdh
2021-03-26 17:46:11 +01:00
parent a2007b78e7
commit 7c4f9ee044
12 changed files with 52 additions and 7 deletions

View File

@ -31,6 +31,10 @@ int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); }
extern enum TLogLevel trimmingPrint ;
int getChipStatusRegister(){
return chipStatusRegister;
}
patternParameters *setChipStatusRegister(int csr) {
int iaddr=0;
int nbits=18;

View File

@ -57,6 +57,7 @@ enum {Cac225, Cac_450};
#define default_gain
int setBit(int ibit, int patword);
int clearBit(int ibit, int patword);
int getChipStatusRegister();
patternParameters *setChipStatusRegister(int csr);
patternParameters *setChannelRegisterChip(int ichip, int *mask, int *trimbits);
patternParameters *setInterpolation(int mask);

View File

@ -25,6 +25,10 @@
#include "blackfin.h"
#endif
#if defined(MYTHEN3D)
#include "mythen3.h"
#endif
#include <stdio.h> // FILE
#include <stdlib.h>
#include <sys/types.h>

View File

@ -246,4 +246,5 @@ int is_virtual(int);
int get_pattern(int);
int load_default_pattern(int);
int get_all_threshold_energy(int);
int get_master(int);
int get_master(int);
int get_csr();

View File

@ -369,6 +369,7 @@ void function_table() {
flist[F_LOAD_DEFAULT_PATTERN] = &load_default_pattern;
flist[F_GET_ALL_THRESHOLD_ENERGY] = &get_all_threshold_energy;
flist[F_GET_MASTER] = &get_master;
flist[F_GET_CSR] = &get_csr;
// check
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
@ -8388,3 +8389,19 @@ int get_master(int file_des){
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
int get_csr(int file_des){
ret = OK;
memset(mess, 0, sizeof(mess));
int retval = -1;
LOG(logDEBUG1, ("Getting csr\n"));
#ifndef MYTHEN3D
functionNotImplemented();
#else
retval = getChipStatusRegister();
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}