Class DAC_MAX5500

  • All Implemented Interfaces:
    Impc5200, Ippc32

    public class DAC_MAX5500
    extends Object
    implements Impc5200
    Driver for a MAX5500 DAC connected to a PSC6 on the mpc5200.
    Author:
    Urs Graf
    • Constructor Detail

      • DAC_MAX5500

        public DAC_MAX5500()
    • Method Detail

      • init

        public static void init()

        Initialize the SPI on PSC6.

        This method has to be called before using the SPI!

      • send

        public static void send​(int ch,
                                short val)
        Sends a value over the SPI to one of the four DAC-channels. A call of this method is not blocking! A call to this method can be followed by another call to this method, as the data is written to a hardware fifo.
        Parameters:
        ch - channel of the DAC (0, 1, 2, 3)
        val - value
      • setUPO

        public static void setUPO​(boolean val)
        Sets the digital output pin on the DAC. A call of this method is not blocking! A call to this method can be followed by another call to this method, as the data is written to a hardware fifo.
        Parameters:
        val - value
      • availToWrite

        public static int availToWrite()
        Returns the number of free bytes available in the transmit fifo. It is possible, to send the returned number of bytes in one nonblocking transfer.
        Returns:
        the available free bytes in the transmit fifo.