Class Claro
- java.lang.Object
-
- cbsw.lhcb.pdmdb.Asic
-
- cbsw.lhcb.pdmdb.Claro
-
-
Field Summary
Fields Modifier and Type Field Description protected int
aldoEnable
The GPIO number for the ALDO enable for this CLAROprotected int
febEnableGpio
The GPIO number for the FEB enable for this CLAROprotected int
spiIndex
The SPI index for this CLAROprotected int
writeEnableGpio
The GPIO number for the write enable for this CLARO
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doSpi(boolean wrflag)
Does an SPI transactionvoid
get(int offset, byte[] regBuf)
Reads a byte array from the hardware.(package private) void
init(Sc sca, I2cIo i2cIo)
Completes initialisation of this instance.(package private) void
prepareSpi(boolean wrflag)
Prepares the SCA commands to program one CLARO.void
put(int offset, byte[] regBuf)
Writes byte array to the hardware.(package private) void
setDefaults()
void
setRandom(int irand)
Sets random values in the CLARO register for testing
-
-
-
Field Detail
-
febEnableGpio
protected int febEnableGpio
The GPIO number for the FEB enable for this CLARO
-
writeEnableGpio
protected int writeEnableGpio
The GPIO number for the write enable for this CLARO
-
aldoEnable
protected int aldoEnable
The GPIO number for the ALDO enable for this CLARO
-
spiIndex
protected int spiIndex
The SPI index for this CLARO
-
-
Constructor Detail
-
Claro
public Claro(AsicType asic)
Constructor called by the unmarshaller via AsicAdapter.
- Parameters:
asic
- Type data for this Asic
-
-
Method Detail
-
init
void init(Sc sca, I2cIo i2cIo)
Completes initialisation of this instance.
Call after unmarshalling to complete initialisation.
-
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:
setDefaults
in classAsic
-
-