Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Add support for Odroid C1+, XU4 #229

Closed
28 of 29 tasks
savageautomate opened this issue Mar 16, 2016 · 3 comments
Closed
28 of 29 tasks

Add support for Odroid C1+, XU4 #229

savageautomate opened this issue Mar 16, 2016 · 3 comments
Assignees
Milestone

Comments

@savageautomate
Copy link
Member

savageautomate commented Mar 16, 2016

Issue

Officially add support for Odroid C1+ and XU4 boards.

Progress

The following steps need to be completed to officially announce support for the Odroid boards.

Odroid (All Models)

  • include wiringPi for Odroid in build
  • package wiringPi for Odroid compiled SO libs in JAR
  • add support for reading analog input pins
  • add support for analog input pin events

Odroid C1+

  • source Odroid C1+ hardware
  • test/validate GPIO outputs on Odroid C1+
  • test/validate GPIO inputs on Odroid C1+
  • test/validate GPIO input listener events on Odroid C1+ ((SEE KNOWN ISSUES))
  • test/validate analog inputs on Odroid C1+
  • test/validate analog input listener events on Odroid C1+
  • test/validate PWM communication on Odroid C1+ ((NOT SUPPORTED, SEE KNOWN ISSUES))
  • test/validate serial communication on Odroid C1+
  • test/validate I2C communication on Odroid C1+
  • test/validate SPI communication on Odroid C1+ ((SEE KNOWN ISSUES))
  • add project examples for Odroid C1+
  • update project readme for Odroid C1+
  • update project documentation for Odroid C1+

Odroid XU4

  • source Odroid XU4 hardware
  • test/validate GPIO outputs on Odroid XU4
  • test/validate GPIO inputs on Odroid XU4
  • test/validate GPIO input listener events on Odroid XU4
  • test/validate analog inputs on Odroid XU4
  • test/validate analog input listener events on Odroid XU4
  • test/validate serial communication on Odroid XU4
  • test/validate I2C communication on Odroid XU4
  • test/validate SPI communication on Odroid XU4 ((SEE KNOWN ISSUES))
  • add project examples for Odroid XU4
  • update project readme for Odroid XU4
  • update project documentation for Odroid XU4

Summary

Odroid C1+
With the latest builds of 1.1-SNAPSHOT, Pi4J includes support for GPIO digital inputs, digital outputs, analog inputs (10-bit ADC), SPI, I2C, and SERIAL on the Odroid C1+. This feature is experimental and any feedback is greatly appreciated.

Odroid XU4
With the latest builds of 1.1-SNAPSHOT, Pi4J includes support for GPIO digital inputs, digital outputs and analog inputs (12-bit ADC) on the Odroid XU4. This feature is experimental and any feedback is greatly appreciated.
Sample code can be found here: https://github.com/Pi4J/pi4j/tree/develop/pi4j-example/src/main/java/odroid

I am waiting on shipment of XU4-SHIFTER board to arrive for SPI & I2C testing.

Known Issues

GPIO Listener Events (edge triggered interrupts) [APPLIES ONLY TO C1/C1+/C2]
Pi4J uses edge detection for GPIO pin state change events. The Odroid C1/C1+/C2 only permits up to four GPIO pins to be configured with edge detection for both "rising" and "falling" edges (a.k.a., "both"). Thus, you can only use a maximum of four GPIO input pins with listener events. Alternatively, you can manually poll for GPIO pin state changes. The included sample code demonstrates both the event listener and polling for pin state changes: https://github.com/Pi4J/pi4j/blob/develop/pi4j-example/src/main/java/odroid/GpioListenAllExample.java

ODROID-C1 supports the GPIO interrupt of Edge trigger. The maximum number of interrupt is limited to 8 when you use the falling(Low) or rising(High) edge trigger. If you use the Both (rising and falling together) edge triggers, the maximum number is only 4.
(http://odroid.com/dokuwiki/doku.php?id=en:c1_hardware_irq)

PWM
PWM is not supported in the Hardkernel Odroid WiringPi port. Thus PWM is not currently supported by Pi4J for the Odroid boards (C1/C1+/C2). There is no PWM function on the 30pin GPIO header on the XU3/XU4.

  if (  piModel == PI_MODEL_ODROIDC  ||
    piModel == PI_MODEL_ODROIDC2 ||
    piModel == PI_MODEL_ODROIDXU_34)  {
    fprintf (stderr, "%s : Unsupport function on %s model\n",
        __func__, piModelNames [piModel]);
    exit (EXIT_FAILURE) ;
  }

See: https://github.com/hardkernel/wiringPi/blob/master/wiringPi/wiringPi.c#L2254

WiringPi SoftPWM
SoftPWM is not supported on all Odroid GPIO pins on the C1/C1+/C2/XU4. This limitation is due to a GPIO pin mapping issue in the WiringPi port for Odroid by Hardkernel.

SPI
SPI modes (other than the default SPI MODE 0) are not supported in the Hardkernel Odroid WiringPi port. We are expecting the wiringPiSPISetupMode() to be implemented in this source file: https://github.com/hardkernel/wiringPi/blob/master/wiringPi/wiringPiSPI.c to support this feature. Added support via pull request: hardkernel/wiringPi#5

@savageautomate savageautomate added this to the RELEASE 1.1 milestone Mar 16, 2016
@savageautomate savageautomate self-assigned this Mar 16, 2016
@stefanhaustein
Copy link

Does this work in Odroid Android? 

@savageautomate
Copy link
Member Author

@stefanhaustein

No, this library has not been tested on an Android system. It's a standard Java library that wraps a native C library using JNI. I'm not sure the C library (WiringPi) is ported for Android?

Thanks, Robert

@savageautomate savageautomate changed the title Add support for Odroid C1+, C2, XU4 Add support for Odroid C1+, XU4 Jul 25, 2016
@savageautomate
Copy link
Member Author

EDIT.

I have updated the WiringOP library to support the custom SPI modes.
via pull request: hardkernel/wiringPi#5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants