Class Claro

java.lang.Object
cbsw.lhcb.pdmdb.Asic
cbsw.lhcb.pdmdb.Claro
All Implemented Interfaces:
Io

public class Claro extends Asic

This class encapsulates the interactions with the CLARO

Unmarshalls register descriptors into statically accessible members of this class.

  • Field Details

    • 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

    • csrMap

      static CsrMap csrMap
  • Constructor Details

    • Claro

      public Claro(AsicType asic)

      Constructor called by the unmarshaller via AsicAdapter.

      Parameters:
      asic - Type data for this Asic
  • Method Details

    • init

      void init(Sc sca, I2cIo i2cIo)

      Completes initialisation of this instance.

      Call after unmarshalling to complete initialisation.

      Overrides:
      init in class Asic
      Parameters:
      sca - The SCA interface.
      i2cIo - The interface to use for I2C transactions.
    • 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 class Asic
    • thresholdScan

      void thresholdScan(int s)

      Threshold scan function

      Specified by:
      thresholdScan in class Asic
    • setThresholdOffset

      void setThresholdOffset(String type, int offset)
      Specified by:
      setThresholdOffset in class Asic
    • setFromBinaryFile

      void setFromBinaryFile(String pathPrefix)

      Sets the current register mirror settings from a file.

      Specified by:
      setFromBinaryFile in class Asic
      Parameters:
      pathPrefix - File pathname prefix
    • prepareDAQ

      void prepareDAQ()
      Specified by:
      prepareDAQ in class Asic