Class RTBoard

  • All Implemented Interfaces:
    Iarm32, Izynq7000, IMicroZed

    public class RTBoard
    extends Object
    implements IMicroZed
    Driver for the Microzed board for control applications. This board comprises two analog outputs with 1A current supply and two analog input channels. Further there are 4 digital input channels which can be used to read two encoders. The board incorporates 4 Leds and two push buttons. The PL must be loaded with flink4 configuration.
    Author:
    Graf Urs
    • Constructor Detail

      • RTBoard

        public RTBoard()
    • Method Detail

      • analogIn

        public static float analogIn​(int channel)
        Returns the value of an analog input channel.
        The analog signal will be read from channel. The channel 0 carries the name AIn1 and channel 1 carries the name AIn2. The range of the return value is between -10..+10 corresponding to Volts. The resolution of the ADC is 12 bit.
        Parameters:
        channel - Channel with analog signal.
        Returns:
        Value in Volts (-10..+10).
      • analogOut

        public static void analogOut​(int channel,
                                     float val)
        Writes a value to an regular analog output channel The channel 0 is denoted with AOut1 and channel 1 is denoted AOut2. The range of val is between -10..+10 corresponding to Volts The resolution of the DAC is 12 bit.
        Parameters:
        channel - Channel with analog signal.
        val - Value in Volts (-10..+10).
      • buttonIn

        public static boolean buttonIn​(int channel)
        The state of the two push buttons can be read. Channels are numbered 0 for switch SW2 and 1 for switch SW3. The value true corresponds to the logical signal 1.
        Parameters:
        channel - Channel to be read.
        Returns:
        Digital signal at channel.
      • ledOut

        public static void ledOut​(int channel,
                                  boolean level)
        Write a digital output to a led. leds are numbered 0..3. That corresponds to leds LED2, LED3, LED4, LED5.
        Parameters:
        channel - Led channel.
        level - true corresponds to the led lightening up.
      • getEncCount

        public static short getEncCount​(int channel)
        Reads the encoder position.
        Parameters:
        channel - Channel of encoder input (0 or 1).
        Returns:
        Position in counter values.
      • reset

        public static void reset()
        Sets both encoder channels to zero.