Class QADC_DIO

  • All Implemented Interfaces:
    Impc555, IntbMpc555HB, Ippc32

    public class QADC_DIO
    extends Object
    implements IntbMpc555HB
    Driver to use the QADC-A or QADC-B as digital I/O.
    Please prefer the MPIOSM_DIO driver for I/O applications, because it's not possible to use the same channel on a QADC for ADC and I/0 at the same time.
    The channels are grouped into two groups of 8 channels each, PortA and PortB.
    PortB: PQB0(AN0), PQB1(AN1), PQB2(AN2), PQB3(AN3), PQB4(AN48), PQB5(AN49), PQB6(AN50), PQB7(AN51)
    PortA: PQA0(AN52), PQA1(AN53), PQA2(AN54), PQA3(AN55), PQA4(AN56), PQA5(AN57), PQA6(AN58), PQA7(AN59)
    IMPORTANT: The pins on PortB work solely as digital inputs. The pins on PortA function as digital I/O.
    • Constructor Detail

      • QADC_DIO

        public QADC_DIO()
    • Method Detail

      • init

        public static void init​(boolean qadcA,
                                int channel,
                                boolean out)
        Initialize a pin of the QADC port as I/O.
        Parameters:
        qadcA - Select module QADC_A (true) or QADC_B (false)
        channel - Select pin 0-15 (or 0-3 and 48-59)
        out - Set I/O direction,true =>output, false => input
      • get

        public static boolean get​(boolean qadcA,
                                  int channel)
        Read the TTL-Signal value of the corresponding channel
        Parameters:
        qadcA - Select module QADC_A (true) or QADC_B (false)
        channel - Select pin 0-15 (or 0-3 and 48-59)
        Returns:
        Logical level of channel
      • set

        public static void set​(boolean qadcA,
                               int channel,
                               boolean val)
        Set the logical level val to the corresponding channel
        Parameters:
        qadcA - Select module QADC_A (true) or QADC_B (false)
        channel - Select pin 0-15 respectively 0-3 and 48-59
        val - Logical level