Class FlinkGPIO

  • All Implemented Interfaces:
    FlinkDefinitions

    public class FlinkGPIO
    extends Object
    implements FlinkDefinitions
    The flink GPIO subdevice realizes digital input and output within a flink device. It offers several channels. Each channel drives a single pin.
    Author:
    Urs Graf
    • Field Detail

      • dev

        public FlinkSubDevice dev
        Handle to the subdevice within our flink device
    • Constructor Detail

      • FlinkGPIO

        public FlinkGPIO​(FlinkSubDevice dev)
        Creates a GPIO subdevice.
        Parameters:
        dev - handle to the subdevice
    • Method Detail

      • setDir

        public void setDir​(int channel,
                           boolean output)
        Sets the direction of a single channel within a GPIO subdevice. Each channel can work as either digital input or output. Channel number must be 0 <= channel < nof available channels.
        Parameters:
        channel - channel number
        output - false = input, true = output
      • getDir

        public boolean getDir​(int channel)
        Reads the direction of a single channel within a GPIO subdevice. Each channel can work as either digital input or output. Channel number must be 0 <= channel < nof available channels
        Parameters:
        channel - channel number
        Returns:
        false = input, true = output
      • getValue

        public boolean getValue​(int channel)
        Reads the value of a single channel within a GPIO subdevice. Channel number must be 0 <= channel < nof available channels
        Parameters:
        channel - channel number
        Returns:
        false = low, true = high
      • setValue

        public void setValue​(int channel,
                             boolean value)
        Sets the logical level of a single channel within a GPIO subdevice. Channel number must be 0 <= channel < nof available channels
        Parameters:
        channel - channel number
        value - false = low, true = high