Package cbsw.lhcb.k7chimaera
Class PicoTDC
- java.lang.Object
-
- cbsw.lhcb.k7chimaera.I2C
-
- cbsw.lhcb.k7chimaera.PicoTDC
-
- All Implemented Interfaces:
Io
public class PicoTDC extends I2C implements Io
This class encapsulates the picoTDC register set.
Register descriptors are unmarshalled into statically accessible members of this class.
Note that the class members are static but unfortunately not immutable because of the need to use JAXB setters.
-
-
Field Summary
Fields Modifier and Type Field Description static int
csrSize
The register map size in bytes.static java.util.ArrayList<RegisterDescriptor>
descriptors
The register descriptors.static java.util.HashMap<java.lang.String,RegisterDescriptor>
map
The map of register names to descriptors.-
Fields inherited from class cbsw.lhcb.k7chimaera.I2C
csr, id, io, rxBaseAddress, slaveAddress, txBaseAddress
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableAddresses()
Enables the I2C addressing bits.void
get(int offset, byte[] regBuf)
Reads a byte array from the hardware.int
getCsrSize()
java.util.ArrayList<RegisterDescriptor>
getDescriptors()
Gets the register descriptor list.void
put(int offset, byte[] regBuf)
Writes a byte array to the hardware.void
setCsrSize(int csrSize)
Sets the register map size.void
setDefaults()
void
setDescriptors(java.util.ArrayList<RegisterDescriptor> descriptors)
Sets the register descriptor list.
-
-
-
Field Detail
-
csrSize
public static int csrSize
The register map size in bytes.
-
descriptors
public static java.util.ArrayList<RegisterDescriptor> descriptors
The register descriptors.
-
map
public static java.util.HashMap<java.lang.String,RegisterDescriptor> map
The map of register names to descriptors.
-
-
Constructor Detail
-
PicoTDC
public PicoTDC()
No-argument constructor called by unmarshaller
-
PicoTDC
public PicoTDC(java.lang.String id, int slaveAddress, int txBaseAddress, int rxBaseAddress)
Constructor used during unmarshalling by I2CAdapter
Call init after unmarshalling to complete initialisation.
- Parameters:
id
- A globally unique identifier.slaveAddress
- The I/O interface slave address (e.g. I2C).txBaseAddress
- The RegisterIo base address.rxBaseAddress
- Set this equal to txBaseAddress.
-
-
Method Detail
-
setCsrSize
public void setCsrSize(int csrSize)
Sets the register map size.
- Parameters:
csrSize
- The register map size in bytes.
-
getCsrSize
public int getCsrSize()
-
setDescriptors
public void setDescriptors(java.util.ArrayList<RegisterDescriptor> descriptors)
Sets the register descriptor list.
- Parameters:
descriptors
- An ArrayList of RegisterDescriptors.
-
getDescriptors
public java.util.ArrayList<RegisterDescriptor> getDescriptors()
Gets the register descriptor list.
- Returns:
- The list.
-
put
public void put(int offset, byte[] regBuf)
Writes a byte array to the hardware.
-
get
public void get(int offset, byte[] regBuf)
Reads a byte array from the hardware.
-
enableAddresses
public void enableAddresses()
Enables the I2C addressing bits.
-
setDefaults
public void setDefaults()
- Specified by:
setDefaults
in classI2C
-
-