Class Claro
- All Implemented Interfaces:
Io
This class encapsulates the interactions with the CLARO
Unmarshalls register descriptors into statically accessible members of this class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe GPIO number for the ALDO enable for this CLARO(package private) static CsrMapprotected intThe GPIO number for the FEB enable for this CLAROprotected intThe SPI index for this CLAROprotected intThe GPIO number for the write enable for this CLARO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoSpi(boolean wrflag) Does an SPI transactionvoidget(int offset, byte[] regBuf) Reads a byte array from the hardware.(package private) voidCompletes initialisation of this instance.(package private) void(package private) voidprepareSpi(boolean wrflag) Prepares the SCA commands to program one CLARO.voidput(int offset, byte[] regBuf) Writes byte array to the hardware.(package private) void(package private) voidsetFromBinaryFile(String pathPrefix) Sets the current register mirror settings from a file.voidsetRandom(int irand) Sets random values in the CLARO register for testing(package private) voidsetThresholdOffset(String type, int offset) (package private) voidthresholdScan(int s) Threshold scan function
-
Field Details
-
febEnableGpio
protected int febEnableGpioThe GPIO number for the FEB enable for this CLARO
-
writeEnableGpio
protected int writeEnableGpioThe GPIO number for the write enable for this CLARO
-
aldoEnable
protected int aldoEnableThe GPIO number for the ALDO enable for this CLARO
-
spiIndex
protected int spiIndexThe SPI index for this CLARO
-
csrMap
-
-
Constructor Details
-
Claro
Constructor called by the unmarshaller via AsicAdapter.
- Parameters:
asic- Type data for this Asic
-
-
Method Details
-
init
-
prepareSpi
void prepareSpi(boolean wrflag) Prepares the SCA commands to program one CLARO.
Call sca.allocateTxRxBuffers() before calling this and sca.putBytes() afterwards to do the transaction.
Can call this up to 16 times between allocateTxRxBuffers() and putBytes().
GBT-SCA-SPI manual mode is used for timing reasons.
SCA falling TX-edge mode is used. The SCA clock filtering means that edges appear to be delayed at the CLARO by about 50ns compared to MOSI transitions so rising edge mode would probably be OK but falling edge is more conservative.
- Parameters:
wrflag- If true, activate the CLARO write enable.
-
doSpi
public void doSpi(boolean wrflag) Does an SPI transaction
- Parameters:
wrflag- If true, activates the CLARO write enable
-
setRandom
public void setRandom(int irand) Sets random values in the CLARO register for testing
- Parameters:
irand- A random number
-
put
public void put(int offset, byte[] regBuf) Writes byte array to the hardware.
Currently ignores arguments and transfers entire CSR to hardware for this CLARO.
- Parameters:
offset- Offset to location where to start writing.regBuf- Array of register values.
-
get
public void get(int offset, byte[] regBuf) Reads a byte array from the hardware.
Currently ignores offset arguments and reads entire CSR for this CLARO.
- Parameters:
offset- Offset to location where to start reading.regBuf- Array of register values.
-
setDefaults
void setDefaults()- Specified by:
setDefaultsin classAsic
-
thresholdScan
-
setThresholdOffset
- Specified by:
setThresholdOffsetin classAsic
-
setFromBinaryFile
Sets the current register mirror settings from a file.
- Specified by:
setFromBinaryFilein classAsic- Parameters:
pathPrefix- File pathname prefix
-
prepareDAQ
void prepareDAQ()- Specified by:
prepareDAQin classAsic
-