Package cbsw.lhcb.k7chimaera
Class Dac6571
- java.lang.Object
-
- cbsw.lhcb.k7chimaera.I2C
-
- cbsw.lhcb.k7chimaera.Dac6571
-
- All Implemented Interfaces:
Io
public class Dac6571 extends I2C implements Io
This class encapsulates the DAC6571 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 intcsrSizeThe register map size in bytes.static java.util.ArrayList<RegisterDescriptor>descriptorsThe register descriptors.static java.util.HashMap<java.lang.String,RegisterDescriptor>mapThe map of descriptors keyed by name.-
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 voidget(int offset, byte[] regBuf)Reads a byte array from the hardware.intgetCsrSize()java.util.ArrayList<RegisterDescriptor>getDescriptors()Gets the register descriptor list.voidput(int offset, byte[] regBuf)Writes a byte array to the hardware.voidsetCsrSize(int csrSize)Sets the register map size.voidsetDefaults()voidsetDescriptors(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 descriptors keyed by name.
-
-
Constructor Detail
-
Dac6571
public Dac6571()
No-argument constructor called by unmarshaller
-
Dac6571
public Dac6571(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 size in bytes.
-
getCsrSize
public int getCsrSize()
-
setDescriptors
public void setDescriptors(java.util.ArrayList<RegisterDescriptor> descriptors)
Sets the register descriptor list.
- Parameters:
descriptors- The list.
-
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.
-
setDefaults
public void setDefaults()
- Specified by:
setDefaultsin classI2C
-
-