created the function to set transmission delay

This commit is contained in:
Dhanya Maliakal 2016-08-03 09:26:52 +02:00
parent a4e5db038d
commit e1d54b72f8
4 changed files with 33 additions and 0 deletions

View File

@ -267,6 +267,35 @@ int Beb_Activate(int enable){
return ret;
}
int Beb_SetTransmissionDelay(int delay){
//mapping new memory
u_int32_t baseaddr, value = 0;
//open file pointer
int fd = Beb_open(XPAR_PLB_GPIO_SYS_BASEADDR,&baseaddr);
if(fd < 0){
cprintf(BG_RED,"Deactivate FAIL\n");
return -1;
}
else{
if(delay > -1){
value = Beb_Read32(baseaddr, TXM_DELAY_LEFT_OFFSET);
cprintf(BLUE, "Transmission Delay value before:%d\n",value);
Beb_Write32(baseaddr, TXM_DELAY_LEFT_OFFSET,delay);
}
value = Beb_Read32(baseaddr, TXM_DELAY_LEFT_OFFSET);
cprintf(BLUE,"Transmission Delay value:%d\n", value);
}
//close file pointer
if(fd > 0)
Beb_close(fd);
return 0;
}
int Beb_ResetToHardwareSettings(){
//mapping new memory
u_int32_t baseaddr, value = 0, ret = 1;

View File

@ -51,6 +51,7 @@ struct BebInfo{
int Beb_SetMasterViaSoftware();
int Beb_SetSlaveViaSoftware();
int Beb_Activate(int enable);
int Beb_SetTransmissionDelay(int delay);
int Beb_ResetToHardwareSettings();
u_int32_t Beb_GetFirmwareRevision();
u_int32_t Beb_GetFirmwareSoftwareAPIVersion();

View File

@ -122,6 +122,8 @@
#define OVERWRITE_HARDWARE_BIT 0x2
#define DEACTIVATE_BIT 0x4
#define TXM_DELAY_LEFT_OFFSET 0x180
//command memory
#define LEFT_OFFSET 0x0
#define RIGHT_OFFSET 0x100

View File

@ -741,6 +741,7 @@ enum detectorSettings getSettings(){
}
int startReceiver(int d){
printf("Going to prepare for acquisition with counter_bit:%d\n",Feb_Control_Get_Counter_Bit());
Feb_Control_PrepareForAcquisition();
printf("Going to reset Frame Number\n");