Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4e11d03
minor updates; adding PIGPIO library project
savageautomate Aug 11, 2019
b34245b
optimized imports
savageautomate Aug 11, 2019
94a3a30
minor build cleanup
savageautomate Aug 11, 2019
4a80766
working on PIGPIO lib
savageautomate Aug 11, 2019
f7dba42
adding Pi4J arduino test harness firmware project
savageautomate Aug 13, 2019
b87816a
adding Pi4J arduino test harness firmware project
savageautomate Aug 13, 2019
76b0509
working on test harness integration
savageautomate Aug 13, 2019
5a92d85
working on test harness integration
savageautomate Aug 14, 2019
35ceae3
PIGPIO lib: added I2C support;
savageautomate Aug 15, 2019
861f60f
PIGPIO lib: further I2C impl;
savageautomate Aug 16, 2019
1379d16
PIGPIO lib: added/tested PWM support
savageautomate Aug 16, 2019
f139b56
updated I2C interface for read() and write()
savageautomate Aug 17, 2019
1c1632a
updated I2C interface for readers R/W of 16-bit word values
savageautomate Aug 18, 2019
d3641f9
updates to I2C interface, added examples, etc.
savageautomate Aug 18, 2019
45e6138
adding PIGPIO plugin project, refactoring Arduino Test Harness
savageautomate Aug 18, 2019
a2be3c2
refactoring Arduino Test Harness
savageautomate Aug 19, 2019
aa081af
minor fixes
savageautomate Aug 19, 2019
2971c61
udpated PWM interface and impl;
savageautomate Aug 19, 2019
5d549d5
udpated PWM interface and impl;
savageautomate Aug 19, 2019
f048852
added support for PWM presets
savageautomate Aug 20, 2019
7b4f74a
minor cleanup
savageautomate Aug 20, 2019
0af1c34
minor build fixes
savageautomate Aug 20, 2019
de51ce8
added context properties and property loading chain
savageautomate Aug 20, 2019
a32102d
added digital input and output providers to PIGPIO provider plugin
savageautomate Aug 20, 2019
6980c0c
added TODOs and not yet implemented exceptions for Digital Output
savageautomate Aug 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
###

# ----------------------------------------------------------------------------------
# This is a Java program with a minimum requirment of JDK8.
# This is a Java program with a minimum requirement of JDK8.
# This build should be performed on a Linux platform.
# ----------------------------------------------------------------------------------
language: java
Expand Down
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TODO :: MODIFY PROVIDER INTERFACE AND IMPL TP ALLOW FOR I/O CONFIG VALIDATION BEFORE HAVING PROVIDER CREATE INSTANCE
TODO :: IMPLEMENT DYNAMIC PROXY AROUND PLATFORM
TODO :: SHOULD Pi4J CONTEXT BE AUTO-CLOSABLE?

28 changes: 28 additions & 0 deletions libraries/pi4j-library-pigpio/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>pi4j-library</artifactId>
<groupId>com.pi4j</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath>../pi4j-library</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<!-- MAVEN ARTIFACT INFORMATION -->
<artifactId>pi4j-library-pigpio</artifactId>
<name>Pi4J :: LIBRARY :: PIGPIO Library</name>
<description>Pi4J wrapper for the PIGPIO library</description>
<packaging>jar</packaging>

