Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate GPIO functionalities #46

Open
RaiBnod opened this issue Jan 25, 2019 · 6 comments
Open

Integrate GPIO functionalities #46

RaiBnod opened this issue Jan 25, 2019 · 6 comments
Labels
C: bonescript Issue related to BoneScript API epic: BBB java Replacement bonescript API in js to java P: Low T: Feature Issue Type: Feature

Comments

@RaiBnod
Copy link
Member

RaiBnod commented Jan 25, 2019

GPIO functionalities will be written on C/C++. And we need able to call that functions from Java for doing GPIO operations.

Parent ticket: #42

@RaiBnod RaiBnod added T: Feature Issue Type: Feature C: bonescript Issue related to BoneScript API labels Jan 25, 2019
@RaiBnod RaiBnod added this to To do in IoT Platform via automation Jan 25, 2019
@RaiBnod
Copy link
Member Author

RaiBnod commented Feb 4, 2019

Hello @Aidan275, as you already did some code on C for doing GPIO operation. Can you please share the code.

I have created just a base class for generating the JNI libraries for doing communication with native C on commit: d72c520.

@RaiBnod
Copy link
Member Author

RaiBnod commented Feb 4, 2019

Adding additional info:

BBBiO example: https://github.com/Aidan275/BBBiO
Parent ticket: https://github.com/NubeIO/NubeEdge28/issues/1

@RaiBnod RaiBnod modified the milestone: 1.0.0-alpha+001 Feb 4, 2019
@RaiBnod RaiBnod assigned RaiBnod and unassigned Aidan275 Feb 4, 2019
@RaiBnod RaiBnod added the S: WIP label Feb 4, 2019
@RaiBnod
Copy link
Member Author

RaiBnod commented Feb 6, 2019

@Aidan275 I had forked your C++ code and did small changes https://github.com/RaiBnod/BBBiO for testing. And for Java JNI call, I had made a Java micro-service base 478e478, where we can generate native library. With the help of the native build library and that Java native functional interface we can able to communicate with C.

But currently, it only supports digital read/write operations. And still we following todo tasks to complete on C:

  • setPinMode - Configures the mode of a pin
  • analogWrite - Write a PWM signal to an analog output pin
  • analogRead - Read the voltage at an analog input pin
  • attachInterrupt - Attaches an interrupt handler to detect changes on a digital input pin
  • detatchInterrupt - Remove an interrupt handler

Could you please help me on this.

@RaiBnod RaiBnod added this to In progress in BoneScript API Feb 11, 2019
@RaiBnod RaiBnod removed this from To do in IoT Platform Feb 11, 2019
@RaiBnod RaiBnod modified the milestone: 1.0.0-alpha-BoneScriptAPI Feb 11, 2019
@zero88 zero88 added epic: BBB java Replacement bonescript API in js to java and removed Adhoc:Migrated Kafka labels Feb 22, 2019
@zero88 zero88 removed the S: On Hold label Feb 25, 2019
@cooperbrindle
Copy link

Additional Information

Prepare C/C++ code (SPI/PWM/GPIO of BBB) with APIs which can be called from Java (http://jonisalonen.com/2012/calling-c-from-java-is-easy)

Main functions needed at the moment are:

  • setPinMode - Configures the mode of a pin
  • digitalWrite - Write a HIGH or LOW to a digital output pin
  • digitalRead - Read the status of a digital input pin
  • analogWrite - Write a PWM signal to an analog output pin
  • analogRead - Read the voltage at an analog input pin
  • attachInterrupt - Attaches an interrupt handler to detect changes on a digital input pin
  • detatchInterrupt - Remove an interrupt handler

Resources:

@zero88
Copy link
Contributor

zero88 commented Mar 5, 2019

Java need to provide interface and build a header file then C++ implementation should be in
https://github.com/NubeIO/BBBiO

@zero88
Copy link
Contributor

zero88 commented Mar 5, 2019

#70

@cooperbrindle cooperbrindle removed their assignment Apr 4, 2019
@zero88 zero88 added P: Low and removed P: Urgent labels Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bonescript Issue related to BoneScript API epic: BBB java Replacement bonescript API in js to java P: Low T: Feature Issue Type: Feature
Projects
BoneScript API
  
In progress
Development

No branches or pull requests

4 participants