Class 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 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.

        Specified by:
        put in interface Io
        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.

        Specified by:
        get in interface Io
        Parameters:
        offset - Offset to location where to start reading.
        regBuf - Array of register values.
      • setDefaults

        public void setDefaults()
        Specified by:
        setDefaults in class I2C