JDK DIO

JDK DIO

Implementation of the library JDK DIO to give an access to digital in/outputs. This is the hardware module that give support to GPIO Datastreams.

To access source code click here.

Dependencies

This module requires the following modules:

  • Commons: Provide the GPIO APIs, exceptions and types and the basic APIs to register the service.

Configuration

To configure JDK DIO Hardware module, a file named es.amplia.oda.hardware.jdkdio.cfg must be created with the next parameters for each input channel that you want to register:

  • index: Required parameter. Index of the pin.
  • deviceType: "" (void String) by default. Type of this pin. gpio.GPIOPin for specify an digital pin.
  • name: Required parameter. Unique name for the pin.
  • direction: OUTPUT by default. Specify if pin is open as in or out. Allowed directions are INPUT or OUTPUT.
  • mode: OPEN_DRAIN by default. Specify the mode of the pin. Allowed modes are PULL_UP, PULL_DOWN, OPEN_DRAIN and PUSH_PULL. The first two are modes for OUTPUT pins and the last two are for INPUT pins.
  • trigger: NONE by default. Trigger the pin changes the value. Allowed values are NONE, FALLING_EDGE, RISING_EDGE, BOTH_EDGES, LOW_LEVEL, HIGH_LEVEL, BOTH_LEVELS. For the outputs pins, as they doesn’t change value by themselves, the only one trigger valid is NONE.
  • activeLow: false by default. ActiveLow option (reverses the values of the pin). True if activeLow is enabled.
  • initialValue: false by default. Specify the initial value of the pin. On input pins this option can be changed quickly.

es.amplia.oda.hardware.jdkdio.cfg will have a similar format to:

1=deviceType:gpio.GPIOPin,name:lightOn
4=deviceType:gpio.GPIOPin,name:lightHigh,direction:input,mode:PUSH_PULL,trigger:LOW_LEVEL,activeLow:false,initialValue:true