mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
some changes
This commit is contained in:
parent
1c073b70bd
commit
a7288dc0de
@ -150,6 +150,19 @@ int mapCSP0(void) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void defineGPIOpins(){
|
||||
//define the gpio pins
|
||||
system("echo 7 > /sys/class/gpio/export");
|
||||
system("echo 9 > /sys/class/gpio/export");
|
||||
//define their direction
|
||||
system("echo in > /sys/class/gpio/gpio7/direction");
|
||||
system("echo out > /sys/class/gpio/gpio9/direction");
|
||||
}
|
||||
|
||||
|
||||
|
||||
u_int16_t bus_r16(u_int32_t offset){
|
||||
volatile u_int16_t *ptr1;
|
||||
ptr1=(u_int16_t*)(CSP0BASE+offset*2);
|
||||
@ -1421,6 +1434,14 @@ int writeGbeReg(int ivar, uint32_t val, int addr, int interface) {
|
||||
int configureInterface(uint32_t destip,uint64_t destmac,uint64_t sourcemac,int sourceip,int ival,uint32_t destport, uint32_t sourceport, int interface) {
|
||||
//int configureMAC(int ipad,long long int macad,long long int detectormacad, int detipad, int ival, int udpport){
|
||||
|
||||
|
||||
//tell FPGA to not touch flash
|
||||
system("echo 0 > /sys/class/gpio/gpio9/value");
|
||||
//tell FPGA to touch flash to program itself
|
||||
system("echo 1 > /sys/class/gpio/gpio9/value");
|
||||
|
||||
|
||||
|
||||
volatile u_int32_t conf= bus_r(CONFIG_REG);
|
||||
long int checksum=calcChecksum(sourceip, destip);
|
||||
#ifdef NEW_GBE_INTERFACE
|
||||
@ -1485,6 +1506,11 @@ int configureInterface(uint32_t destip,uint64_t destmac,uint64_t sourcemac,int
|
||||
int configureMAC(uint32_t destip,uint64_t destmac,uint64_t sourcemac,int sourceip,int ival,uint32_t destport) {
|
||||
//int configureMAC(int ipad,long long int macad,long long int detectormacad, int detipad, int ival, int udpport){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uint32_t sourceport = 0x7e9a; // 0xE185;
|
||||
int interface=0;
|
||||
int ngb;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
|
||||
int mapCSP0(void);
|
||||
void defineGPIOpins();
|
||||
|
||||
u_int16_t bus_r16(u_int32_t offset);
|
||||
u_int16_t bus_w16(u_int32_t offset, u_int16_t data);//aldos function
|
||||
|
Binary file not shown.
@ -97,6 +97,9 @@ int init_detector(int b) {
|
||||
);
|
||||
|
||||
|
||||
defineGPIOpins();
|
||||
|
||||
|
||||
printf("Resetting PLL\n");
|
||||
resetPLL();
|
||||
bus_w16(CONTROL_REG, SYNC_RESET);
|
||||
|
@ -4025,9 +4025,9 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
if (t>=0)
|
||||
thisDetector->timerValue[index]=t;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
//#ifdef VERBOSE
|
||||
std::cout<< "Timer " << index << " set to "<< thisDetector->timerValue[index] << "ns" << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
if ((thisDetector->myDetectorType==MYTHEN)&&(index==PROBES_NUMBER)) {
|
||||
setDynamicRange();
|
||||
@ -4077,9 +4077,9 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
||||
}
|
||||
//set period
|
||||
else{
|
||||
#ifdef VERBOSE
|
||||
//#ifdef VERBOSE
|
||||
std::cout << "Setting/Getting acquisition period " << index << " to/from receiver " << args[1] << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
//if acquisition period is zero, then #frames/buffer depends on exposure time and not acq period
|
||||
if(!args[1])
|
||||
args[1] = timerValue[ACQUISITION_TIME];
|
||||
|
Loading…
x
Reference in New Issue
Block a user