<!-- DEPENDENCIES -->
<dependencies>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-test-harness</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
//package com.pi4j.library.pigpio;
///*-
// * #%L
* **********************************************************************
* ORGANIZATION : Pi4J
* PROJECT : Pi4J :: LIBRARY :: PIGPIO Library
* FILENAME : MainOld.java
*
* This file is part of the Pi4J project. More information about
* this project can be found here: https://pi4j.com/
* **********************************************************************
* %%
* Copyright (C) 2012 - 2019 Pi4J
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
// */
//
//import com.pi4j.Pi4J;
//import com.pi4j.io.gpio.analog.AnalogChangeListener;
//import com.pi4j.io.gpio.analog.binding.AnalogBindingSync;
//
//public class MainOld {
//
// public MainOld() {
// }
//
//
//// public static byte[] sendCommand(Socket socket, int cmd, int address) throws IOException, InterruptedException {
//// return sendCommand(socket, cmd, address, 0);
//// }
//// public static byte[] sendCommand(Socket socket, int cmd, int address, int value) throws IOException, InterruptedException {
////
//// byte[] bytes = new byte[16];
//// ByteBuffer buffer = ByteBuffer.wrap(bytes);
//// buffer.order(ByteOrder.LITTLE_ENDIAN);
//// buffer.putInt(cmd); // CMD (READ==3, WRITE=4)
//// buffer.putInt(address); // <P1> GPIO 0
//// buffer.putInt(value); // <P2>
//// //buffer.putInt(0); // <P3>
//// //buffer.putInt(0); // <EXT_LEN>
//// //buffer.putInt(0); // <RES>
////
//// System.out.println("[TX] " + Arrays.toString(buffer.array()));
//// socket.getOutputStream().write(buffer.array());
//// socket.getOutputStream().flush();
////
//// Thread.sleep(5);
////
//// int avail = socket.getInputStream().available();
//// var rx = socket.getInputStream().readNBytes(avail);
////
//// System.out.println("BYTES RX : "+ avail);
//// System.out.println(" - [CMD] : " + rx[0] + "," + rx[1]);
//// System.out.println(" - [P1] : " + rx[2] + "," + rx[3]);
//// System.out.println(" - [P2] : " + rx[4] + "," + rx[5]);
//// System.out.println(" - [P3] : " + rx[6] + "," + rx[7]);
////
//// return rx;
//// }
//
// public static void main(String[] args) throws Exception {
// System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE");
//
// // READ 3 gpio 0 0
//
//// typedef struct
//// {
//// uint32_t cmd;
//// uint32_t p1;
//// uint32_t p2;
//// union
//// {
//// uint32_t p3;
//// uint32_t ext_len;
//// uint32_t res;
//// };
//// } cmdCmd_t;
//
// PiGpio pigpio = new PiGpio("rpi3bp");
//
// System.out.println("Raspberry Pi - Hardware Revision : " + pigpio.gpioHardwareRevisionString());
// System.out.println("Raspberry Pi - PIGPIO Lib Version : " + pigpio.gpioVersion());
//
// for(int p = 0 ; p <= 31; p++) {
// System.out.println(" GPIO " + p + "; MODE=" + pigpio.gpioGetMode(p) + "; STATE=" + pigpio.gpioRead(p));
// }
//
//
// //pigpio.digitalState(5);
//
//// pigpio.digitalState(5, DigitalState.HIGH);
//// pigpio.digitalState(5);
////
//// pigpio.digitalState(5, DigitalState.LOW);
//// pigpio.digitalState(5);
//
//
//// Socket socket = new Socket("rpi3bp", 8888);
//
//// System.out.println("IS CONNECTED: "+ socket.isConnected());
//
//// sendCommand(socket, 4, 5, 0);
//// sendCommand(socket,3, 5);
//
//
//// byte[] bytes = new byte[16];
//// ByteBuffer buffer = ByteBuffer.wrap(bytes);
//// buffer.order(ByteOrder.LITTLE_ENDIAN);
//// buffer.putInt(4); // CMD (READ==3, WRITE=4)
//// buffer.putInt(5); // <P1> GPIO 0
//// buffer.putInt(0); // <P2>
//// //buffer.putInt(0); // <P3>
//// //buffer.putInt(0); // <EXT_LEN>
//// //buffer.putInt(0); // <RES>
////
////
//// System.out.println("[TX] " + Arrays.toString(buffer.array()));
//// socket.getOutputStream().write(buffer.array());
//// socket.getOutputStream().flush();
////
//// Thread.sleep(2);
////
//// int avail = socket.getInputStream().available();
//// System.out.println("BYTES AVAIL : "+ avail);
////
////
//// byte[] rx = socket.getInputStream().readNBytes(avail);
////
//// System.out.println(Arrays.toString(rx));
////
//// Thread.sleep(20);
//
//// public String sendMessage(String msg) {
//// out.println(msg);
//// String resp = in.readLine();
//// return resp;
//// }
//
//
// //while(int b =in.read()
//
//
////
//// int inputLine;
//// while ((inputLine = in.read()) != -1) {
//// System.out.println(inputLine);
//// }
//
// System.exit(0);
//
//
// // Initialize Pi4J with an auto context
// // An auto context includes AUTO-DETECT BINDINGS enabled
// // which will load all detected Pi4J extension libraries
// // (Platforms and Providers) in the class path
// var pi4j = Pi4J.newAutoContext();
//
//
//// Serial serial = Serial.instance("/dev/ttyUSB1");
//// serial.open();
//// serial.send("TEST DATA");
//// serial.close();
//
// var din1 = pi4j.din().create(11);
// var ain1 = pi4j.ain().create(21);
//
// var input = pi4j.ain().create(98);
// var output1 = pi4j.aout().create(99);
// var output2 = pi4j.aout().create(100);
//
// input.addListener((AnalogChangeListener) event -> {
// System.out.print(event);
// });
//
//
// output1.addListener((AnalogChangeListener) event -> {
// System.out.println(event);
// });
// output2.addListener((AnalogChangeListener) event -> {
// System.out.println(event);
// });
//
// input.bind(new AnalogBindingSync(output1, output2));
//
//
// //((TestAnalogInput)input).test(21).test(22).test(23);
//
//
// output1.value(12);
// output1.setValue(78);
// output1.value(0x01);
//
//
// //AnalogOutput aout1 = AnalogOutput.in
//// DigitalOutput dout1 = DigitalOutput;
//
// // shutdown Pi4J
// pi4j.shutdown();
// }
//}
Loading