diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 00000000..6acc50cb --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libraries/pi4j-library-gpiod/pom.xml b/libraries/pi4j-library-gpiod/pom.xml index a78703a3..d544bd8a 100644 --- a/libraries/pi4j-library-gpiod/pom.xml +++ b/libraries/pi4j-library-gpiod/pom.xml @@ -6,13 +6,13 @@ com.pi4j pi4j-library - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-library/pom.xml pi4j-library-gpiod - Pi4J :: LIBRARY :: JNI Wrapper for GpioD Library + Pi4J :: LIBRARY :: JNI Wrapper for GpioD Library Pi4J wrapper for the GpioD library jar @@ -43,9 +43,11 @@ LICENSE.txt NOTICE.txt README.md - lib/armhf/pi4j-gpiod/libpi4j-gpiod.so + lib/armhf/pi4j-gpiod/libpi4j-gpiod.so + lib/armhf/pi4j-gpiod/libgpiod.so - lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so + lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so + lib/aarch64/pi4j-gpiod/libgpiod.so @@ -75,10 +77,12 @@ - ${project.build.outputDirectory}/lib/armhf/pi4j-gpiod/libpi4j-gpiod.so + ${project.build.outputDirectory}/lib/armhf/pi4j-gpiod/libpi4j-gpiod.so + ${project.build.outputDirectory}/lib/armhf/pi4j-gpiod/libgpiod.so - ${project.build.outputDirectory}/lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so + ${project.build.outputDirectory}/lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so + ${project.build.outputDirectory}/lib/aarch64/pi4j-gpiod/libgpiod.so @@ -104,14 +108,15 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> run - - + + - - + + - - + + @@ -213,7 +223,8 @@ armhf so true - ${project.build.directory}/lib/armhf/pi4j-gpiod + ${project.build.directory}/lib/armhf/pi4j-gpiod + libpi4j-gpiod.so @@ -223,7 +234,8 @@ armhf so true - ${project.build.directory}/lib/armhf/pi4j-gpiod + ${project.build.directory}/lib/armhf/pi4j-gpiod + libgpiod.so @@ -237,7 +249,8 @@ so aarch64 true - ${project.build.directory}/lib/aarch64/pi4j-gpiod + ${project.build.directory}/lib/aarch64/pi4j-gpiod + libpi4j-gpiod.so @@ -247,7 +260,8 @@ so aarch64 true - ${project.build.directory}/lib/aarch64/pi4j-gpiod + ${project.build.directory}/lib/aarch64/pi4j-gpiod + libgpiod.so @@ -283,10 +297,10 @@ generate-resources - - - - + + + + @@ -311,28 +325,32 @@ + classpathref="maven.plugin.classpath"/> - + - + - + - + - + diff --git a/libraries/pi4j-library-gpiod/src/main/java/com/pi4j/library/gpiod/util/NativeLibraryLoader.java b/libraries/pi4j-library-gpiod/src/main/java/com/pi4j/library/gpiod/util/NativeLibraryLoader.java index 4eeccea8..4f084c0a 100644 --- a/libraries/pi4j-library-gpiod/src/main/java/com/pi4j/library/gpiod/util/NativeLibraryLoader.java +++ b/libraries/pi4j-library-gpiod/src/main/java/com/pi4j/library/gpiod/util/NativeLibraryLoader.java @@ -212,7 +212,7 @@ else if (libpath.equalsIgnoreCase("local")) { /** * Loads library from classpath - * + *

* The file from classpath is copied into system temporary directory and then loaded. The temporary file is * deleted after exiting. Method uses String as filename because the pathname is * "abstract", not system-dependent. diff --git a/libraries/pi4j-library-linuxfs/pom.xml b/libraries/pi4j-library-linuxfs/pom.xml index e2781f51..83f82007 100644 --- a/libraries/pi4j-library-linuxfs/pom.xml +++ b/libraries/pi4j-library-linuxfs/pom.xml @@ -8,13 +8,13 @@ pi4j-library com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-library/pom.xml pi4j-library-linuxfs - Pi4J :: LIBRARY :: JNI Wrapper for LinuxFS Library + Pi4J :: LIBRARY :: JNI Wrapper for LinuxFS Library Pi4J wrapper for the LinuxFS library jar @@ -45,8 +45,10 @@ LICENSE.txt NOTICE.txt README.md - lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so - lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so + lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so + + lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so + @@ -75,9 +77,13 @@ - ${project.build.outputDirectory}/lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so + + ${project.build.outputDirectory}/lib/armhf/pi4j-linuxfs/libpi4j-linuxfs.so + - ${project.build.outputDirectory}/lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so + + ${project.build.outputDirectory}/lib/aarch64/pi4j-linuxfs/libpi4j-linuxfs.so + @@ -102,14 +108,15 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> run - - + + - + - + @@ -209,7 +220,8 @@ armhf so true - ${project.build.directory}/lib/armhf/pi4j-linuxfs + ${project.build.directory}/lib/armhf/pi4j-linuxfs + libpi4j-linuxfs.so @@ -223,7 +235,8 @@ so aarch64 true - ${project.build.directory}/lib/aarch64/pi4j-linuxfs + ${project.build.directory}/lib/aarch64/pi4j-linuxfs + libpi4j-linuxfs.so @@ -259,10 +272,10 @@ generate-resources - - - - + + + + @@ -287,28 +300,32 @@ + classpathref="maven.plugin.classpath"/> - + - + - + - + - + diff --git a/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/LinuxFile.java b/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/LinuxFile.java index adccff77..132d6d69 100644 --- a/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/LinuxFile.java +++ b/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/LinuxFile.java @@ -82,7 +82,7 @@ public void ioctl(long command, int value) throws IOException { * Runs an ioctl on a file descriptor. Uses special offset buffer to produce real C-like structures with pointers. * Advanced use only! Must be able to produce byte-perfect data structures just as gcc would on this system, * including struct padding and pointer size. - * + *

* The data ByteBuffer uses the current position to determine the head point of data passed to the ioctl. This is * useful for appending entry-point data structures at the end of the buffer, while referring to other * structures/data that come before them in the buffer. @@ -93,7 +93,7 @@ public void ioctl(long command, int value) throws IOException { * pointer. Also be sure to consider GCC padding and structure alignment. GCC will try a field to its word size (32b * ints align at 4-byte, etc), and will align the structure size with the native word size (4-byte for 32b, 8-byte * for 64b). - * + *

* Provided IntBuffer offsets must use native byte order (endianness). * *

diff --git a/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/util/NativeLibraryLoader.java b/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/util/NativeLibraryLoader.java
index 4cb23e6d..f64fb51f 100644
--- a/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/util/NativeLibraryLoader.java
+++ b/libraries/pi4j-library-linuxfs/src/main/java/com/pi4j/library/linuxfs/util/NativeLibraryLoader.java
@@ -212,7 +212,7 @@ else if (libpath.equalsIgnoreCase("local")) {
 
 	/**
 	 * Loads library from classpath
-     *
+     * 

* The file from classpath is copied into system temporary directory and then loaded. The temporary file is * deleted after exiting. Method uses String as filename because the pathname is * "abstract", not system-dependent. diff --git a/libraries/pi4j-library-pigpio/pom.xml b/libraries/pi4j-library-pigpio/pom.xml index c48d65c0..0d7b950d 100644 --- a/libraries/pi4j-library-pigpio/pom.xml +++ b/libraries/pi4j-library-pigpio/pom.xml @@ -8,13 +8,13 @@ pi4j-library com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-library/pom.xml pi4j-library-pigpio - Pi4J :: LIBRARY :: JNI Wrapper for PIGPIO Library + Pi4J :: LIBRARY :: JNI Wrapper for PIGPIO Library Pi4J wrapper for the PIGPIO library jar @@ -45,8 +45,10 @@ LICENSE.txt NOTICE.txt README.md - lib/armhf/libpi4j-pigpio.so - lib/aarch64/libpi4j-pigpio.so + lib/armhf/libpi4j-pigpio.so + + lib/aarch64/libpi4j-pigpio.so + @@ -102,14 +104,15 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> run - - + + - + - + @@ -259,10 +264,10 @@ generate-resources - - - - + + + + @@ -287,28 +292,32 @@ + classpathref="maven.plugin.classpath"/> - + - + - + - + - + diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio.java index 18ddfacd..6423f5a1 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio.java @@ -132,7 +132,7 @@ default boolean isInitialized(){ /** * Initialises the library. - * + *

* Returns the pigpio version number if OK, otherwise PI_INIT_FAILED. * gpioInitialise must be called before using the other library functions with the following exceptions: * - gpioCfg* @@ -146,7 +146,7 @@ default boolean isInitialized(){ /** * Initialises the library. - * + *

* Returns the pigpio version number if OK, otherwise PI_INIT_FAILED. * gpioInitialise must be called before using the other library functions with the following exceptions: * - gpioCfg* @@ -160,7 +160,7 @@ default boolean isInitialized(){ /** * Initialises the library. - * + *

* Returns the pigpio version number if OK, otherwise PI_INIT_FAILED. * gpioInitialise must be called before using the other library functions with the following exceptions: * - gpioCfg* @@ -174,7 +174,7 @@ default boolean isInitialized(){ /** * Initialises the library. - * + *

* Returns the pigpio version number if OK, otherwise PI_INIT_FAILED. * gpioInitialise must be called before using the other library functions with the following exceptions: * - gpioCfg* @@ -188,7 +188,7 @@ default boolean isInitialized(){ /** * Shutdown/Terminate the library. - * + *

* Returns nothing. * Call before program exit. * This function resets the used DMA channels, releases memory, and terminates any running threads. @@ -199,7 +199,7 @@ default void shutdown() { /** * Shutdown/Terminate the library. - * + *

* Returns nothing. * Call before program exit. * This function resets the used DMA channels, releases memory, and terminates any running threads. @@ -210,7 +210,7 @@ default void terminate() { /** * Shutdown/Terminate the library. - * + *

* Returns nothing. * Call before program exit. * This function resets the used DMA channels, releases memory, and terminates any running threads. @@ -227,16 +227,16 @@ default void terminate() { /** * Returns the hardware revision. - * + *

* If the hardware revision can not be found or is not a valid hexadecimal number the function returns 0. * The hardware revision is the last few characters on the Revision line of /proc/cpuinfo. * The revision number can be used to determine the assignment of GPIO to pins (see gpio). - * + *

* There are at least three types of board. * - Type 1 boards have hardware revision numbers of 2 and 3. * - Type 2 boards have hardware revision numbers of 4, 5, 6, and 15. * - Type 3 boards have hardware revision numbers of 16 or greater. - * + *

* for "Revision : 0002" the function returns 2. * for "Revision : 000f" the function returns 15. * for "Revision : 000g" the function returns 0. @@ -249,16 +249,16 @@ default void terminate() { /** * Returns the hardware revision (as hexadecimal string). - * + *

* If the hardware revision can not be found or is not a valid hexadecimal number the function returns 0. * The hardware revision is the last few characters on the Revision line of /proc/cpuinfo. * The revision number can be used to determine the assignment of GPIO to pins (see gpio). - * + *

* There are at least three types of board. * - Type 1 boards have hardware revision numbers of 2 and 3. * - Type 2 boards have hardware revision numbers of 4, 5, 6, and 15. * - Type 3 boards have hardware revision numbers of 16 or greater. - * + *

* for "Revision : 0002" the function returns 2. * for "Revision : 000f" the function returns 15. * for "Revision : 000g" the function returns 0. @@ -299,17 +299,17 @@ default long gpioDelayMicroseconds(long micros){ /** * Returns the current system tick. * Tick is the number of microseconds since system boot. - * + *

* As tick is an unsigned 32 bit quantity it wraps around after 2^32 microseconds, which is * approximately 1 hour 12 minutes. You don't need to worry about the wrap around as long as you * take a tick (uint32_t) from another tick, i.e. the following code will always provide the * correct difference. - * + *

* Example * uint32_t startTick, endTick; * int diffTick; * startTick = gpioTick(); - * + *

* // do some processing * endTick = gpioTick(); * diffTick = endTick - startTick; diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpioPacket.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpioPacket.java index 1bbacb04..d6a7e572 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpioPacket.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpioPacket.java @@ -377,7 +377,7 @@ public static PiGpioPacket decode(InputStream stream) throws IOException { /** * The packet may indicate the number of bytes to expect from the stream. - * + *

* E.g. I2C packets provide this value via {@link PiGpioPacket#p3} * * @param packet the packet being read diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_GPIO.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_GPIO.java index 45452e60..9704c710 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_GPIO.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_GPIO.java @@ -104,20 +104,20 @@ default void gpioWrite(int pin, int state){ /** * Sets a glitch filter on a GPIO. (AKA Debounce) - * + *

* Level changes on the GPIO are not reported unless the level has been stable for at * least 'steady' microseconds. The level is then reported. Level changes of less * than 'steady' microseconds are ignored. - * + *

* This filter affects the GPIO samples returned to callbacks set up with: * - gpioSetAlertFunc * - gpioSetAlertFuncEx * - gpioSetGetSamplesFunc * - gpioSetGetSamplesFuncEx. - * + *

* It does not affect interrupts set up with gpioSetISRFunc, gpioSetISRFuncEx, or * levels read by gpioRead, gpioRead_Bits_0_31, or gpioRead_Bits_32_53. - * + *

* Each (stable) edge will be timestamped steady microseconds after it was first detected. * * @param pin gpio pin address (valid pins are 0-31) @@ -128,11 +128,11 @@ default void gpioWrite(int pin, int state){ /** * Sets a noise filter on a GPIO. - * + *

* Level changes on the GPIO are ignored until a level which has been stable for 'steady' * microseconds is detected. Level changes on the GPIO are then reported for 'active' * microseconds after which the process repeats. - * + *

* This filter affects the GPIO samples returned to callbacks set up with: * - gpioSetAlertFunc * - gpioSetAlertFuncEx @@ -140,7 +140,7 @@ default void gpioWrite(int pin, int state){ * - gpioSetGetSamplesFuncEx. * * It does not affect interrupts set up with gpioSetISRFunc, gpioSetISRFuncEx, or * levels read by gpioRead, gpioRead_Bits_0_31, or gpioRead_Bits_32_53. - * + *

* Level changes before and after the active period may be reported. * Your software must be designed to cope with such reports. * diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_I2C.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_I2C.java index 1afeadb0..7840aebf 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_I2C.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_I2C.java @@ -44,7 +44,7 @@ public interface PiGpio_I2C { * This returns a handle for the device at the address on the I2C bus. * Physically buses 0 and 1 are available on the Pi. * Higher numbered buses will be available if a kernel supported bus multiplexor is being used. - * + *

* The GPIO used are given in the following table. * SDA SCL * I2C0 0 1 @@ -63,7 +63,7 @@ public interface PiGpio_I2C { * This returns a handle for the device at the address on the I2C bus. * Physically buses 0 and 1 are available on the Pi. * Higher numbered buses will be available if a kernel supported bus multiplexor is being used. - * + *

* The GPIO used are given in the following table. * SDA SCL * I2C0 0 1 @@ -216,7 +216,7 @@ default int i2cWriteBlockData(int handle, int register, byte[] data){ /** * This writes up to 32 bytes to the specified I2C register of the device * associated with the handle from the given offset index to the specified length. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -244,7 +244,7 @@ default int i2cWriteBlockData(int handle, int register, ByteBuffer buffer, int o /** * This writes up to 32 bytes to the specified I2C register of the device * associated with the handle from the current position to the specified length. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -276,7 +276,7 @@ default int i2cWriteBlockData(int handle, int register, ByteBuffer buffer, int l * This writes up to 32 bytes to the specified I2C register of the device * associated with the handle. The contents of the byte buffer are written from * the buffer's current position to the buffer's limit. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -447,7 +447,7 @@ default int i2cReadBlockData(int handle, int register, byte[] buffer) { * This reads a block of up to 32 bytes from the specified register of the device associated with the handle * into the provided byte buffer at the given offset and up to the specified data length (number of bytes). * (The amount of returned data is set by the device.) - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -493,7 +493,7 @@ default int i2cReadBlockData(int handle, int register, ByteBuffer buffer, int of * This reads a block of up to 32 bytes from the specified register of the device associated with the handle * and copies the data bytes into the provided byte buffer starting with the current buffer position. * (The amount of returned data is set by the device.) - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the length requested or up to the @@ -526,7 +526,7 @@ default int i2cReadBlockData(int handle, int register, ByteBuffer buffer, int le * This reads a block of up to 32 bytes from the specified register of the device associated with the handle * and copies the data bytes into the provided byte buffer starting with the current buffer position up to * the available space remaining in the buffer. (The amount of returned data is set by the device.) - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the buffer's remaining limit. If @@ -553,7 +553,7 @@ default int i2cReadBlockData(int handle, int register, ByteBuffer buffer) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -573,7 +573,7 @@ default int i2cReadBlockData(int handle, int register, ByteBuffer buffer) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -594,7 +594,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] write, int writ /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -614,7 +614,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] write, int writ /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -633,7 +633,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] write, byte[] r /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -651,7 +651,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] write, byte[] r /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -670,7 +670,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data, int lengt /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -688,7 +688,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -711,7 +711,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -733,7 +733,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -754,7 +754,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -774,7 +774,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -795,7 +795,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -815,7 +815,7 @@ default int i2cBlockProcessCall(int handle, int register, byte[] data) { /** * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @@ -880,7 +880,7 @@ default int i2cReadI2CBlockData(int handle, int register, byte[] buffer){ * This reads a block of up to 32 bytes from the specified register of the device associated with the handle * into the provided byte buffer at the given offset and up to the specified data length (number of bytes). * (The amount of returned data is set by the device.) - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -926,7 +926,7 @@ default int i2cReadI2CBlockData(int handle, int register, ByteBuffer buffer, int * This reads a block of up to 32 bytes from the specified register of the device associated with the handle * and copies the data bytes into the provided byte buffer starting with the current buffer position. * (The amount of returned data is set by the device.) - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the length requested or up to the @@ -959,7 +959,7 @@ default int i2cReadI2CBlockData(int handle, int register, ByteBuffer buffer, int * This reads a block of up to 32 bytes from the specified register of the device associated with the handle * and copies the data bytes into the provided byte buffer starting with the current buffer position up to * the available space remaining in the buffer. (The amount of returned data is set by the device.) - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the buffer's remaining limit. If @@ -1029,7 +1029,7 @@ default int i2cWriteI2CBlockData(int handle, int register, byte[] data){ /** * This writes up to 32 bytes to the specified I2C register of the device * associated with the handle from the given offset index to the specified length. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -1057,7 +1057,7 @@ default int i2cWriteI2CBlockData(int handle, int register, ByteBuffer buffer, in /** * This writes up to 32 bytes to the specified I2C register of the device * associated with the handle from the current position to the specified length. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -1089,7 +1089,7 @@ default int i2cWriteI2CBlockData(int handle, int register, ByteBuffer buffer, in * This writes up to 32 bytes to the specified I2C register of the device * associated with the handle. The contents of the byte buffer are written from * the buffer's current position to the buffer's limit. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -1246,7 +1246,7 @@ default int i2cReadDevice(int handle, byte[] buffer){ /** * This reads multiple bytes from the raw I2C device associated with the handle into the provided * byte buffer at the given offset and up to the specified data length (number of bytes). - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -1289,7 +1289,7 @@ default int i2cReadDevice(int handle, ByteBuffer buffer, int offset, int length) /** * This reads multiple bytes from the raw I2C device associated with the handle and copies * the data bytes into the provided byte buffer starting with the current buffer position. - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the length requested or up to the @@ -1321,7 +1321,7 @@ default int i2cReadDevice(int handle, ByteBuffer buffer, int length){ * This reads multiple bytes from the raw I2C associated with the handle and copies the * data bytes into the provided byte buffer starting with the current buffer position up to * the available space remaining in the buffer. - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the buffer's remaining limit. If @@ -1387,7 +1387,7 @@ default int i2cWriteDevice(int handle, byte[] data){ /** * This writes multiple bytes from the provided byte buffer to the raw I2C device * associated with the handle from the given offset index to the specified length. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -1414,7 +1414,7 @@ default int i2cWriteDevice(int handle, ByteBuffer buffer, int offset, int length /** * This writes multiple bytes from the provided byte buffer to the raw I2C device * associated with the handle from the current position to the specified length. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -1445,7 +1445,7 @@ default int i2cWriteDevice(int handle, ByteBuffer buffer, int length){ * This writes multiple bytes from the provided byte buffer to the raw I2C device * associated with the handle. The contents of the byte buffer are written from * the buffer's current position to the buffer's limit. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_PWM.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_PWM.java index 48818972..f66b7ec2 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_PWM.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_PWM.java @@ -37,7 +37,7 @@ public interface PiGpio_PWM { /** * Starts PWM on the GPIO, duty-cycle between 0 (off) and range (fully on). Range defaults to 255. - * + *

* This and the servo functionality use the DMA and PWM or PCM peripherals to control and schedule * the pulse lengths and duty cycles. * @@ -49,7 +49,7 @@ public interface PiGpio_PWM { /** * Starts PWM on the GPIO, duty-cycle between 0 (off) and range (fully on). Range defaults to 255. - * + *

* This and the servo functionality use the DMA and PWM or PCM peripherals to control and schedule * the pulse lengths and duty cycles. * @@ -64,11 +64,11 @@ default void gpioSetPWMdutycycle(int pin, int dutyCycle){ /** * Returns the PWM dutycycle setting for the GPIO. - * + *

* For normal PWM the dutycycle will be out of the defined range for the GPIO (see gpioGetPWMrange). * If a hardware clock is active on the GPIO the reported dutycycle will be 500000 (500k) out of 1000000 (1M). * If hardware PWM is active on the GPIO the reported dutycycle will be out of a 1000000 (1M). - * + *

* Normal PWM range defaults to 255. * * @param pin user_gpio: 0-31 @@ -82,10 +82,10 @@ default void gpioSetPWMdutycycle(int pin, int dutyCycle){ * Selects the dutycycle range to be used for the GPIO. Subsequent calls to gpioPWM will use a dutycycle * between 0 (off) and range (fully on. If PWM is currently active on the GPIO its dutycycle will be * scaled to reflect the new range. - * + *

* The real range, the number of steps between fully off and fully on for each frequency, * is given in the following table. - * + *

* ------------------------------------------------------- * #1 #2 #3 #4 #5 #6 #7 #8 #9 * 25, 50, 100, 125, 200, 250, 400, 500, 625, @@ -93,9 +93,9 @@ default void gpioSetPWMdutycycle(int pin, int dutyCycle){ * #10 #11 #12 #13 #14 #15 #16 #17 #18 * 800, 1000, 1250, 2000, 2500, 4000, 5000, 10000, 20000 * ------------------------------------------------------- - * + *

* The real value set by gpioPWM is (dutycycle * real range) / range. - * + *

* Example * gpioSetPWMrange(24, 2000); // Now 2000 is fully on * // 1000 is half on @@ -132,34 +132,34 @@ default void gpioSetPWMdutycycle(int pin, int dutyCycle){ /** * Sets the frequency in hertz to be used for the GPIO. - * + *

* If PWM is currently active on the GPIO it will be switched off and then back on at the new frequency. * Each GPIO can be independently set to one of 18 different PWM frequencies. * The selectable frequencies depend upon the sample rate which may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). - * + *

* The frequencies for each sample rate are: - * + *

* Hertz - * + *

* 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600 * 1250 1000 800 500 400 250 200 100 50 - * + *

* 2: 20000 10000 5000 4000 2500 2000 1250 1000 800 * 625 500 400 250 200 125 100 50 25 - * + *

* 4: 10000 5000 2500 2000 1250 1000 625 500 400 * 313 250 200 125 100 63 50 25 13 * sample * rate * (us) 5: 8000 4000 2000 1600 1000 800 500 400 320 * 250 200 160 100 80 50 40 20 10 - * + *

* 8: 5000 2500 1250 1000 625 500 313 250 200 * 156 125 100 63 50 31 25 13 6 - * + *

* 10: 4000 2000 1000 800 500 400 250 200 160 * 125 100 80 50 40 25 20 10 5 - * + *

* * Example: * gpioSetPWMfrequency(23, 0); // Set GPIO23 to lowest frequency. @@ -176,11 +176,11 @@ default void gpioSetPWMdutycycle(int pin, int dutyCycle){ /** * Returns the frequency (in hertz) used for the GPIO - * + *

* For normal PWM the frequency will be that defined for the GPIO by gpioSetPWMfrequency. * If a hardware clock is active on the GPIO the reported frequency will be that set by gpioHardwareClock. * If hardware PWM is active on the GPIO the reported frequency will be that set by gpioHardwarePWM. - * + *

* Example: * f = gpioGetPWMfrequency(23); // Get frequency used for GPIO23. * @@ -194,28 +194,28 @@ default void gpioSetPWMdutycycle(int pin, int dutyCycle){ /** * Starts hardware PWM on a GPIO at the specified frequency and duty-cycle. * Frequencies above 30MHz are unlikely to work. - * + *

* NOTE: Any waveform started by gpioWaveTxSend, or gpioWaveChain will be cancelled. - * + *

* This function is only valid if the pigpio main clock is PCM. * The main clock defaults to PCM but may be overridden by a call to gpioCfgClock. - * + *

* The same PWM channel is available on multiple GPIO. The latest frequency and duty-cycle * setting will be used by all GPIO which share a PWM channel. - * + *

* The GPIO must be one of the following. - * + *

* 12 PWM channel 0 All models but A and B * 13 PWM channel 1 All models but A and B * 18 PWM channel 0 All models * 19 PWM channel 1 All models but A and B - * + *

* 40 PWM channel 0 Compute module only * 41 PWM channel 1 Compute module only * 45 PWM channel 1 Compute module only * 52 PWM channel 0 Compute module only * 53 PWM channel 1 Compute module only - * + *

* * The actual number of steps between off and fully on is the integral part of * 250M/PWMfreq (375M/PWMfreq for the BCM2711). diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_SPI.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_SPI.java index fabf0379..4e7c4093 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_SPI.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_SPI.java @@ -43,39 +43,39 @@ public interface PiGpio_SPI { * This function opens a SPI device channel at a specified baud rate and with specified flags. * Data will be transferred at baud bits per second. * The flags may be used to modify the default behaviour of 4-wire operation, mode 0, active low chip select. - * + *

* The Pi has two SPI peripherals: main and auxiliary. * The main SPI has two chip selects (channels), the auxiliary has three. * The auxiliary SPI is available on all models but the A and B. - * + *

* The GPIO pins used are given in the following table. - * + *

* MISO MOSI SCLK CE0 CE1 CE2 * ------------------------------------- * Main SPI 9 10 11 8 7 - * Aux SPI 19 20 21 18 17 16 - * + *

* * spiChan : 0-1 (0-2 for the auxiliary SPI) * baud : 32K-125M (values above 30M are unlikely to work) * spiFlags : see below - * + *

* spiFlags consists of the least significant 22 bits. * ----------------------------------------------------------------- * 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * b b b b b b R T n n n n W A u2 u1 u0 p2 p1 p0 m m * ----------------------------------------------------------------- - * + *

* [mm] defines the SPI mode. * (Warning: modes 1 and 3 do not appear to work on the auxiliary SPI.) - * + *

* Mode POL PHA * ------------- * 0 0 0 * 1 0 1 * 2 1 0 * 3 1 1 - * + *

* [px] is 0 if CEx is active low (default) and 1 for active high. * [ux] is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise. * [A] is 0 for the main SPI, 1 for the auxiliary SPI. @@ -84,12 +84,12 @@ public interface PiGpio_SPI { * [T] is 1 if the least significant bit is transmitted on MOSI first, the default (0) shifts the most significant bit out first. Auxiliary SPI only. * [R] is 1 if the least significant bit is received on MISO first, the default (0) receives the most significant bit first. Auxiliary SPI only. * [bbbbbb] defines the word size in bits (0-32). The default (0) sets 8 bits per word. Auxiliary SPI only. - * + *

* The spiRead, spiWrite, and spiXfer functions transfer data packed into 1, 2, or 4 bytes according to the word size in bits. * - For bits 1-8 there will be one byte per word. * - For bits 9-16 there will be two bytes per word. * - For bits 17-32 there will be four bytes per word. - * + *

* Multi-byte transfers are made in least significant byte first order. * E.g. to transfer 32 11-bit words buf should contain 64 bytes and count should be 64. * E.g. to transfer the 14 bit value 0x1ABC send the bytes 0xBC followed by 0x1A. @@ -106,27 +106,27 @@ public interface PiGpio_SPI { /** * This function opens a SPI device channel at a specified baud rate and with default options using SPI mode 0. * Data will be transferred at baud bits per second. - * + *

* The Pi has two SPI peripherals: main and auxiliary. * The main SPI has two chip selects (channels), the auxiliary has three. * The auxiliary SPI is available on all models but the A and B. - * + *

* The GPIO pins used are given in the following table. - * + *

* MISO MOSI SCLK CE0 CE1 CE2 * ------------------------------------- * Main SPI 9 10 11 8 7 - * Aux SPI 19 20 21 18 17 16 - * + *

* * spiChan : 0-1 (0-2 for the auxiliary SPI) * baud : 32K-125M (values above 30M are unlikely to work) - * + *

* The spiRead, spiWrite, and spiXfer functions transfer data packed into 1, 2, or 4 bytes according to the word size in bits. * - For bits 1-8 there will be one byte per word. * - For bits 9-16 there will be two bytes per word. * - For bits 17-32 there will be four bytes per word. - * + *

* Multi-byte transfers are made in least significant byte first order. * E.g. to transfer 32 11-bit words buf should contain 64 bytes and count should be 64. * E.g. to transfer the 14 bit value 0x1ABC send the bytes 0xBC followed by 0x1A. @@ -264,7 +264,7 @@ default int spiWrite(int handle, byte[] data){ /** * This function writes multiple bytes from the byte buffer to the SPI device * associated with the handle from the given offset index to the specified length. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -291,7 +291,7 @@ default int spiWrite(int handle, ByteBuffer buffer, int offset, int length){ /** * This function writes multiple bytes from the byte buffer to the SPI device * associated with the handle from the current buffer position to the specified length. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -322,7 +322,7 @@ default int spiWrite(int handle, ByteBuffer buffer, int length){ * This function writes multiple bytes from the byte buffer to the SPI device * associated with the handle. The contents of the byte buffer are written from * the buffer's current position to the buffer's limit. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -493,7 +493,7 @@ default int spiRead(int handle, byte[] buffer){ /** * Read data from the SPI device into the provided byte buffer at the given * offset and up to the specified data length (number of bytes). - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -536,7 +536,7 @@ default int spiRead(int handle, ByteBuffer buffer, int offset, int length){ /** * Read data from the SPI device into the provided byte buffer starting * with the buffer's current position up to the provided length. - * + *

* NOTE: The data bytes read from the SPI device are copied/ * inserted into the byte buffer starting at the current * position index up to the length requested or up to the @@ -567,7 +567,7 @@ default int spiRead(int handle, ByteBuffer buffer, int length){ /** * Read data from the SPI device into the provided byte buffer starting with * the buffer's current position up to available space remaining in the buffer. - * + *

* NOTE: The data bytes read from the SPI device are copied/ * inserted into the byte buffer starting at the current * position index up to the buffer's remaining limit. If @@ -719,7 +719,7 @@ default int spiXfer(int handle, byte[] buffer){ * using the same length ('numberOfBytes'). Both the 'write' and 'read' byte buffers must * at least have the available capacity of the defined 'numberOfBytes' + their corresponding * offsets. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -771,7 +771,7 @@ default int spiXfer(int handle, ByteBuffer write, int writeOffset, ByteBuffer re * current position using the same length ('numberOfBytes'). Both the 'write' and 'read' * byte buffers must at least have the available capacity of the defined 'numberOfBytes' + * their corresponding current positions. - * + *

* NOTE: The contents from the 'write' byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -779,7 +779,7 @@ default int spiXfer(int handle, ByteBuffer write, int writeOffset, ByteBuffer re * position is already at the buffer's limit, then we * will automatically flip the buffer to begin reading * data from the zero position up to the buffer's limit * - * + *

* NOTE: The data bytes read from the SPI device are copied/ * inserted into the 'read' byte buffer starting at the current * position index up to the length requested or up to the @@ -819,7 +819,7 @@ default int spiXfer(int handle, ByteBuffer write, ByteBuffer read, int numberOfB * read from the SPI device is then copied to the byte buffer at the given 'offset' * using the same length (number of bytes). The byte buffer must at least have the * available capacity of the defined 'length' + 'offset'. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Serial.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Serial.java index f5b1c3ff..dc8fd5b2 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Serial.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Serial.java @@ -156,7 +156,7 @@ default int serWrite(int handle, byte[] data){ /** * This function writes multiple bytes from the byte buffer to the serial device * associated with the handle from the given offset index to the specified length. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -183,7 +183,7 @@ default int serWrite(int handle, ByteBuffer buffer, int offset, int length){ /** * This function writes multiple bytes from the byte buffer to the serial device * associated with the handle from the current buffer position to the specified length. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -214,7 +214,7 @@ default int serWrite(int handle, ByteBuffer buffer, int length){ * This function writes multiple bytes from the byte buffer to the serial device * associated with the handle. The contents of the byte buffer are written from * the buffer's current position to the buffer's limit. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -385,7 +385,7 @@ default int serRead(int handle, byte[] buffer){ /** * Read data from the serial device into the provided byte buffer at the given * offset and up to the specified data length (number of bytes). - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -428,7 +428,7 @@ default int serRead(int handle, ByteBuffer buffer, int offset, int length){ /** * Read data from the serial device into the provided byte buffer starting * with the current buffer position to the provided length. - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the length requested or up to the @@ -459,7 +459,7 @@ default int serRead(int handle, ByteBuffer buffer, int length){ /** * Read data from the serial device into the provided byte buffer starting with * the buffer's current position up to available space remaining in the buffer. - * + *

* NOTE: The data bytes read from the serial device are copied/ * inserted into the byte buffer starting at the current * position index up to the buffer's remaining limit. If diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Servo.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Servo.java index 810f2304..631e95be 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Servo.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/PiGpio_Servo.java @@ -27,8 +27,6 @@ * #L% */ -import java.io.IOException; - /** *

PiGpio_Servo interface.

* @@ -39,35 +37,35 @@ public interface PiGpio_Servo { /** * Starts servo pulses on the GPIO, 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise). - * + *

* The range supported by servos varies and should probably be determined by experiment. A value * of 1500 should always be safe and represents the mid-point of rotation. You can DAMAGE a servo * if you command it to move beyond its limits. - * + *

* The following causes an on pulse of 1500 microseconds duration to be transmitted on GPIO 17 at * a rate of 50 times per second. This will command a servo connected to GPIO 17 to rotate to its * mid-point. - * + *

* Example: * - gpioServo(17, 1000); // Move servo to safe position anti-clockwise. * - gpioServo(23, 1500); // Move servo to centre position. * - gpioServo(25, 2000); // Move servo to safe position clockwise. - * + *

* OTHER UPDATE RATES: * This function updates servos at 50Hz. If you wish to use a different * update frequency you will have to use the PWM functions. - * + *

* PWM Hz 50 100 200 400 500 * 1E6/Hz 20000 10000 5000 2500 2000 - * + *

* Firstly set the desired PWM frequency using gpioSetPWMfrequency. * Then set the PWM range using gpioSetPWMrange to 1E6/frequency. Doing this * allows you to use units of microseconds when setting the servo pulsewidth. - * + *

* E.g. If you want to update a servo connected to GPIO25 at 400Hz* * - gpioSetPWMfrequency(25, 400); * - gpioSetPWMrange(25, 2500); - * + *

* Thereafter use the PWM command to move the servo, e.g. gpioPWM(25, 1500) will set a 1500 us pulse. * * @param pin user_gpio: 0-31 @@ -78,35 +76,35 @@ public interface PiGpio_Servo { /** * Starts servo pulses on the GPIO, 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise). - * + *

* The range supported by servos varies and should probably be determined by experiment. A value * of 1500 should always be safe and represents the mid-point of rotation. You can DAMAGE a servo * if you command it to move beyond its limits. - * + *

* The following causes an on pulse of 1500 microseconds duration to be transmitted on GPIO 17 at * a rate of 50 times per second. This will command a servo connected to GPIO 17 to rotate to its * mid-point. - * + *

* Example: * - gpioServo(17, 1000); // Move servo to safe position anti-clockwise. * - gpioServo(23, 1500); // Move servo to centre position. * - gpioServo(25, 2000); // Move servo to safe position clockwise. - * + *

* OTHER UPDATE RATES: * This function updates servos at 50Hz. If you wish to use a different * update frequency you will have to use the PWM functions. - * + *

* PWM Hz 50 100 200 400 500 * 1E6/Hz 20000 10000 5000 2500 2000 - * + *

* Firstly set the desired PWM frequency using gpioSetPWMfrequency. * Then set the PWM range using gpioSetPWMrange to 1E6/frequency. Doing this * allows you to use units of microseconds when setting the servo pulsewidth. - * + *

* E.g. If you want to update a servo connected to GPIO25 at 400Hz* * - gpioSetPWMfrequency(25, 400); * - gpioSetPWMrange(25, 2500); - * + *

* Thereafter use the PWM command to move the servo, e.g. gpioPWM(25, 1500) will set a 1500 us pulse. * * @param pin user_gpio: 0-31 diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioBase.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioBase.java index ff8ca765..b297dbec 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioBase.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioBase.java @@ -99,25 +99,25 @@ protected void validateInitialized() { * GPIO PINS * -------------------------------------------------------------------------- * A Broadcom numbered GPIO, in the range 0-53. - * + *

* There are 54 General Purpose Input Outputs (GPIO) named GPIO0 through GPIO53. - * + *

* They are split into two banks. Bank 1 consists of GPIO0 through GPIO31. * Bank 2 consists of GPIO32 through GPIO53. - * + *

* All the GPIO which are safe for the user to read and write are in bank 1. * Not all GPIO in bank 1 are safe though. Type 1 boards have 17 safe GPIO. * Type 2 boards have 21. Type 3 boards have 26. - * + *

* See gpioHardwareRevision. - * + *

* The user GPIO are marked with an X in the following table. - * + *

* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 * Type 1 X X - - X - - X X X X X - - X X * Type 2 - - X X X - - X X X X X - - X X * Type 3 X X X X X X X X X X X X X X - * + *

* 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 * Type 1 - X X - - X X X X X - - - - - - * Type 2 - X X - - - X X X X - X X X X X @@ -506,16 +506,16 @@ protected void dispatchEvent(final PiGpioStateChangeEvent event) { * {@inheritDoc} * * Returns the hardware revision (as hexadecimal string). - * + *

* If the hardware revision can not be found or is not a valid hexadecimal number the function returns 0. * The hardware revision is the last few characters on the Revision line of /proc/cpuinfo. * The revision number can be used to determine the assignment of GPIO to pins (see gpio). - * + *

* There are at least three types of board. * - Type 1 boards have hardware revision numbers of 2 and 3. * - Type 2 boards have hardware revision numbers of 4, 5, 6, and 15. * - Type 3 boards have hardware revision numbers of 16 or greater. - * + *

* for "Revision : 0002" the function returns 2. * for "Revision : 000f" the function returns 15. * for "Revision : 000g" the function returns 0. diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioNativeImpl.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioNativeImpl.java index 23435c38..30068a8f 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioNativeImpl.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioNativeImpl.java @@ -87,7 +87,7 @@ private PiGpioNativeImpl() { * * Initializes the library. * (The Java implementation of this function does not return a value) - * + *

* gpioInitialise must be called before using the other library functions with the following exceptions: * - gpioCfg* * - gpioVersion @@ -134,7 +134,7 @@ public int gpioInitialise() { * {@inheritDoc} * * Shutdown the library. - * + *

* Returns nothing. * Call before program exit. * This function resets the used DMA channels, releases memory, and terminates any running threads. @@ -174,16 +174,16 @@ public int gpioVersion() { * {@inheritDoc} * * Returns the hardware revision. - * + *

* If the hardware revision can not be found or is not a valid hexadecimal number the function returns 0. * The hardware revision is the last few characters on the Revision line of /proc/cpuinfo. * The revision number can be used to determine the assignment of GPIO to pins (see gpio). - * + *

* There are at least three types of board. * - Type 1 boards have hardware revision numbers of 2 and 3. * - Type 2 boards have hardware revision numbers of 4, 5, 6, and 15. * - Type 3 boards have hardware revision numbers of 16 or greater. - * + *

* for "Revision : 0002" the function returns 2. * for "Revision : 000f" the function returns 15. * for "Revision : 000g" the function returns 0. @@ -243,7 +243,7 @@ public PiGpioMode gpioGetMode(int pin) { * {@inheritDoc} * * Sets the GPIO mode, typically input or output. - * + *

* gpio: 0-53 * mode: 0-7 * @see PIGPIO::gpioSetMode @@ -296,17 +296,17 @@ public void gpioWrite(int pin, PiGpioState state) { * {@inheritDoc} * * Sets a glitch filter on a GPIO. (AKA Debounce) - * + *

* Level changes on the GPIO are not reported unless the level has been stable for at * least 'steady' microseconds. The level is then reported. Level changes of less * than 'steady' microseconds are ignored. - * + *

* This filter affects the GPIO samples returned to callbacks set up with: * - gpioSetAlertFunc * - gpioSetAlertFuncEx * - gpioSetGetSamplesFunc * - gpioSetGetSamplesFuncEx. - * + *

* It does not affect interrupts set up with gpioSetISRFunc, gpioSetISRFuncEx, or * levels read by gpioRead, gpioRead_Bits_0_31, or gpioRead_Bits_32_53. * Each (stable) edge will be timestamped steady microseconds after it was first detected. @@ -326,11 +326,11 @@ public void gpioGlitchFilter(int pin, int steady) { * {@inheritDoc} * * Sets a noise filter on a GPIO. - * + *

* Level changes on the GPIO are ignored until a level which has been stable for 'steady' * microseconds is detected. Level changes on the GPIO are then reported for 'active' * microseconds after which the process repeats. - * + *

* This filter affects the GPIO samples returned to callbacks set up with: * - gpioSetAlertFunc * - gpioSetAlertFuncEx @@ -338,7 +338,7 @@ public void gpioGlitchFilter(int pin, int steady) { * - gpioSetGetSamplesFuncEx. * * It does not affect interrupts set up with gpioSetISRFunc, gpioSetISRFuncEx, or * levels read by gpioRead, gpioRead_Bits_0_31, or gpioRead_Bits_32_53. - * + *

* Level changes before and after the active period may be reported. * Your software must be designed to cope with such reports. * @see PIGPIO::gpioGlitchFilter @@ -364,7 +364,7 @@ public void gpioNoiseFilter(int pin, int steady, int active) { * {@inheritDoc} * * Starts PWM on the GPIO, dutycycle between 0 (off) and range (fully on). Range defaults to 255. - * + *

* This and the servo functionality use the DMA and PWM or PCM peripherals to control and schedule * the pulse lengths and duty cycles. * @see PIGPIO::gpioPWM @@ -384,11 +384,11 @@ public void gpioPWM(int pin, int dutyCycle) { * {@inheritDoc} * * Returns the PWM dutycycle setting for the GPIO. - * + *

* For normal PWM the dutycycle will be out of the defined range for the GPIO (see gpioGetPWMrange). * If a hardware clock is active on the GPIO the reported dutycycle will be 500000 (500k) out of 1000000 (1M). * If hardware PWM is active on the GPIO the reported dutycycle will be out of a 1000000 (1M). - * + *

* Normal PWM range defaults to 255. * @see PIGPIO::gpioGetPWMdutycycle */ @@ -409,10 +409,10 @@ public int gpioGetPWMdutycycle(int pin) { * Selects the dutycycle range to be used for the GPIO. Subsequent calls to gpioPWM will use a dutycycle * between 0 (off) and range (fully on. If PWM is currently active on the GPIO its dutycycle will be * scaled to reflect the new range. - * + *

* The real range, the number of steps between fully off and fully on for each frequency, * is given in the following table. - * + *

* ------------------------------------------------------- * #1 #2 #3 #4 #5 #6 #7 #8 #9 * 25, 50, 100, 125, 200, 250, 400, 500, 625, @@ -420,9 +420,9 @@ public int gpioGetPWMdutycycle(int pin) { * #10 #11 #12 #13 #14 #15 #16 #17 #18 * 800, 1000, 1250, 2000, 2500, 4000, 5000, 10000, 20000 * ------------------------------------------------------- - * + *

* The real value set by gpioPWM is (dutycycle * real range) / range. - * + *

* Example * gpioSetPWMrange(24, 2000); // Now 2000 is fully on * // 1000 is half on @@ -483,34 +483,34 @@ public int gpioGetPWMrealRange(int pin) { * {@inheritDoc} * * Sets the frequency in hertz to be used for the GPIO. - * + *

* If PWM is currently active on the GPIO it will be switched off and then back on at the new frequency. * Each GPIO can be independently set to one of 18 different PWM frequencies. * The selectable frequencies depend upon the sample rate which may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). - * + *

* The frequencies for each sample rate are: - * + *

* Hertz - * + *

* 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600 * 1250 1000 800 500 400 250 200 100 50 - * + *

* 2: 20000 10000 5000 4000 2500 2000 1250 1000 800 * 625 500 400 250 200 125 100 50 25 - * + *

* 4: 10000 5000 2500 2000 1250 1000 625 500 400 * 313 250 200 125 100 63 50 25 13 * sample * rate * (us) 5: 8000 4000 2000 1600 1000 800 500 400 320 * 250 200 160 100 80 50 40 20 10 - * + *

* 8: 5000 2500 1250 1000 625 500 313 250 200 * 156 125 100 63 50 31 25 13 6 - * + *

* 10: 4000 2000 1000 800 500 400 250 200 160 * 125 100 80 50 40 25 20 10 5 - * + *

* * Example: * gpioSetPWMfrequency(23, 0); // Set GPIO23 to lowest frequency. @@ -534,11 +534,11 @@ public int gpioSetPWMfrequency(int pin, int frequency) { * {@inheritDoc} * * Returns the frequency (in hertz) used for the GPIO - * + *

* For normal PWM the frequency will be that defined for the GPIO by gpioSetPWMfrequency. * If a hardware clock is active on the GPIO the reported frequency will be that set by gpioHardwareClock. * If hardware PWM is active on the GPIO the reported frequency will be that set by gpioHardwarePWM. - * + *

* Example: * f = gpioGetPWMfrequency(23); // Get frequency used for GPIO23. * @see PIGPIO::gpioGetPWMfrequency @@ -559,28 +559,28 @@ public int gpioGetPWMfrequency(int pin) { * * Starts hardware PWM on a GPIO at the specified frequency and duty-cycle. * Frequencies above 30MHz are unlikely to work. - * + *

* NOTE: Any waveform started by gpioWaveTxSend, or gpioWaveChain will be cancelled. - * + *

* This function is only valid if the pigpio main clock is PCM. * The main clock defaults to PCM but may be overridden by a call to gpioCfgClock. - * + *

* The same PWM channel is available on multiple GPIO. The latest frequency and duty-cycle * setting will be used by all GPIO which share a PWM channel. - * + *

* The GPIO must be one of the following. - * + *

* 12 PWM channel 0 All models but A and B * 13 PWM channel 1 All models but A and B * 18 PWM channel 0 All models * 19 PWM channel 1 All models but A and B - * + *

* 40 PWM channel 0 Compute module only * 41 PWM channel 1 Compute module only * 45 PWM channel 1 Compute module only * 52 PWM channel 0 Compute module only * 53 PWM channel 1 Compute module only - * + *

* * The actual number of steps between off and fully on is the integral part of * 250M/PWMfreq (375M/PWMfreq for the BCM2711). @@ -634,35 +634,35 @@ public void call(int pin, int state, long tick) { * {@inheritDoc} * * Starts servo pulses on the GPIO, 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise). - * + *

* The range supported by servos varies and should probably be determined by experiment. A value * of 1500 should always be safe and represents the mid-point of rotation. You can DAMAGE a servo * if you command it to move beyond its limits. - * + *

* The following causes an on pulse of 1500 microseconds duration to be transmitted on GPIO 17 at * a rate of 50 times per second. This will command a servo connected to GPIO 17 to rotate to its * mid-point. - * + *

* Example: * - gpioServo(17, 1000); // Move servo to safe position anti-clockwise. * - gpioServo(23, 1500); // Move servo to centre position. * - gpioServo(25, 2000); // Move servo to safe position clockwise. - * + *

* OTHER UPDATE RATES: * This function updates servos at 50Hz. If you wish to use a different * update frequency you will have to use the PWM functions. - * + *

* PWM Hz 50 100 200 400 500 * 1E6/Hz 20000 10000 5000 2500 2000 - * + *

* Firstly set the desired PWM frequency using gpioSetPWMfrequency. * Then set the PWM range using gpioSetPWMrange to 1E6/frequency. Doing this * allows you to use units of microseconds when setting the servo pulsewidth. - * + *

* E.g. If you want to update a servo connected to GPIO25 at 400Hz* * - gpioSetPWMfrequency(25, 400); * - gpioSetPWMrange(25, 2500); - * + *

* Thereafter use the PWM command to move the servo, e.g. gpioPWM(25, 1500) will set a 1500 us pulse. * @see PIGPIO::gpioServo */ @@ -747,17 +747,17 @@ public int gpioDelayMilliseconds(int millis){ * * Returns the current system tick. * Tick is the number of microseconds since system boot. - * + *

* As tick is an unsigned 32 bit quantity it wraps around after 2^32 microseconds, which is * approximately 1 hour 12 minutes. You don't need to worry about the wrap around as long as you * take a tick (uint32_t) from another tick, i.e. the following code will always provide the * correct difference. - * + *

* Example * uint32_t startTick, endTick; * int diffTick; * startTick = gpioTick(); - * + *

* // do some processing * endTick = gpioTick(); * diffTick = endTick - startTick; @@ -786,7 +786,7 @@ public long gpioTick() { * This returns a handle for the device at the address on the I2C bus. * Physically buses 0 and 1 are available on the Pi. * Higher numbered buses will be available if a kernel supported bus multiplexor is being used. - * + *

* The GPIO used are given in the following table. * SDA SCL * I2C0 0 1 @@ -1033,7 +1033,7 @@ public int i2cReadBlockData(int handle, int register, byte[] buffer, int offset, * * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. */ @@ -1057,7 +1057,7 @@ public int i2cBlockProcessCall(int handle, int register, byte[] data, int offset * * This writes data bytes to the specified register of the device associated with handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @see PIGPIO::i2cBlockProcessCall @@ -1361,39 +1361,39 @@ public int serDrain(int handle){ * This function opens a SPI device channel at a specified baud rate and with specified flags. * Data will be transferred at baud bits per second. * The flags may be used to modify the default behaviour of 4-wire operation, mode 0, active low chip select. - * + *

* The Pi has two SPI peripherals: main and auxiliary. * The main SPI has two chip selects (channels), the auxiliary has three. * The auxiliary SPI is available on all models but the A and B. - * + *

* The GPIO pins used are given in the following table. - * + *

* MISO MOSI SCLK CE0 CE1 CE2 * ------------------------------------- * Main SPI 9 10 11 8 7 - * Aux SPI 19 20 21 18 17 16 - * + *

* * spiChan : 0-1 (0-2 for the auxiliary SPI) * baud : 32K-125M (values above 30M are unlikely to work) * spiFlags : see below - * + *

* spiFlags consists of the least significant 22 bits. * ----------------------------------------------------------------- * 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * b b b b b b R T n n n n W A u2 u1 u0 p2 p1 p0 m m * ----------------------------------------------------------------- - * + *

* [mm] defines the SPI mode. * (Warning: modes 1 and 3 do not appear to work on the auxiliary SPI.) - * + *

* Mode POL PHA * ------------- * 0 0 0 * 1 0 1 * 2 1 0 * 3 1 1 - * + *

* [px] is 0 if CEx is active low (default) and 1 for active high. * [ux] is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise. * [A] is 0 for the main SPI, 1 for the auxiliary SPI. @@ -1402,12 +1402,12 @@ public int serDrain(int handle){ * [T] is 1 if the least significant bit is transmitted on MOSI first, the default (0) shifts the most significant bit out first. Auxiliary SPI only. * [R] is 1 if the least significant bit is received on MISO first, the default (0) receives the most significant bit first. Auxiliary SPI only. * [bbbbbb] defines the word size in bits (0-32). The default (0) sets 8 bits per word. Auxiliary SPI only. - * + *

* The spiRead, spiWrite, and spiXfer functions transfer data packed into 1, 2, or 4 bytes according to the word size in bits. * - For bits 1-8 there will be one byte per word. * - For bits 9-16 there will be two bytes per word. * - For bits 17-32 there will be four bytes per word. - * + *

* Multi-byte transfers are made in least significant byte first order. * E.g. to transfer 32 11-bit words buf should contain 64 bytes and count should be 64. * E.g. to transfer the 14 bit value 0x1ABC send the bytes 0xBC followed by 0x1A. diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketBase.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketBase.java index ff0ec5d0..50a4a160 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketBase.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketBase.java @@ -62,7 +62,7 @@ public abstract class PiGpioSocketBase extends PiGpioBase implements PiGpio { /** * ALTERNATE CONSTRUCTOR - * + *

* Connects to a user specified socket hostname/ip address and port. * * @param host hostname or IP address of the RaspberryPi to connect to via TCP/IP socket. @@ -81,7 +81,7 @@ protected PiGpioSocketBase(String host, int port) { * * Initializes the library. * (The Java implementation of this function does not return a value) - * + *

* gpioInitialise must be called before using the other library functions with the following exceptions: * - gpioCfg* * - gpioVersion @@ -120,7 +120,7 @@ public int gpioInitialise() { * {@inheritDoc} * * Shutdown the library. - * + *

* Returns nothing. * Call before program exit. * This function resets the used DMA channels, releases memory, and terminates any running threads. diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketImpl.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketImpl.java index fbb61ab1..eb45a3d1 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketImpl.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/impl/PiGpioSocketImpl.java @@ -94,7 +94,7 @@ public static PiGpio newInstance() { /** * DEFAULT PRIVATE CONSTRUCTOR - * + *

* Connects to a user specified socket hostname/ip address and port. * * @param host hostname or IP address of the RaspberryPi to connect to via TCP/IP socket. @@ -124,16 +124,16 @@ public int gpioVersion() { * {@inheritDoc} * * Returns the hardware revision. - * + *

* If the hardware revision can not be found or is not a valid hexadecimal number the function returns 0. * The hardware revision is the last few characters on the Revision line of /proc/cpuinfo. * The revision number can be used to determine the assignment of GPIO to pins (see gpio). - * + *

* There are at least three types of board. * - Type 1 boards have hardware revision numbers of 2 and 3. * - Type 2 boards have hardware revision numbers of 4, 5, 6, and 15. * - Type 3 boards have hardware revision numbers of 16 or greater. - * + *

* for "Revision : 0002" the function returns 2. * for "Revision : 000f" the function returns 15. * for "Revision : 000g" the function returns 0. @@ -194,7 +194,7 @@ public PiGpioMode gpioGetMode(int pin) { * {@inheritDoc} * * Sets the GPIO mode, typically input or output. - * + *

* gpio: 0-53 * mode: 0-7 * @see PIGPIO::gpioSetMode @@ -247,17 +247,17 @@ public void gpioWrite(int pin, PiGpioState state) { * {@inheritDoc} * * Sets a glitch filter on a GPIO. (AKA Debounce) - * + *

* Level changes on the GPIO are not reported unless the level has been stable for at * least 'steady' microseconds. The level is then reported. Level changes of less * than 'steady' microseconds are ignored. - * + *

* This filter affects the GPIO samples returned to callbacks set up with: * - gpioSetAlertFunc * - gpioSetAlertFuncEx * - gpioSetGetSamplesFunc * - gpioSetGetSamplesFuncEx. - * + *

* It does not affect interrupts set up with gpioSetISRFunc, gpioSetISRFuncEx, or * levels read by gpioRead, gpioRead_Bits_0_31, or gpioRead_Bits_32_53. * Each (stable) edge will be timestamped steady microseconds after it was first detected. @@ -277,11 +277,11 @@ public void gpioGlitchFilter(int pin, int steady) { * {@inheritDoc} * * Sets a noise filter on a GPIO. - * + *

* Level changes on the GPIO are ignored until a level which has been stable for 'steady' * microseconds is detected. Level changes on the GPIO are then reported for 'active' * microseconds after which the process repeats. - * + *

* This filter affects the GPIO samples returned to callbacks set up with: * - gpioSetAlertFunc * - gpioSetAlertFuncEx @@ -289,7 +289,7 @@ public void gpioGlitchFilter(int pin, int steady) { * - gpioSetGetSamplesFuncEx. * * It does not affect interrupts set up with gpioSetISRFunc, gpioSetISRFuncEx, or * levels read by gpioRead, gpioRead_Bits_0_31, or gpioRead_Bits_32_53. - * + *

* Level changes before and after the active period may be reported. * Your software must be designed to cope with such reports. * @see PIGPIO::gpioGlitchFilter @@ -315,7 +315,7 @@ public void gpioNoiseFilter(int pin, int steady, int active){ * {@inheritDoc} * * Starts PWM on the GPIO, dutycycle between 0 (off) and range (fully on). Range defaults to 255. - * + *

* This and the servo functionality use the DMA and PWM or PCM peripherals to control and schedule * the pulse lengths and duty cycles. * @see PIGPIO::gpioPWM @@ -335,11 +335,11 @@ public void gpioPWM(int pin, int dutyCycle) { * {@inheritDoc} * * Returns the PWM dutycycle setting for the GPIO. - * + *

* For normal PWM the dutycycle will be out of the defined range for the GPIO (see gpioGetPWMrange). * If a hardware clock is active on the GPIO the reported dutycycle will be 500000 (500k) out of 1000000 (1M). * If hardware PWM is active on the GPIO the reported dutycycle will be out of a 1000000 (1M). - * + *

* Normal PWM range defaults to 255. * @see PIGPIO::gpioGetPWMdutycycle */ @@ -361,10 +361,10 @@ public int gpioGetPWMdutycycle(int pin) { * Selects the dutycycle range to be used for the GPIO. Subsequent calls to gpioPWM will use a dutycycle * between 0 (off) and range (fully on. If PWM is currently active on the GPIO its dutycycle will be * scaled to reflect the new range. - * + *

* The real range, the number of steps between fully off and fully on for each frequency, * is given in the following table. - * + *

* ------------------------------------------------------- * #1 #2 #3 #4 #5 #6 #7 #8 #9 * 25, 50, 100, 125, 200, 250, 400, 500, 625, @@ -372,9 +372,9 @@ public int gpioGetPWMdutycycle(int pin) { * #10 #11 #12 #13 #14 #15 #16 #17 #18 * 800, 1000, 1250, 2000, 2500, 4000, 5000, 10000, 20000 * ------------------------------------------------------- - * + *

* The real value set by gpioPWM is (dutycycle * real range) / range. - * + *

* Example * gpioSetPWMrange(24, 2000); // Now 2000 is fully on * // 1000 is half on @@ -438,34 +438,34 @@ public int gpioGetPWMrealRange(int pin) { * {@inheritDoc} * * Sets the frequency in hertz to be used for the GPIO. - * + *

* If PWM is currently active on the GPIO it will be switched off and then back on at the new frequency. * Each GPIO can be independently set to one of 18 different PWM frequencies. * The selectable frequencies depend upon the sample rate which may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). - * + *

* The frequencies for each sample rate are: - * + *

* Hertz - * + *

* 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600 * 1250 1000 800 500 400 250 200 100 50 - * + *

* 2: 20000 10000 5000 4000 2500 2000 1250 1000 800 * 625 500 400 250 200 125 100 50 25 - * + *

* 4: 10000 5000 2500 2000 1250 1000 625 500 400 * 313 250 200 125 100 63 50 25 13 * sample * rate * (us) 5: 8000 4000 2000 1600 1000 800 500 400 320 * 250 200 160 100 80 50 40 20 10 - * + *

* 8: 5000 2500 1250 1000 625 500 313 250 200 * 156 125 100 63 50 31 25 13 6 - * + *

* 10: 4000 2000 1000 800 500 400 250 200 160 * 125 100 80 50 40 25 20 10 5 - * + *

* * Example: * gpioSetPWMfrequency(23, 0); // Set GPIO23 to lowest frequency. @@ -490,11 +490,11 @@ public int gpioSetPWMfrequency(int pin, int frequency) { * {@inheritDoc} * * Returns the frequency (in hertz) used for the GPIO - * + *

* For normal PWM the frequency will be that defined for the GPIO by gpioSetPWMfrequency. * If a hardware clock is active on the GPIO the reported frequency will be that set by gpioHardwareClock. * If hardware PWM is active on the GPIO the reported frequency will be that set by gpioHardwarePWM. - * + *

* Example: * f = gpioGetPWMfrequency(23); // Get frequency used for GPIO23. * @see PIGPIO::gpioGetPWMfrequency @@ -516,28 +516,28 @@ public int gpioGetPWMfrequency(int pin) { * * Starts hardware PWM on a GPIO at the specified frequency and duty-cycle. * Frequencies above 30MHz are unlikely to work. - * + *

* NOTE: Any waveform started by gpioWaveTxSend, or gpioWaveChain will be cancelled. - * + *

* This function is only valid if the pigpio main clock is PCM. * The main clock defaults to PCM but may be overridden by a call to gpioCfgClock. - * + *

* The same PWM channel is available on multiple GPIO. The latest frequency and duty-cycle * setting will be used by all GPIO which share a PWM channel. - * + *

* The GPIO must be one of the following. - * + *

* 12 PWM channel 0 All models but A and B * 13 PWM channel 1 All models but A and B * 18 PWM channel 0 All models * 19 PWM channel 1 All models but A and B - * + *

* 40 PWM channel 0 Compute module only * 41 PWM channel 1 Compute module only * 45 PWM channel 1 Compute module only * 52 PWM channel 0 Compute module only * 53 PWM channel 1 Compute module only - * + *

* * The actual number of steps between off and fully on is the integral part of * 250M/PWMfreq (375M/PWMfreq for the BCM2711). @@ -568,35 +568,35 @@ public void gpioHardwarePWM(int pin, int frequency, int dutyCycle) { * {@inheritDoc} * * Starts servo pulses on the GPIO, 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise). - * + *

* The range supported by servos varies and should probably be determined by experiment. A value * of 1500 should always be safe and represents the mid-point of rotation. You can DAMAGE a servo * if you command it to move beyond its limits. - * + *

* The following causes an on pulse of 1500 microseconds duration to be transmitted on GPIO 17 at * a rate of 50 times per second. This will command a servo connected to GPIO 17 to rotate to its * mid-point. - * + *

* Example: * - gpioServo(17, 1000); // Move servo to safe position anti-clockwise. * - gpioServo(23, 1500); // Move servo to centre position. * - gpioServo(25, 2000); // Move servo to safe position clockwise. - * + *

* OTHER UPDATE RATES: * This function updates servos at 50Hz. If you wish to use a different * update frequency you will have to use the PWM functions. - * + *

* PWM Hz 50 100 200 400 500 * 1E6/Hz 20000 10000 5000 2500 2000 - * + *

* Firstly set the desired PWM frequency using gpioSetPWMfrequency. * Then set the PWM range using gpioSetPWMrange to 1E6/frequency. Doing this * allows you to use units of microseconds when setting the servo pulsewidth. - * + *

* E.g. If you want to update a servo connected to GPIO25 at 400Hz* * - gpioSetPWMfrequency(25, 400); * - gpioSetPWMrange(25, 2500); - * + *

* Thereafter use the PWM command to move the servo, e.g. gpioPWM(25, 1500) will set a 1500 us pulse. * @see PIGPIO::gpioServo */ @@ -677,17 +677,17 @@ public int gpioDelayMilliseconds(int millis){ * * Returns the current system tick. * Tick is the number of microseconds since system boot. - * + *

* As tick is an unsigned 32 bit quantity it wraps around after 2^32 microseconds, which is * approximately 1 hour 12 minutes. You don't need to worry about the wrap around as long as you * take a tick (uint32_t) from another tick, i.e. the following code will always provide the * correct difference. - * + *

* Example * uint32_t startTick, endTick; * int diffTick; * startTick = gpioTick(); - * + *

* // do some processing * endTick = gpioTick(); * diffTick = endTick - startTick; @@ -718,7 +718,7 @@ public long gpioTick() { * This returns a handle for the device at the address on the I2C bus. * Physically buses 0 and 1 are available on the Pi. * Higher numbered buses will be available if a kernel supported bus multiplexor is being used. - * + *

* The GPIO used are given in the following table. * SDA SCL * I2C0 0 1 @@ -969,7 +969,7 @@ public int i2cReadBlockData(int handle, int register, byte[] buffer, int offset, * * This writes data bytes to the specified register of the device associated with handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. * @see PIGPIO::i2cBlockProcessCall @@ -1009,7 +1009,7 @@ public int i2cBlockProcessCall(int handle, int register, * * This writes data bytes to the specified register of the device associated with the handle and reads a * device specified number of bytes of data in return. - * + *

* The SMBus 2.0 documentation states that a minimum of 1 byte may be sent and a minimum of 1 byte may be received. * The total number of bytes sent/received must be 32 or less. */ @@ -1309,39 +1309,39 @@ public int serDrain(int handle){ * This function opens a SPI device channel at a specified baud rate and with specified flags. * Data will be transferred at baud bits per second. * The flags may be used to modify the default behaviour of 4-wire operation, mode 0, active low chip select. - * + *

* The Pi has two SPI peripherals: main and auxiliary. * The main SPI has two chip selects (channels), the auxiliary has three. * The auxiliary SPI is available on all models but the A and B. - * + *

* The GPIO pins used are given in the following table. - * + *

* MISO MOSI SCLK CE0 CE1 CE2 * ------------------------------------- * Main SPI 9 10 11 8 7 - * Aux SPI 19 20 21 18 17 16 - * + *

* * spiChan : 0-1 (0-2 for the auxiliary SPI) * baud : 32K-125M (values above 30M are unlikely to work) * spiFlags : see below - * + *

* spiFlags consists of the least significant 22 bits. * ----------------------------------------------------------------- * 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * b b b b b b R T n n n n W A u2 u1 u0 p2 p1 p0 m m * ----------------------------------------------------------------- - * + *

* [mm] defines the SPI mode. * (Warning: modes 1 and 3 do not appear to work on the auxiliary SPI.) - * + *

* Mode POL PHA * ------------- * 0 0 0 * 1 0 1 * 2 1 0 * 3 1 1 - * + *

* [px] is 0 if CEx is active low (default) and 1 for active high. * [ux] is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise. * [A] is 0 for the main SPI, 1 for the auxiliary SPI. @@ -1350,12 +1350,12 @@ public int serDrain(int handle){ * [T] is 1 if the least significant bit is transmitted on MOSI first, the default (0) shifts the most significant bit out first. Auxiliary SPI only. * [R] is 1 if the least significant bit is received on MISO first, the default (0) receives the most significant bit first. Auxiliary SPI only. * [bbbbbb] defines the word size in bits (0-32). The default (0) sets 8 bits per word. Auxiliary SPI only. - * + *

* The spiRead, spiWrite, and spiXfer functions transfer data packed into 1, 2, or 4 bytes according to the word size in bits. * - For bits 1-8 there will be one byte per word. * - For bits 9-16 there will be two bytes per word. * - For bits 17-32 there will be four bytes per word. - * + *

* Multi-byte transfers are made in least significant byte first order. * E.g. to transfer 32 11-bit words buf should contain 64 bytes and count should be 64. * E.g. to transfer the 14 bit value 0x1ABC send the bytes 0xBC followed by 0x1A. diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlert.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlert.java index 7cce5cbc..3f907aad 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlert.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlert.java @@ -49,6 +49,7 @@ public class TestGpioAlert { *

main.

* * @param args an array of {@link String} objects. + * @throws IOException */ public static void main(String[] args) throws IOException { String loglevel = "INFO"; diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlertRaw.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlertRaw.java index a9c5c41e..e47a57e2 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlertRaw.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioAlertRaw.java @@ -52,6 +52,7 @@ public class TestGpioAlertRaw { *

main.

* * @param args an array of {@link String} objects. + * @throws IOException */ public static void main(String[] args) throws IOException { String loglevel = "INFO"; diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioIsrRaw.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioIsrRaw.java index dd122e76..75df3781 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioIsrRaw.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestGpioIsrRaw.java @@ -52,6 +52,7 @@ public class TestGpioIsrRaw { *

main.

* * @param args an array of {@link String} objects. + * @throws IOException */ public static void main(String[] args) throws IOException { String loglevel = "INFO"; diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestPwmHardware.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestPwmHardware.java index 369f1a8a..ace82337 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestPwmHardware.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestPwmHardware.java @@ -50,6 +50,7 @@ public class TestPwmHardware { *

main.

* * @param args an array of {@link String} objects. + * @throws IOException */ public static void main(String[] args) throws IOException { String loglevel = "INFO"; diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestSerialRaw.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestSerialRaw.java index ef011a94..62347d0b 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestSerialRaw.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/test/TestSerialRaw.java @@ -51,6 +51,7 @@ public class TestSerialRaw { *

main.

* * @param args an array of {@link String} objects. + * @throws InterruptedException */ public static void main(String[] args) throws InterruptedException { logger.info("PIGPIO VERSION : {}", PIGPIO.gpioVersion()); diff --git a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/util/NativeLibraryLoader.java b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/util/NativeLibraryLoader.java index 89f5ea2a..727a262d 100644 --- a/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/util/NativeLibraryLoader.java +++ b/libraries/pi4j-library-pigpio/src/main/java/com/pi4j/library/pigpio/util/NativeLibraryLoader.java @@ -215,7 +215,7 @@ else if (libpath.equalsIgnoreCase("local")) { /** * Loads library from classpath - * + *

* The file from classpath is copied into system temporary directory and then loaded. The temporary file is * deleted after exiting. Method uses String as filename because the pathname is * "abstract", not system-dependent. diff --git a/libraries/pi4j-library/pom.xml b/libraries/pi4j-library/pom.xml index 1924323f..0d204156 100644 --- a/libraries/pi4j-library/pom.xml +++ b/libraries/pi4j-library/pom.xml @@ -5,14 +5,14 @@ pi4j-parent com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../../pom.xml 4.0.0 pi4j-library - Pi4J :: LIBRARY :: Libraries Parent POM + Pi4J :: LIBRARY :: Libraries Parent POM Pi4J Plugin Parent Maven POM pom diff --git a/pi4j-core/pom.xml b/pi4j-core/pom.xml index 5541399e..2a8eab5b 100644 --- a/pi4j-core/pom.xml +++ b/pi4j-core/pom.xml @@ -4,14 +4,14 @@ pi4j-core - Pi4J :: LIBRARY :: Java Library (CORE) + Pi4J :: LIBRARY :: Java Library (CORE) Pi4J Java API & Runtime Library jar com.pi4j pi4j-parent - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pom.xml @@ -137,14 +137,15 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> - + diff --git a/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/BoardModel.java b/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/BoardModel.java index 435edc8a..85e2d217 100644 --- a/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/BoardModel.java +++ b/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/BoardModel.java @@ -6,7 +6,6 @@ import java.time.LocalDate; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -17,158 +16,159 @@ * *

*/ public enum BoardModel { MODEL_1_A("Raspberry Pi 1 Model A", SINGLE_BOARD_COMPUTER, - new ArrayList<>(), + List.of("0007", "0008", "0009"), PiModel.MODEL_A, HeaderVersion.TYPE_1, LocalDate.of(2013, 2, 1), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(700), - Collections.singletonList(256 * 1024)), + List.of(700), + List.of(256 * 1024)), MODEL_1_A_PLUS("Raspberry Pi 1 Model A+", SINGLE_BOARD_COMPUTER, - Collections.singletonList("900021"), + List.of("0012", "0015", "900021"), PiModel.MODEL_A, HeaderVersion.TYPE_1, LocalDate.of(2014, 11, 1), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(700), - Arrays.asList(256 * 1024, 512 * 1024), - Collections.singletonList("Amount of memory changed to 512Mb on 20160810")), + List.of(700), + List.of(256 * 1024, 512 * 1024), + List.of("Amount of memory changed to 512Mb on 20160810")), MODEL_3_A_PLUS("Raspberry Pi 3 Model A+", SINGLE_BOARD_COMPUTER, - Arrays.asList("9020e0", "9020e1"), + List.of("9020e0", "9020e1"), PiModel.MODEL_A, HeaderVersion.TYPE_3, LocalDate.of(2018, 11, 1), Soc.BCM2837B0, Cpu.CORTEX_A53, 4, - Collections.singletonList(1400), - Collections.singletonList(512 * 1024)), + List.of(1400), + List.of(512 * 1024)), MODEL_1_B("Raspberry Pi 1 Model B", SINGLE_BOARD_COMPUTER, - new ArrayList<>(), + List.of("0002", "0003", "0004", "0005", "0006", "000d", "000e", "000f"), PiModel.MODEL_B, HeaderVersion.TYPE_1, LocalDate.of(2012, 4, 1), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(700), - Arrays.asList(256 * 1024, 512 * 1024), - Collections.singletonList("Amount of memory changed to 512Mb on 20121015")), + List.of(700), + List.of(256 * 1024, 512 * 1024), + List.of("Amount of memory changed to 512Mb on 20121015")), MODEL_1_B_PLUS("Raspberry Pi 1 Model B+", SINGLE_BOARD_COMPUTER, - Collections.singletonList("900032"), + List.of("0010", "0013", "900032"), PiModel.MODEL_B, HeaderVersion.TYPE_1, LocalDate.of(2014, 7, 1), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(700), - Collections.singletonList(512 * 1024)), + List.of(700), + List.of(512 * 1024)), MODEL_2_B("Raspberry Pi 2 Model B", SINGLE_BOARD_COMPUTER, - Arrays.asList("a01040", "a01041", "a21041"), + List.of("a01040", "a01041", "a21041"), PiModel.MODEL_B, HeaderVersion.TYPE_2, LocalDate.of(2015, 2, 1), Soc.BCM2836, Cpu.CORTEX_A7, 4, - Collections.singletonList(900), - Collections.singletonList(1024 * 1024)), + List.of(900), + List.of(1024 * 1024)), MODEL_2_B_V1_2("Raspberry Pi 2 Model B V1.2", SINGLE_BOARD_COMPUTER, - Arrays.asList("a02042", "a22042"), + List.of("a02042", "a22042"), PiModel.MODEL_B, HeaderVersion.TYPE_2, LocalDate.of(2016, 10, 1), Soc.BCM2837, Cpu.CORTEX_A53, 4, - Collections.singletonList(900), - Collections.singletonList(1024 * 1024)), + List.of(900), + List.of(1024 * 1024)), MODEL_3_B("Raspberry Pi 3 Model B", SINGLE_BOARD_COMPUTER, - Arrays.asList("a02082", "a22082", "a32082", "a52082", "a22083"), + List.of("a02082", "a22082", "a32082", "a52082", "a22083"), PiModel.MODEL_B, HeaderVersion.TYPE_3, LocalDate.of(2016, 2, 1), Soc.BCM2837, Cpu.CORTEX_A53, 4, - Collections.singletonList(1200), - Collections.singletonList(1024 * 1024)), + List.of(1200), + List.of(1024 * 1024)), MODEL_3_B_PLUS("Raspberry Pi 3 Model B+", SINGLE_BOARD_COMPUTER, - Arrays.asList("a020d3", "a020d4"), + List.of("a020d3", "a020d4"), PiModel.MODEL_B, HeaderVersion.TYPE_3, LocalDate.of(2018, 3, 14), Soc.BCM2837B0, Cpu.CORTEX_A53, 4, - Collections.singletonList(1400), - Collections.singletonList(1024 * 1024)), + List.of(1400), + List.of(1024 * 1024)), MODEL_4_B("Raspberry Pi 4 Model B", SINGLE_BOARD_COMPUTER, - Arrays.asList("a03111", "b03111", "b03112", "b03114", "b03115", "c03111", "c03112", "c03114", "c03115", "d03114", "d03115"), + List.of("a03111", "b03111", "b03112", "b03114", "b03115", "c03111", "c03112", "c03114", "c03115", "d03114", "d03115"), PiModel.MODEL_B, HeaderVersion.TYPE_3, LocalDate.of(2019, 6, 24), Soc.BCM2711, Cpu.CORTEX_A72, 4, - Arrays.asList(1500, 1800), - Arrays.asList(1024 * 1024, 2048 * 1024, 4096 * 1024, 8192 * 1024)), + List.of(1500, 1800), + List.of(1024 * 1024, 2048 * 1024, 4096 * 1024, 8192 * 1024)), MODEL_400("Raspberry Pi 400", ALL_IN_ONE_COMPUTER, - Collections.singletonList("c03130"), + List.of("c03130"), PiModel.MODEL_B, HeaderVersion.TYPE_3, LocalDate.of(2020, 11, 2), Soc.BCM2711C0, Cpu.CORTEX_A72, 4, - Collections.singletonList(1800), - Collections.singletonList(4096 * 1024)), + List.of(1800), + List.of(4096 * 1024)), MODEL_5_B("Raspberry Pi 5 Model B", SINGLE_BOARD_COMPUTER, - Arrays.asList("b04170", "c04170", "d04170"), + List.of("b04170", "c04170", "d04170"), PiModel.MODEL_B, HeaderVersion.TYPE_3, LocalDate.of(2023, 9, 28), Soc.BCM2712, Cpu.CORTEX_A76, 4, - Collections.singletonList(2400), - Arrays.asList(2048 * 1024, 4096 * 1024, 8192 * 1024)), + List.of(2400), + List.of(2048 * 1024, 4096 * 1024, 8192 * 1024)), COMPUTE_1("Compute Module 1", STACK_ON_COMPUTER, - Collections.singletonList("900061"), + List.of("0011", "0014", "900061"), PiModel.COMPUTE, HeaderVersion.COMPUTE, LocalDate.of(2014, 4, 1), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(700), - Collections.singletonList(512 * 1024)), + List.of(700), + List.of(512 * 1024)), COMPUTE_3("Compute Module 3", STACK_ON_COMPUTER, - Arrays.asList("a020a0", "a220a0"), + List.of("a020a0", "a220a0"), PiModel.COMPUTE, HeaderVersion.COMPUTE, LocalDate.of(2017, 1, 1), Soc.BCM2837, Cpu.CORTEX_A53, 4, - Collections.singletonList(1200), - Collections.singletonList(1024 * 1024)), + List.of(1200), + List.of(1024 * 1024)), COMPUTE_3_PLUS("Compute Module 3+", STACK_ON_COMPUTER, - Collections.singletonList("a02100"), + List.of("a02100"), PiModel.COMPUTE, HeaderVersion.COMPUTE, LocalDate.of(2019, 1, 1), Soc.BCM2837B0, Cpu.CORTEX_A53, 4, - Collections.singletonList(1200), - Collections.singletonList(1024 * 1024)), + List.of(1200), + List.of(1024 * 1024)), COMPUTE_4("Compute Module 4", STACK_ON_COMPUTER, - Arrays.asList("a03140", "b03140", "c03140", "d03140", "a03141", "b03141", "c03141", "d03141"), + List.of("a03140", "b03140", "c03140", "d03140", "a03141", "b03141", "c03141", "d03141"), PiModel.COMPUTE, HeaderVersion.COMPUTE, LocalDate.of(2020, 10, 1), Soc.BCM2711, Cpu.CORTEX_A72, 4, - Collections.singletonList(1500), - Arrays.asList(1024 * 1024, 2048 * 1024, 4096 * 1024, 8192 * 1024)), + List.of(1500), + List.of(1024 * 1024, 2048 * 1024, 4096 * 1024, 8192 * 1024)), // https://datasheets.raspberrypi.com/cm4s/cm4s-datasheet.pdf COMPUTE_4_SODIMM("Compute Module 4 SODIMM", STACK_ON_COMPUTER, new ArrayList<>(), // Not known yet @@ -177,44 +177,44 @@ public enum BoardModel { LocalDate.of(2020, 10, 1), Soc.BCM2711, Cpu.CORTEX_A72, 4, - Collections.singletonList(1500), - Arrays.asList(1024 * 1024, 2048 * 1024, 4096 * 1024, 8192 * 1024)), + List.of(1500), + List.of(1024 * 1024, 2048 * 1024, 4096 * 1024, 8192 * 1024)), ZERO_PCB_1_2("Raspberry Pi Zero PCB V1.2", SINGLE_BOARD_COMPUTER, - Arrays.asList("900092", "920092"), + List.of("900092", "920092"), PiModel.ZERO, HeaderVersion.TYPE_3, LocalDate.of(2015, 11, 1), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(1000), - Collections.singletonList(512 * 1024)), + List.of(1000), + List.of(512 * 1024)), ZERO_PCB_1_3("Raspberry Pi Zero PCB V1.3", SINGLE_BOARD_COMPUTER, - Arrays.asList("900093", "920093"), + List.of("900093", "920093"), PiModel.ZERO, HeaderVersion.TYPE_3, LocalDate.of(2016, 5, 1), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(1000), - Collections.singletonList(512 * 1024)), + List.of(1000), + List.of(512 * 1024)), ZERO_W("Raspberry Pi Zero W", SINGLE_BOARD_COMPUTER, - Collections.singletonList("9000c1"), + List.of("9000c1"), PiModel.ZERO, HeaderVersion.TYPE_3, LocalDate.of(2017, 2, 28), Soc.BCM2835, Cpu.ARM1176JZF_S, 1, - Collections.singletonList(1000), - Collections.singletonList(512 * 1024)), + List.of(1000), + List.of(512 * 1024)), ZERO_V2("Raspberry Pi Zero V2", SINGLE_BOARD_COMPUTER, - Collections.singletonList("902120"), + List.of("902120"), PiModel.ZERO, HeaderVersion.TYPE_3, LocalDate.of(2021, 10, 28), Soc.BCM2710A1, Cpu.CORTEX_A53, 4, - Collections.singletonList(1000), - Collections.singletonList(512 * 1024)), + List.of(1000), + List.of(512 * 1024)), PICO("Raspberry Pi Pico", MICROCONTROLLER, new ArrayList<>(), PiModel.PICO, @@ -222,8 +222,8 @@ public enum BoardModel { LocalDate.of(2021, 1, 1), Soc.RP2040, Cpu.CORTEX_MO_PLUS, 1, - Collections.singletonList(133), - Collections.singletonList(264 + 2048)), + List.of(133), + List.of(264 + 2048)), PICO_W("Raspberry Pi Pico W", MICROCONTROLLER, new ArrayList<>(), PiModel.PICO, @@ -231,9 +231,9 @@ public enum BoardModel { LocalDate.of(2022, 6, 1), Soc.RP2040, Cpu.CORTEX_MO_PLUS, 1, - Collections.singletonList(133), - Collections.singletonList(264 + 2048), - Collections.singletonList("Same form factor as PICO but with Wi-Fi")), + List.of(133), + List.of(264 + 2048), + List.of("Same form factor as PICO but with Wi-Fi")), PICO_2("Raspberry Pi Pico 2", MICROCONTROLLER, new ArrayList<>(), PiModel.PICO, @@ -241,8 +241,8 @@ public enum BoardModel { LocalDate.of(2024, 8, 8), Soc.RP2350, Cpu.CORTEX_M33, 1, - Collections.singletonList(150), - Collections.singletonList(520 + 4096)), + List.of(150), + List.of(520 + 4096)), PICO_2_W("Raspberry Pi Pico 2 W", MICROCONTROLLER, new ArrayList<>(), PiModel.PICO, @@ -250,8 +250,8 @@ public enum BoardModel { LocalDate.of(2024, 8, 8), Soc.RP2350, Cpu.CORTEX_M33, 1, - Collections.singletonList(150), - Collections.singletonList(520 + 4096)), + List.of(150), + List.of(520 + 4096)), UNKNOWN("Unknown", BoardType.UNKNOWN, new ArrayList<>(), PiModel.UNKNOWN, diff --git a/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/HeaderVersion.java b/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/HeaderVersion.java index 62dd1aab..be69884f 100644 --- a/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/HeaderVersion.java +++ b/pi4j-core/src/main/java/com/pi4j/boardinfo/definition/HeaderVersion.java @@ -1,16 +1,14 @@ package com.pi4j.boardinfo.definition; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; import java.util.List; public enum HeaderVersion { PICO("Pico", "Used on the Pico microcontroller", new ArrayList<>()), - TYPE_1("Type 1", "Used on original Model B", Collections.singletonList(HeaderPins.HEADER_26_TYPE_1)), - TYPE_2("Type 2", "Used on Model A and Model B (revision 2)", Arrays.asList(HeaderPins.HEADER_26_TYPE_2, HeaderPins.HEADER_8)), - TYPE_3("Type 3", "Used on Model A+, B+, Pi Zero, Pi Zero W, Pi2B, Pi3B, Pi4B, Pi5B", Collections.singletonList(HeaderPins.HEADER_40)), - COMPUTE("Compute Module", "54 GPIO", Arrays.asList(HeaderPins.COMPUTE_J5, HeaderPins.COMPUTE_J6)), + TYPE_1("Type 1", "Used on original Model B", List.of(HeaderPins.HEADER_26_TYPE_1)), + TYPE_2("Type 2", "Used on Model A and Model B (revision 2)", List.of(HeaderPins.HEADER_26_TYPE_2, HeaderPins.HEADER_8)), + TYPE_3("Type 3", "Used on Model A+, B+, Pi Zero, Pi Zero W, Pi2B, Pi3B, Pi4B, Pi5B", List.of(HeaderPins.HEADER_40)), + COMPUTE("Compute Module", "54 GPIO", List.of(HeaderPins.COMPUTE_J5, HeaderPins.COMPUTE_J6)), UNKNOWN("Unknown", "", new ArrayList<>()); private final String label; diff --git a/pi4j-core/src/main/java/com/pi4j/boardinfo/util/BoardInfoHelper.java b/pi4j-core/src/main/java/com/pi4j/boardinfo/util/BoardInfoHelper.java index 44cec70b..c6335c4d 100644 --- a/pi4j-core/src/main/java/com/pi4j/boardinfo/util/BoardInfoHelper.java +++ b/pi4j-core/src/main/java/com/pi4j/boardinfo/util/BoardInfoHelper.java @@ -62,7 +62,8 @@ public static BoardInfo current() { /** * Flag indicating that the board is using the RP1 chip for GPIO. - * https://www.raspberrypi.com/documentation/microcontrollers/rp1.html + * https://www.raspberrypi.com/documentation/microcontrollers/rp1.html + * @return */ public static boolean usesRP1() { return instance.boardInfo.getBoardModel() == BoardModel.MODEL_5_B; diff --git a/pi4j-core/src/main/java/com/pi4j/common/IdentityBase.java b/pi4j-core/src/main/java/com/pi4j/common/IdentityBase.java index 6f5edc56..105d0272 100644 --- a/pi4j-core/src/main/java/com/pi4j/common/IdentityBase.java +++ b/pi4j-core/src/main/java/com/pi4j/common/IdentityBase.java @@ -34,6 +34,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class IdentityBase implements Extension { diff --git a/pi4j-core/src/main/java/com/pi4j/common/Lifecycle.java b/pi4j-core/src/main/java/com/pi4j/common/Lifecycle.java index cc1951db..274cc665 100644 --- a/pi4j-core/src/main/java/com/pi4j/common/Lifecycle.java +++ b/pi4j-core/src/main/java/com/pi4j/common/Lifecycle.java @@ -34,6 +34,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface Lifecycle { /** diff --git a/pi4j-core/src/main/java/com/pi4j/config/AddressConfig.java b/pi4j-core/src/main/java/com/pi4j/config/AddressConfig.java index 53ca72bf..28f2485c 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/AddressConfig.java +++ b/pi4j-core/src/main/java/com/pi4j/config/AddressConfig.java @@ -30,6 +30,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface AddressConfig extends Config { /** Constant ADDRESS_KEY="address" */ diff --git a/pi4j-core/src/main/java/com/pi4j/config/AddressConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/config/AddressConfigBuilder.java index 70e67efa..e3851a05 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/AddressConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/config/AddressConfigBuilder.java @@ -30,6 +30,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface AddressConfigBuilder extends ConfigBuilder { /** diff --git a/pi4j-core/src/main/java/com/pi4j/config/Builder.java b/pi4j-core/src/main/java/com/pi4j/config/Builder.java index b9f23ef7..8492f995 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/Builder.java +++ b/pi4j-core/src/main/java/com/pi4j/config/Builder.java @@ -30,6 +30,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface Builder { /** diff --git a/pi4j-core/src/main/java/com/pi4j/config/Config.java b/pi4j-core/src/main/java/com/pi4j/config/Config.java index 543bf3f5..d77c327c 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/Config.java +++ b/pi4j-core/src/main/java/com/pi4j/config/Config.java @@ -32,6 +32,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface Config { /** Constant ID_KEY="id" */ diff --git a/pi4j-core/src/main/java/com/pi4j/config/ConfigBase.java b/pi4j-core/src/main/java/com/pi4j/config/ConfigBase.java index 21d6db87..fbcddc90 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/ConfigBase.java +++ b/pi4j-core/src/main/java/com/pi4j/config/ConfigBase.java @@ -37,6 +37,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public class ConfigBase implements Config { diff --git a/pi4j-core/src/main/java/com/pi4j/config/ConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/config/ConfigBuilder.java index 904efec2..98de2803 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/ConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/config/ConfigBuilder.java @@ -37,6 +37,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface ConfigBuilder extends Builder { /** diff --git a/pi4j-core/src/main/java/com/pi4j/config/DeviceConfig.java b/pi4j-core/src/main/java/com/pi4j/config/DeviceConfig.java index e2124525..8f17cfbf 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/DeviceConfig.java +++ b/pi4j-core/src/main/java/com/pi4j/config/DeviceConfig.java @@ -30,6 +30,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface DeviceConfig extends Config { diff --git a/pi4j-core/src/main/java/com/pi4j/config/DeviceConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/config/DeviceConfigBuilder.java index d6bc66f4..67b07137 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/DeviceConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/config/DeviceConfigBuilder.java @@ -30,6 +30,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface DeviceConfigBuilder extends ConfigBuilder { /** diff --git a/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBase.java b/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBase.java index abd9a23f..57887d20 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBase.java +++ b/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBase.java @@ -37,6 +37,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class AddressConfigBase extends ConfigBase diff --git a/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBuilderBase.java index f4c66ce8..df48be17 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/config/impl/AddressConfigBuilderBase.java @@ -36,6 +36,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class AddressConfigBuilderBase extends ConfigBuilderBase diff --git a/pi4j-core/src/main/java/com/pi4j/config/impl/ConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/config/impl/ConfigBuilderBase.java index d39793bf..0d796780 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/impl/ConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/config/impl/ConfigBuilderBase.java @@ -44,6 +44,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class ConfigBuilderBase implements ConfigBuilder { diff --git a/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBase.java b/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBase.java index 2a8eb43b..0ec178de 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBase.java +++ b/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBase.java @@ -37,6 +37,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class DeviceConfigBase> extends ConfigBase diff --git a/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBuilderBase.java index 8cd688fe..07d5a5f2 100644 --- a/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/config/impl/DeviceConfigBuilderBase.java @@ -36,6 +36,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class DeviceConfigBuilderBase extends ConfigBuilderBase diff --git a/pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContextBuilder.java b/pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContextBuilder.java index de43b392..fc8240c5 100644 --- a/pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContextBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContextBuilder.java @@ -87,7 +87,7 @@ public static ContextBuilder newInstance(){ @Override public ContextBuilder add(Platform... platform) { if(platform != null && platform.length > 0) - this.platforms.addAll(Arrays.asList(platform)); + this.platforms.addAll(List.of(platform)); return this; } @@ -95,7 +95,7 @@ public ContextBuilder add(Platform... platform) { @Override public ContextBuilder add(Provider... provider) { if(provider != null && provider.length > 0) - this.providers.addAll(Arrays.asList(provider)); + this.providers.addAll(List.of(provider)); return this; } diff --git a/pi4j-core/src/main/java/com/pi4j/extension/Extension.java b/pi4j-core/src/main/java/com/pi4j/extension/Extension.java index a95b4fbd..1637be0a 100644 --- a/pi4j-core/src/main/java/com/pi4j/extension/Extension.java +++ b/pi4j-core/src/main/java/com/pi4j/extension/Extension.java @@ -34,6 +34,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface Extension extends Identity, Lifecycle { diff --git a/pi4j-core/src/main/java/com/pi4j/extension/ExtensionBase.java b/pi4j-core/src/main/java/com/pi4j/extension/ExtensionBase.java index 98cf13b7..ed17692c 100644 --- a/pi4j-core/src/main/java/com/pi4j/extension/ExtensionBase.java +++ b/pi4j-core/src/main/java/com/pi4j/extension/ExtensionBase.java @@ -32,6 +32,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class ExtensionBase extends IdentityBase implements Extension { diff --git a/pi4j-core/src/main/java/com/pi4j/internal/ProviderProvider.java b/pi4j-core/src/main/java/com/pi4j/internal/ProviderProvider.java index a90de822..6a09cd7a 100644 --- a/pi4j-core/src/main/java/com/pi4j/internal/ProviderProvider.java +++ b/pi4j-core/src/main/java/com/pi4j/internal/ProviderProvider.java @@ -116,6 +116,7 @@ default T getProvider(String providerId) throws ProviderNot *

provider.

* * @param providerId a {@link java.lang.String} object. + * @param providerClass * @param a T object. * @return a T object. * @throws ProviderNotFoundException if the provider specified by {@code providerId} can not be found. diff --git a/pi4j-core/src/main/java/com/pi4j/io/IO.java b/pi4j-core/src/main/java/com/pi4j/io/IO.java index 9cf9ab76..b5a9de6d 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IO.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IO.java @@ -35,6 +35,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface IO extends Describable, Lifecycle, Identity { diff --git a/pi4j-core/src/main/java/com/pi4j/io/IOAddressConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/IOAddressConfigBuilder.java index 4ce70ed4..6171a978 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IOAddressConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IOAddressConfigBuilder.java @@ -34,6 +34,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface IOAddressConfigBuilder extends IOConfigBuilder, diff --git a/pi4j-core/src/main/java/com/pi4j/io/IOBase.java b/pi4j-core/src/main/java/com/pi4j/io/IOBase.java index e8c41c6e..32dd9499 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IOBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IOBase.java @@ -38,6 +38,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class IOBase extends IdentityBase implements IO { diff --git a/pi4j-core/src/main/java/com/pi4j/io/IOConfig.java b/pi4j-core/src/main/java/com/pi4j/io/IOConfig.java index e650dbc2..66bf8889 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IOConfig.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IOConfig.java @@ -32,6 +32,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface IOConfig extends Config { String PLATFORM_KEY = "platform"; diff --git a/pi4j-core/src/main/java/com/pi4j/io/IOConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/IOConfigBuilder.java index 858253c3..0419ae33 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IOConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IOConfigBuilder.java @@ -34,6 +34,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface IOConfigBuilder extends ConfigBuilder { BUILDER_TYPE provider(String provider); diff --git a/pi4j-core/src/main/java/com/pi4j/io/IODataReader.java b/pi4j-core/src/main/java/com/pi4j/io/IODataReader.java index 4708b9a2..34d58107 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IODataReader.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IODataReader.java @@ -39,7 +39,7 @@ * Data Writer Interface for Pi4J Data Communications * * @author Robert Savage - * + *

* Based on previous contributions from: * Daniel Sendula, * RasPelikan @@ -109,7 +109,7 @@ default int read(byte[] buffer) { /** * Read data from the I/O device into the provided byte buffer at the given * offset and up to the specified data length (number of bytes). - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -151,7 +151,7 @@ default int read(ByteBuffer buffer, int offset, int length) { /** * Read data from the I/O device into the provided byte buffer starting * with the first byte in the array up to the provided length. - * + *

* NOTE: The data bytes read from the I/O device are copied/ * inserted into the byte buffer starting at the current * position index up to the length requested or up to the @@ -181,7 +181,7 @@ default int read(ByteBuffer buffer, int length) { /** * Read data from the I/O device into the provided byte buffer starting with * the first byte in the array up to available space remaining in the buffer. - * + *

* NOTE: The data bytes read from the I/O device are copied/ * inserted into the byte buffer starting at the current * position index up to the buffer's remaining limit. If @@ -331,7 +331,7 @@ default int read(char[] buffer) { * Read character data from the I/O device into the provided character buffer at the given * offset and up to the specified data length (number of characters). Specify the character * set to be used to decode the bytes into chars. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -387,7 +387,7 @@ default int read(Charset charset, CharBuffer buffer, int offset, int length) { * Read character data from the I/O device into the provided character buffer starting * at the zero index (first position) up to the specified data length (number of characters). * Specify the character set to be used to decode the bytes into chars. - * + *

* NOTE: The data characters read and decoded from the I/O device are * copied/inserted into the character buffer starting at the current * position index up to the length requested or up to the buffer's @@ -413,7 +413,7 @@ default int read(Charset charset, CharBuffer buffer, int length) { * Read character data from the I/O device into the provided character buffer starting * at the zero index (first position) up to available space remaining in the buffer. * Specify the character set to be used to decode the bytes into chars. - * + *

* NOTE: The data characters read from the I/O device are copied/ * inserted into the character buffer starting at the current * position index up to the buffer's remaining limit. If @@ -439,7 +439,7 @@ default int read(Charset charset, CharBuffer buffer) { * Read ASCII character data from the I/O device into the provided character buffer at the given * offset and up to the specified data length (number of characters). ASCII is the internal * character set used to decode the bytes into chars. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -462,7 +462,7 @@ default int read(CharBuffer buffer, int offset, int length) { * Read ASCII character data from the I/O device into the provided character buffer starting * at the zero index (first position) up to the specified data length (number of characters). * ASCII is the internal character set used to decode the bytes into chars. - * + *

* NOTE: The data characters read and decoded from the I/O device are * copied/inserted into the character buffer starting at the current * position index up to the length requested or up to the buffer's @@ -486,7 +486,7 @@ default int read(CharBuffer buffer, int length) { * Read ASCII character data from the I/O device into the provided character buffer starting * at the zero index (first position) up to available space remaining in the buffer. * ASCII is the internal character set used to decode the bytes into chars. - * + *

* NOTE: The data characters read from the I/O device are copied/ * inserted into the character buffer starting at the current * position index up to the buffer's remaining limit. If @@ -520,7 +520,7 @@ default byte readByte() { * return the data read in a new byte array. The 'offset' parameter allows you to skip * a certain number of bytes in the read data an excludes them from the returned * data byte array. - * + *

* Note: the resulting byte array size will be at most the 'length' - 'offset'. * * @param offset the offset index in the data read to start copying read data @@ -562,7 +562,7 @@ default byte[] readNBytes(int length) { * return the data read in a new ByteBuffer. The 'offset' parameter allows you to skip * a certain number of bytes in the read data and excludes them from the returned * data ByteBuffer. - * + *

* Note: the resulting byte buffer size will be at most the 'length' - 'offset'. * * @param offset the offset index in the data read to start copying read data diff --git a/pi4j-core/src/main/java/com/pi4j/io/IODataWriter.java b/pi4j-core/src/main/java/com/pi4j/io/IODataWriter.java index 73d8ffe8..0a64251c 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IODataWriter.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IODataWriter.java @@ -41,7 +41,7 @@ * Data Writer Interface for Pi4J Data Communications * * @author Robert Savage - * + *

* Based on previous contributions from: * Daniel Sendula, * RasPelikan @@ -148,7 +148,7 @@ default int write(Collection data) { /** * Write a buffer of byte values with given offset (starting position) and length in the provided data buffer. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -172,7 +172,7 @@ default int write(ByteBuffer buffer, int offset, int length) { /** * Write a buffer of byte values starting with the first byte in the array up to the provided length. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -199,7 +199,7 @@ default int write(ByteBuffer buffer, int length) { /** * Write a buffer of byte values (all bytes in buffer). - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -222,7 +222,7 @@ default int write(ByteBuffer buffer) { /** * Write multiple byte buffers of data. - * + *

* NOTE: The contents from each byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -491,7 +491,7 @@ default int write(Charset charset, Collection data) { /** * Writes an ASCII based character buffer with a given offset and length. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -511,7 +511,7 @@ default int write(CharBuffer buffer, int offset, int length) { /** * Writes an ASCII based character buffer starting at first index to a given length. - * + *

* NOTE: The contents from the character buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -531,7 +531,7 @@ default int write(CharBuffer buffer, int length) throws IOException { /** * Writes an ASCII based character buffer. - * + *

* NOTE: The contents from the character buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -549,7 +549,7 @@ default int write(CharBuffer buffer) { /** * Writes multiple ASCII based character buffers. - * + *

* NOTE: The contents from each character buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -568,7 +568,7 @@ default int write(CharBuffer ... buffer) { /** * Writes a character buffer with a given offset and length * using a specified character set to encode the chars into bytes. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -597,7 +597,7 @@ default int write(Charset charset, CharBuffer buffer, int offset, int length) { /** * Writes a character buffer starting at first index to a * given length using a specified character set to encode the chars into bytes. - * + *

* NOTE: The contents from the character buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -626,7 +626,7 @@ default int write(Charset charset, CharBuffer buffer, int length) { /** * Writes character buffer using a specified * character set to encode the chars into bytes. - * + *

* NOTE: The contents from the character buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -651,7 +651,7 @@ default int write(Charset charset, CharBuffer buffer) { /** * Writes multiple character buffers using a specified * character set to encode the chars into bytes. - * + *

* NOTE: The contents from each character buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position diff --git a/pi4j-core/src/main/java/com/pi4j/io/IODeviceConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/IODeviceConfigBuilder.java index 16b9b201..a9dc43ee 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/IODeviceConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/IODeviceConfigBuilder.java @@ -34,6 +34,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface IODeviceConfigBuilder extends IOConfigBuilder, diff --git a/pi4j-core/src/main/java/com/pi4j/io/binding/AnalogBinding.java b/pi4j-core/src/main/java/com/pi4j/io/binding/AnalogBinding.java index bb3bdf46..a28d1c9a 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/binding/AnalogBinding.java +++ b/pi4j-core/src/main/java/com/pi4j/io/binding/AnalogBinding.java @@ -32,6 +32,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface AnalogBinding extends Binding { /** diff --git a/pi4j-core/src/main/java/com/pi4j/io/binding/Binding.java b/pi4j-core/src/main/java/com/pi4j/io/binding/Binding.java index a3a71851..8649db79 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/binding/Binding.java +++ b/pi4j-core/src/main/java/com/pi4j/io/binding/Binding.java @@ -32,6 +32,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface Binding { BINDING_TYPE add(MEMBER_TYPE... member); diff --git a/pi4j-core/src/main/java/com/pi4j/io/binding/DigitalBinding.java b/pi4j-core/src/main/java/com/pi4j/io/binding/DigitalBinding.java index 2c7dc3b1..14d56e0e 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/binding/DigitalBinding.java +++ b/pi4j-core/src/main/java/com/pi4j/io/binding/DigitalBinding.java @@ -32,6 +32,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface DigitalBinding extends Binding { /** diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/Gpio.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/Gpio.java index 7ad67e52..457638d4 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/Gpio.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/Gpio.java @@ -33,6 +33,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface Gpio, CONFIG_TYPE extends GpioConfig, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioBase.java index d48349b1..b6dddb54 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioBase.java @@ -33,6 +33,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class GpioBase, CONFIG_TYPE extends GpioConfig, PROVIDER_TYPE extends Provider> diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfig.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfig.java index f4a3097c..90d3928f 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfig.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfig.java @@ -34,6 +34,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface GpioConfig extends AddressConfig, IOConfig { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfigBuilder.java index ac119fb1..79234fdb 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioConfigBuilder.java @@ -32,6 +32,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface GpioConfigBuilder extends IOAddressConfigBuilder { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioProvider.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioProvider.java index efc03e3e..82846272 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioProvider.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/GpioProvider.java @@ -33,6 +33,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface GpioProviderhttp://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class GpioProviderBase< PROVIDER_TYPE extends GpioProvider, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/Analog.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/Analog.java index 7cc54a5e..7d8ab85f 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/Analog.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/Analog.java @@ -35,6 +35,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface Analog, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogBase.java index 604f06b7..32233eeb 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogBase.java @@ -39,6 +39,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class AnalogBase, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfig.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfig.java index 807f8db6..585a761b 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfig.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfig.java @@ -33,6 +33,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface AnalogConfig extends GpioConfig { /** Constant RANGE_MIN_KEY="min" */ diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfigBuilder.java index 8b000880..0c50e132 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogConfigBuilder.java @@ -32,6 +32,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface AnalogConfigBuilder extends GpioConfigBuilder { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogEvent.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogEvent.java index 2765f734..0daed16a 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogEvent.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogEvent.java @@ -32,6 +32,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface AnalogEvent, CONFIG_TYPE extends AnalogConfig, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogListener.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogListener.java index 2ec63b70..2bd1f077 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogListener.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogListener.java @@ -32,6 +32,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface AnalogListener extends Listener { // MARKER INTERFACE diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProvider.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProvider.java index 610aeb80..22a3df41 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProvider.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProvider.java @@ -32,6 +32,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface AnalogProvider extends GpioProvider { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProviderBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProviderBase.java index 11d7aace..3b46e31d 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProviderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogProviderBase.java @@ -31,6 +31,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class AnalogProviderBase< PROVIDER_TYPE extends AnalogProvider, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogValueChangeEvent.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogValueChangeEvent.java index 099ad807..05e1be5c 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogValueChangeEvent.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/AnalogValueChangeEvent.java @@ -31,6 +31,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public class AnalogValueChangeEvent implements AnalogEvent { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBase.java index 45ffd439..bbf1d680 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBase.java @@ -36,6 +36,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class AnalogConfigBase extends IOAddressConfigBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBuilderBase.java index 77c8a805..7d1eb9c6 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/AnalogConfigBuilderBase.java @@ -36,6 +36,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class AnalogConfigBuilderBase extends IOAddressConfigBuilderBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogInputConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogInputConfigBuilder.java index 2f72aa27..c5645ca4 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogInputConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogInputConfigBuilder.java @@ -49,6 +49,7 @@ private DefaultAnalogInputConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.gpio.analog.AnalogInputConfigBuilder} object. */ public static AnalogInputConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogOutputConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogOutputConfigBuilder.java index 122b6b41..b545b649 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogOutputConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/analog/impl/DefaultAnalogOutputConfigBuilder.java @@ -49,6 +49,7 @@ private DefaultAnalogOutputConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.gpio.analog.AnalogOutputConfigBuilder} object. */ public static AnalogOutputConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/Digital.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/Digital.java index 88f4131e..4cda5b76 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/Digital.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/Digital.java @@ -35,6 +35,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface Digital, CONFIG_TYPE extends DigitalConfig, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalBase.java index d1cf4194..70f2a8c3 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalBase.java @@ -40,6 +40,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class DigitalBase, CONFIG_TYPE extends DigitalConfig, @@ -92,7 +95,7 @@ public DIGITAL_TYPE removeListener(DigitalStateChangeListener... listener) { public DIGITAL_TYPE bind(DigitalBinding ... binding) { return bindings.bind(binding); - //bindings.addAll(Arrays.asList(binding)); + //bindings.addAll(List.of(binding)); //return (DIGITAL_TYPE)this; } @@ -100,7 +103,7 @@ public DIGITAL_TYPE bind(DigitalBinding ... binding) { @Override public DIGITAL_TYPE unbind(DigitalBinding ... binding) { return bindings.unbind(binding); - //bindings.removeAll(Arrays.asList(binding)); + //bindings.removeAll(List.of(binding)); //return (DIGITAL_TYPE)this; } diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfig.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfig.java index f707d739..aa558c17 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfig.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfig.java @@ -33,6 +33,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface DigitalConfig extends GpioConfig { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfigBuilder.java index 7588580e..42c4390c 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalConfigBuilder.java @@ -32,6 +32,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public interface DigitalConfigBuilder extends GpioConfigBuilder { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalEvent.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalEvent.java index c12c64a7..50ed3bf7 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalEvent.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalEvent.java @@ -32,6 +32,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface DigitalEvent, CONFIG_TYPE extends DigitalConfig, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalListener.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalListener.java index 818fc284..9e106eb9 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalListener.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalListener.java @@ -32,6 +32,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public interface DigitalListener extends Listener { // MARKER INTERFACE diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProvider.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProvider.java index 64553e9c..68354ae8 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProvider.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProvider.java @@ -32,6 +32,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface DigitalProvider extends GpioProvider { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProviderBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProviderBase.java index 38e2835f..487efc9c 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProviderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalProviderBase.java @@ -31,6 +31,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class DigitalProviderBase< PROVIDER_TYPE extends DigitalProvider, diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalStateChangeEvent.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalStateChangeEvent.java index 59bf91d7..be2f8c8d 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalStateChangeEvent.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/DigitalStateChangeEvent.java @@ -32,6 +32,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public class DigitalStateChangeEvent implements DigitalEvent { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalInputConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalInputConfigBuilder.java index 55b96cae..aaf6ea82 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalInputConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalInputConfigBuilder.java @@ -52,6 +52,7 @@ protected DefaultDigitalInputConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.gpio.digital.DigitalInputConfigBuilder} object. */ public static DigitalInputConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputBuilder.java index 377a330d..7b994389 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputBuilder.java @@ -48,7 +48,12 @@ public class DefaultDigitalOutputBuilder implements DigitalOutputBuilder { private String providerId = null; private Class providerClass = null; - /** {@inheritDoc} */ + /** + * Creates a new instance of {@link DefaultDigitalOutputBuilder} with the specified context. + * + * @param context the context used to initialize the digital output + * @return a new instance of {@link DigitalOutputBuilder} + */ public static DigitalOutputBuilder newInstance(Context context) { return new DefaultDigitalOutputBuilder(context); } diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputConfigBuilder.java index f87de96f..92d70b11 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DefaultDigitalOutputConfigBuilder.java @@ -50,6 +50,7 @@ protected DefaultDigitalOutputConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.gpio.digital.DigitalOutputConfigBuilder} object. */ public static DigitalOutputConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DigitalConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DigitalConfigBuilderBase.java index c9d591d6..d132376b 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DigitalConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/gpio/digital/impl/DigitalConfigBuilderBase.java @@ -28,7 +28,6 @@ import com.pi4j.context.Context; import com.pi4j.io.gpio.digital.DigitalConfig; import com.pi4j.io.gpio.digital.DigitalConfigBuilder; -import com.pi4j.io.gpio.digital.DigitalOutputConfigBuilder; import com.pi4j.io.gpio.digital.DigitalState; import com.pi4j.io.impl.IOAddressConfigBuilderBase; @@ -37,6 +36,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class DigitalConfigBuilderBase extends IOAddressConfigBuilderBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2C.java b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2C.java index ce4b5ff2..d353fbcb 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2C.java +++ b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2C.java @@ -186,6 +186,8 @@ default I2CRegister register(int address) { * Executes the given runnable on the I2C bus, locking the bus for the duration of the given task * * @param action the action to perform, returning a value + * @param + * @return */ T execute(Callable action); } diff --git a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CBase.java b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CBase.java index b480c4cd..1094cc1d 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CBase.java @@ -37,6 +37,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class I2CBase extends IOBase implements I2C { diff --git a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataReaderWriter.java b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataReaderWriter.java index ef1e6132..1946acb4 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataReaderWriter.java +++ b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataReaderWriter.java @@ -29,7 +29,7 @@ * I2C Register Data Writer Interface for Pi4J Data Communications * * @author Robert Savage - * + *

* Based on previous contributions from: * Daniel Sendula, * RasPelikan diff --git a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataWriter.java b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataWriter.java index 27a24567..8d24d4f7 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataWriter.java +++ b/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CRegisterDataWriter.java @@ -38,7 +38,7 @@ * I2C Register Data Writer Interface for Pi4J Data Communications * * @author Robert Savage - * + *

* Based on previous contributions from: * Daniel Sendula, * RasPelikan @@ -196,7 +196,7 @@ default int writeRegister(int register, Collection data) throws IOExcept /** * Write a buffer of byte values starting from a given offset index in the * array up to the provided length to a specific I2C device register. - * + *

* NOTE: The buffer's internal position tracking is no * used but rather only the explicit offset and * length provided. If the requested length is @@ -224,7 +224,7 @@ default int writeRegister(int register, ByteBuffer buffer, int offset, int lengt /** * Write a buffer of byte values starting from the first byte in the buffer * up to the provided length to a specific I2C device register. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -253,7 +253,7 @@ default int writeRegister(int register, ByteBuffer buffer, int length) throws IO /** * Write a buffer of byte values (all bytes in buffer) to a specific I2C device register. - * + *

* NOTE: The contents from the byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -278,7 +278,7 @@ default int writeRegister(int register, ByteBuffer buffer) throws IOException{ /** * Write multiple byte buffers to a specific I2C device register. - * + *

* NOTE: The contents from each byte buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -615,7 +615,7 @@ default int writeRegister(int register, CharBuffer ... data) throws IOException /** * Writes a character buffer with a given offset and length using a specified * character set to encode the chars into bytes to a specific I2C device register. - * + *

* NOTE: The buffer's internal position tracking is no * used but rather only the explicit offset and * length provided. If the requested length is @@ -646,7 +646,7 @@ default int writeRegister(int register, Charset charset, CharBuffer buffer, int /** * Write a character buffer starting at first index to a given length using * a specified character set to encode the chars into bytes to a specific I2C device register. - * + *

* NOTE: The contents from the character buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -677,7 +677,7 @@ default int writeRegister(int register, Charset charset, CharBuffer buffer, int /** * Write a character buffer using a specified character set * to encode the chars into bytes to a specific I2C device register. - * + *

* NOTE: The contents from the character buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position @@ -704,7 +704,7 @@ default int writeRegister(int register, Charset charset, CharBuffer buffer) thro /** * Writes multiple character buffers using a specified character * set to encode the chars into bytes to a specific I2C device register. - * + *

* NOTE: The contents from each character buffer is read * from the current position index up to the buffer's * remaining limit. If the buffer's current position diff --git a/pi4j-core/src/main/java/com/pi4j/io/i2c/impl/DefaultI2CConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/i2c/impl/DefaultI2CConfigBuilder.java index 0b4fd139..ee8f47e6 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/i2c/impl/DefaultI2CConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/i2c/impl/DefaultI2CConfigBuilder.java @@ -50,6 +50,7 @@ protected DefaultI2CConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.i2c.I2CConfigBuilder} object. */ public static I2CConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBase.java b/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBase.java index af8dd7dd..287fcda9 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBase.java @@ -37,6 +37,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public class IOAddressConfigBase extends AddressConfigBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBuilderBase.java index 0a2edf28..7d0bd607 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/impl/IOAddressConfigBuilderBase.java @@ -40,6 +40,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class IOAddressConfigBuilderBase extends AddressConfigBuilderBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBase.java b/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBase.java index be898022..72d2e4db 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBase.java @@ -36,6 +36,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class IOConfigBase extends ConfigBase implements IOConfig { diff --git a/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBuilderBase.java index 22aaab7c..58841b6f 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/impl/IOConfigBuilderBase.java @@ -39,6 +39,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class IOConfigBuilderBase extends ConfigBuilderBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBase.java b/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBase.java index 49524767..d95cb153 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBase.java @@ -37,6 +37,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public class IODeviceConfigBase> extends DeviceConfigBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBuilderBase.java b/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBuilderBase.java index f0c4de71..9c733412 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBuilderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/io/impl/IODeviceConfigBuilderBase.java @@ -40,6 +40,8 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param */ public abstract class IODeviceConfigBuilderBase extends DeviceConfigBuilderBase diff --git a/pi4j-core/src/main/java/com/pi4j/io/pwm/Pwm.java b/pi4j-core/src/main/java/com/pi4j/io/pwm/Pwm.java index 1d892c00..d9e72296 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/pwm/Pwm.java +++ b/pi4j-core/src/main/java/com/pi4j/io/pwm/Pwm.java @@ -209,7 +209,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ * period. The duty-cycle range is valid from 0 to 100 including * factional values. (Values above 50% mean the signal will remain * HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -224,7 +224,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ * period. The duty-cycle range is valid from 0 to 100 including * factional values. (Values above 50% mean the signal will remain * HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -242,7 +242,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ * 'Pwm::On()' method. Call 'Pwm::On()' if you wish to make a live/ * immediate change to the duty-cycle on an existing PWM signal. * (Values above 50% mean the signal will remain HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -260,7 +260,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ * 'Pwm::On()' method. Call 'Pwm::On()' if you wish to make a live/ * immediate change to the duty-cycle on an existing PWM signal. * (Values above 50% mean the signal will remain HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -274,7 +274,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ * Get the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should attempt to output when the PWM signal * is turned 'ON'. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(..) method, you can check the @@ -291,7 +291,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ * Get the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should attempt to output when the PWM signal * is turned 'ON'. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(...)' method, you can check the @@ -307,7 +307,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ /** * Get the actual frequency value in Hertz (number of cycles per second) * applied by the PWM signal generator after the PWM signal is turned 'ON'. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(...)' method, you can call this @@ -322,7 +322,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ /** * Get the actual frequency value in Hertz (number of cycles per second) * applied by the PWM signal generator after the PWM signal is turned 'ON'. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(...)' method, you can call this @@ -337,7 +337,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ /** * Set the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should use when the PWM signal is turned 'ON'. - * + *

* Note: This method will not update a live PWM signal, but rather stage the * frequency value for subsequent call to the 'Pwm::On()' method. Call 'Pwm::On()' * if you wish to make a live/immediate change to the duty-cycle on an existing @@ -351,7 +351,7 @@ default Pwm on(Number dutyCycle, int frequency) throws IOException{ /** * Set the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should use when the PWM signal is turned 'ON'. - * + *

* Note: This method will not update a live PWM signal, but rather stage the * frequency value for subsequent call to the 'Pwm::On()' method. Call 'Pwm::On()' * if you wish to make a live/immediate change to the duty-cycle on an existing diff --git a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfig.java b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfig.java index db84cb1d..9c03deb8 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfig.java +++ b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfig.java @@ -56,7 +56,7 @@ public interface PwmConfig extends GpioConfig, AddressConfig * Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -69,7 +69,7 @@ public interface PwmConfig extends GpioConfig, AddressConfig * Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -146,7 +146,7 @@ default PwmPolarity getPolarity(){ /** * Get configured PWM duty-cycle value that is automatically applied * to the PWM instance when the Pi4J context is shutdown. - * + *

* This option can be helpful if you wish to do something like stop a PWM * signal (by configuring this 'shutdown' value to zero) when your application * is terminated an Pi4J is shutdown. @@ -159,7 +159,7 @@ default PwmPolarity getPolarity(){ /** * Get configured PWM duty-cycle value that is automatically applied * to the PWM instance when the Pi4J context is shutdown. - * + *

* This option can be helpful if you wish to do something like stop a PWM * signal (by configuring this 'shutdown' value to zero) when your application * is terminated an Pi4J is shutdown. @@ -199,7 +199,7 @@ default void setShutdownValue(Number dutyCycle){ /** * Get configured PWM duty-cycle value that is automatically applied to * the PWM instance when this PWM instance is created and initialized. - * + *

* This option can be helpful if you wish to do something like set a default PWM * signal (by configuring this 'initial' value to 50%) when your application * creates the PWM instance. This just helps eliminate a second line of code @@ -213,7 +213,7 @@ default void setShutdownValue(Number dutyCycle){ /** * Get configured PWM duty-cycle value that is automatically applied to * the PWM instance when this PWM instance is created and initialized. - * + *

* This option can be helpful if you wish to do something like set a default PWM * signal (by configuring this 'initial' value to 50%) when your application * creates the PWM instance. This just helps eliminate a second line of code diff --git a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfigBuilder.java index 6759ac2f..5d029064 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmConfigBuilder.java @@ -50,7 +50,7 @@ static PwmConfigBuilder newInstance(Context context) { * Set the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should attempt to output when the PWM state * is enabled. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(...)' method, you can check the @@ -68,7 +68,7 @@ static PwmConfigBuilder newInstance(Context context) { * period. The duty-cycle range is valid from 0 to 100 including * factional values. (Values above 50% mean the signal will * remain HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * diff --git a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPreset.java b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPreset.java index 1d759857..1555a6dd 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPreset.java +++ b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPreset.java @@ -67,7 +67,7 @@ default String getName() { * period. The duty-cycle range is valid from 0 to 100 including * factional values. (Values above 50% mean the signal will * remain HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -81,7 +81,7 @@ default String getName() { * period. The duty-cycle range is valid from 0 to 100 including * factional values. (Values above 50% mean the signal will * remain HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -95,7 +95,7 @@ default Float getDutyCycle() { * Get the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should attempt to output when this preset * is applied to a PWM instance. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(...)' method, you can check the @@ -111,7 +111,7 @@ default Float getDutyCycle() { * Get the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should attempt to output when this preset * is applied to a PWM instance. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(...)' method, you can check the diff --git a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPresetBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPresetBuilder.java index cc75accd..11ba8822 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPresetBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/pwm/PwmPresetBuilder.java @@ -51,7 +51,7 @@ static PwmPresetBuilder newInstance(String name) { * period. The duty-cycle range is valid from 0 to 100 including * factional values. (Values above 50% mean the signal will * remain HIGH more time than LOW.) - * + *

* Example: A value of 50 represents a duty-cycle where half of * the time period the signal is LOW and the other half is HIGH. * @@ -64,7 +64,7 @@ static PwmPresetBuilder newInstance(String name) { * Set the configured frequency value in Hertz (number of cycles per second) * that the PWM signal generator should attempt to output when this preset * is applied to a PWM instance. - * + *

* Please note that certain PWM signal generators may be limited to specific * frequency bands and may not generate all possible explicit frequency values. * After enabling the PWM signal using the 'on(...)' method, you can check the diff --git a/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmConfigBuilder.java index e55d5c4e..0efbee82 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmConfigBuilder.java @@ -54,6 +54,7 @@ protected DefaultPwmConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.pwm.PwmConfigBuilder} object. */ public static PwmConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmPresetBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmPresetBuilder.java index 1e1e9f9e..67a4fc93 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmPresetBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/pwm/impl/DefaultPwmPresetBuilder.java @@ -48,7 +48,12 @@ protected DefaultPwmPresetBuilder(String name){ super(); this.name = name; } - /** {@inheritDoc} */ + /** + * Creates a new instance of {@link DefaultPwmPresetBuilder} with the specified name. + * + * @param name the name of the PWM preset + * @return a new {@link PwmPresetBuilder} instance + */ public static PwmPresetBuilder newInstance(String name) { return new DefaultPwmPresetBuilder(name); } diff --git a/pi4j-core/src/main/java/com/pi4j/io/serial/impl/DefaultSerialConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/serial/impl/DefaultSerialConfigBuilder.java index 5313c672..fdbde2a8 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/serial/impl/DefaultSerialConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/serial/impl/DefaultSerialConfigBuilder.java @@ -49,6 +49,7 @@ protected DefaultSerialConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.serial.SerialConfigBuilder} object. */ public static SerialConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/io/spi/Spi.java b/pi4j-core/src/main/java/com/pi4j/io/spi/Spi.java index 23f94f82..c47c0bdc 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/spi/Spi.java +++ b/pi4j-core/src/main/java/com/pi4j/io/spi/Spi.java @@ -223,7 +223,7 @@ default int transfer(byte[] buffer) { * using the same length ('numberOfBytes'). Both the 'write' and 'read' byte buffers must * at least have the available capacity of the defined 'numberOfBytes' + their corresponding * offsets. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is @@ -274,7 +274,7 @@ default int transfer(ByteBuffer write, int writeOffset, ByteBuffer read, int rea * current position using the same length ('numberOfBytes'). Both the 'write' and 'read' * byte buffers must at least have the available capacity of the defined 'numberOfBytes' + * their corresponding current positions. - * + *

* NOTE: The contents from the 'write' byte buffer is read * from the current position index up to the length * requested or up to the buffer's remaining limit; @@ -282,7 +282,7 @@ default int transfer(ByteBuffer write, int writeOffset, ByteBuffer read, int rea * position is already at the buffer's limit, then we * will automatically flip the buffer to begin reading * data from the zero position up to the buffer's limit * - * + *

* NOTE: The data bytes read from the SPI device are copied/ * inserted into the 'read' byte buffer starting at the current * position index up to the length requested or up to the @@ -321,7 +321,7 @@ default int transfer(ByteBuffer write, ByteBuffer read, int numberOfBytes) { * read from the SPI device is then copied to the byte buffer at the given 'offset' * using the same length (number of bytes). The byte buffer must at least have the * available capacity of the defined 'length' + 'offset'. - * + *

* NOTE: The buffer's internal position tracking is not * used but rather only the explicit offset and * length provided. If the requested length is diff --git a/pi4j-core/src/main/java/com/pi4j/io/spi/impl/DefaultSpiConfigBuilder.java b/pi4j-core/src/main/java/com/pi4j/io/spi/impl/DefaultSpiConfigBuilder.java index ca53a409..cca1a4d5 100644 --- a/pi4j-core/src/main/java/com/pi4j/io/spi/impl/DefaultSpiConfigBuilder.java +++ b/pi4j-core/src/main/java/com/pi4j/io/spi/impl/DefaultSpiConfigBuilder.java @@ -49,6 +49,7 @@ protected DefaultSpiConfigBuilder(Context context){ /** *

newInstance.

* + * @param context * @return a {@link com.pi4j.io.spi.SpiConfigBuilder} object. */ public static SpiConfigBuilder newInstance(Context context) { diff --git a/pi4j-core/src/main/java/com/pi4j/platform/PlatformBase.java b/pi4j-core/src/main/java/com/pi4j/platform/PlatformBase.java index 3f6eead0..2fa1d1b9 100644 --- a/pi4j-core/src/main/java/com/pi4j/platform/PlatformBase.java +++ b/pi4j-core/src/main/java/com/pi4j/platform/PlatformBase.java @@ -53,6 +53,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public abstract class PlatformBase extends ExtensionBase diff --git a/pi4j-core/src/main/java/com/pi4j/platform/impl/DefaultRuntimePlatforms.java b/pi4j-core/src/main/java/com/pi4j/platform/impl/DefaultRuntimePlatforms.java index f7d7b3e3..8f6cea23 100644 --- a/pi4j-core/src/main/java/com/pi4j/platform/impl/DefaultRuntimePlatforms.java +++ b/pi4j-core/src/main/java/com/pi4j/platform/impl/DefaultRuntimePlatforms.java @@ -37,10 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; /** @@ -210,7 +207,7 @@ public RuntimePlatforms initialize(Collection platforms) throws Initia private Platforms add(T ... platform) throws PlatformAlreadyExistsException, PlatformInitializeException { - return add(Arrays.asList(platform)); + return add(List.of(platform)); } private Platforms add(Collection platform) throws PlatformAlreadyExistsException, PlatformInitializeException { diff --git a/pi4j-core/src/main/java/com/pi4j/provider/Provider.java b/pi4j-core/src/main/java/com/pi4j/provider/Provider.java index e49d595f..ddfc1986 100644 --- a/pi4j-core/src/main/java/com/pi4j/provider/Provider.java +++ b/pi4j-core/src/main/java/com/pi4j/provider/Provider.java @@ -42,6 +42,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public interface Provider extends Extension { diff --git a/pi4j-core/src/main/java/com/pi4j/provider/ProviderBase.java b/pi4j-core/src/main/java/com/pi4j/provider/ProviderBase.java index 68c25b7b..691b825d 100644 --- a/pi4j-core/src/main/java/com/pi4j/provider/ProviderBase.java +++ b/pi4j-core/src/main/java/com/pi4j/provider/ProviderBase.java @@ -42,6 +42,9 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param + * @param + * @param */ public abstract class ProviderBase extends ExtensionBase diff --git a/pi4j-core/src/main/java/com/pi4j/provider/ProviderGroup.java b/pi4j-core/src/main/java/com/pi4j/provider/ProviderGroup.java index daa6b1de..328f2e34 100644 --- a/pi4j-core/src/main/java/com/pi4j/provider/ProviderGroup.java +++ b/pi4j-core/src/main/java/com/pi4j/provider/ProviderGroup.java @@ -39,6 +39,7 @@ * * @author Robert Savage (http://www.savagehomeautomation.com) * @version $Id: $Id + * @param */ public class ProviderGroup implements Describable { diff --git a/pi4j-core/src/main/java/com/pi4j/provider/impl/DefaultRuntimeProviders.java b/pi4j-core/src/main/java/com/pi4j/provider/impl/DefaultRuntimeProviders.java index 45799a0f..fc576d8c 100644 --- a/pi4j-core/src/main/java/com/pi4j/provider/impl/DefaultRuntimeProviders.java +++ b/pi4j-core/src/main/java/com/pi4j/provider/impl/DefaultRuntimeProviders.java @@ -47,10 +47,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; /** @@ -229,7 +226,7 @@ public Provider get(String providerId) throws ProviderNotFoundException { } private Providers add(T ... provider) throws ProviderInitializeException, ProviderAlreadyExistsException { - return add(Arrays.asList(provider)); + return add(List.of(provider)); } private Providers add(Collection provider) throws ProviderAlreadyExistsException, ProviderInitializeException { diff --git a/pi4j-core/src/main/java/com/pi4j/runtime/impl/DefaultRuntime.java b/pi4j-core/src/main/java/com/pi4j/runtime/impl/DefaultRuntime.java index 4d678d40..19c5987c 100644 --- a/pi4j-core/src/main/java/com/pi4j/runtime/impl/DefaultRuntime.java +++ b/pi4j-core/src/main/java/com/pi4j/runtime/impl/DefaultRuntime.java @@ -282,11 +282,14 @@ public Runtime initialize() throws InitializeException { plugin.initialize(DefaultPluginService.newInstance(this.context(), store)); // if auto-detect providers is enabled, + // OR + // Detecting Mocks is enabled and this is a mock plugin // then add any detected providers to the collection to load - if (config.autoDetectProviders()) { + if (config.autoDetectProviders() || (config.autoDetectMockPlugins() && plugin.isMock())) { store.providers.forEach(provider -> addProvider(provider, providers)); } + // if auto-detect platforms is enabled, // then add any detected platforms to the collection to load if (config.autoDetectPlatforms()) { diff --git a/pi4j-core/src/main/java/module-info.java b/pi4j-core/src/main/java/module-info.java index 00706ec1..9b66aeb4 100644 --- a/pi4j-core/src/main/java/module-info.java +++ b/pi4j-core/src/main/java/module-info.java @@ -24,6 +24,11 @@ */ module com.pi4j { + // for tests + opens com.pi4j.boardinfo.definition; + opens com.pi4j.boardinfo.model; + opens com.pi4j.boardinfo.util; + // depends on SLF4J requires org.slf4j; diff --git a/pi4j-core/test/java/com/pi4j/boardinfo/definition/BoardModelTest.java b/pi4j-core/src/test/java/com/pi4j/boardinfo/definition/BoardModelTest.java similarity index 100% rename from pi4j-core/test/java/com/pi4j/boardinfo/definition/BoardModelTest.java rename to pi4j-core/src/test/java/com/pi4j/boardinfo/definition/BoardModelTest.java diff --git a/pi4j-core/test/java/com/pi4j/boardinfo/model/ModelTest.java b/pi4j-core/src/test/java/com/pi4j/boardinfo/model/ModelTest.java similarity index 100% rename from pi4j-core/test/java/com/pi4j/boardinfo/model/ModelTest.java rename to pi4j-core/src/test/java/com/pi4j/boardinfo/model/ModelTest.java diff --git a/pi4j-core/src/test/java/com/pi4j/boardinfo/util/BoardModelDetectionTest.java b/pi4j-core/src/test/java/com/pi4j/boardinfo/util/BoardModelDetectionTest.java new file mode 100644 index 00000000..2c1be2ed --- /dev/null +++ b/pi4j-core/src/test/java/com/pi4j/boardinfo/util/BoardModelDetectionTest.java @@ -0,0 +1,28 @@ +package com.pi4j.boardinfo.util; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; + +class BoardModelDetectionTest { + + @Test + void testGetDetectedBoard() { + var detectedBoard = BoardInfoHelper.current(); + + assertAll( + () -> assertEquals(detectedBoard.getOperatingSystem().getName(), System.getProperty("os.name")), + () -> assertEquals(detectedBoard.getOperatingSystem().getVersion(), System.getProperty("os.version")), + () -> assertEquals(detectedBoard.getOperatingSystem().getArchitecture(), System.getProperty("os.arch")), + + () -> assertEquals(detectedBoard.getJavaInfo().getVersion(), System.getProperty("java.version")), + () -> assertEquals(detectedBoard.getJavaInfo().getRuntime(), System.getProperty("java.runtime.version")), + () -> assertEquals(detectedBoard.getJavaInfo().getVendor(), System.getProperty("java.vendor")), + () -> assertEquals(detectedBoard.getJavaInfo().getVendorVersion(), System.getProperty("java.vendor.version")) + + // Cannot test detectedBoard.getBoardModel().getModel()) as the output is different on + // Raspberry Pi versus PC, macOS or build server + ); + } +} diff --git a/pi4j-core/test/java/com/pi4j/boardinfo/util/BoardModelDetectionTest.java b/pi4j-core/test/java/com/pi4j/boardinfo/util/BoardModelDetectionTest.java deleted file mode 100644 index 4f151e1e..00000000 --- a/pi4j-core/test/java/com/pi4j/boardinfo/util/BoardModelDetectionTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.pi4j.boardinfo.util; - -import com.pi4j.boardinfo.definition.PiModel; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertAll; -import static org.junit.jupiter.api.Assertions.assertEquals; - -class BoardModelDetectionTest { - - @Test - void testGetDetectedBoard() { - var detectedBoard = BoardInfoHelper.current(); - - assertAll( - () -> assertEquals(detectedBoard.getOperatingSystem().getName(), System.getProperty("os.name")), - () -> assertEquals(detectedBoard.getOperatingSystem().getVersion(), System.getProperty("os.version")), - () -> assertEquals(detectedBoard.getOperatingSystem().getArchitecture(), System.getProperty("os.arch")), - - () -> assertEquals(detectedBoard.getJavaInfo().getVersion(), System.getProperty("java.version")), - () -> assertEquals(detectedBoard.getJavaInfo().getRuntime(), System.getProperty("java.runtime.version")), - () -> assertEquals(detectedBoard.getJavaInfo().getVendor(), System.getProperty("java.vendor")), - () -> assertEquals(detectedBoard.getJavaInfo().getVendorVersion(), System.getProperty("java.vendor.version")), - - () -> assertEquals(detectedBoard.getBoardModel().getModel(), PiModel.UNKNOWN) // Only valid on PC, macOS or build server - ); - } -} diff --git a/pi4j-distribution/pom.xml b/pi4j-distribution/pom.xml index e8add137..906def8b 100644 --- a/pi4j-distribution/pom.xml +++ b/pi4j-distribution/pom.xml @@ -4,7 +4,7 @@ pi4j-parent com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pom.xml diff --git a/pi4j-test/pom.xml b/pi4j-test/pom.xml index f0ad3315..fbb91d11 100644 --- a/pi4j-test/pom.xml +++ b/pi4j-test/pom.xml @@ -5,13 +5,13 @@ pi4j-parent com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pom.xml 4.0.0 pi4j-test - Pi4J :: TESTING :: Unit/Integration Tests + Pi4J :: TESTING :: Unit/Integration Tests Pi4J Unit and Integration Tests @@ -241,7 +241,8 @@ @@ -249,7 +250,8 @@ + trust="true" + command="mkdir --parents ${raspberrypi.deploydirectory}; rm -f ${raspberrypi.deploydirectory}/*"/> diff --git a/pi4j-test/src/main/java/com/pi4j/test/About.java b/pi4j-test/src/main/java/com/pi4j/test/About.java index ad4d9f47..55148466 100644 --- a/pi4j-test/src/main/java/com/pi4j/test/About.java +++ b/pi4j-test/src/main/java/com/pi4j/test/About.java @@ -1,4 +1,6 @@ -package com.pi4j.test;/*- +package com.pi4j.test; + +/*- * #%L * ********************************************************************** * ORGANIZATION : Pi4J diff --git a/pi4j-test/src/main/java/com/pi4j/test/platform/TestPlatform.java b/pi4j-test/src/main/java/com/pi4j/test/platform/TestPlatform.java index f86c9345..62bc5d88 100644 --- a/pi4j-test/src/main/java/com/pi4j/test/platform/TestPlatform.java +++ b/pi4j-test/src/main/java/com/pi4j/test/platform/TestPlatform.java @@ -30,8 +30,8 @@ import com.pi4j.platform.PlatformBase; import com.pi4j.provider.Provider; -import java.util.Arrays; import java.util.HashSet; +import java.util.List; import java.util.Set; /** @@ -110,7 +110,7 @@ protected String[] getProviders() { */ public void setProviders(String ... providerId){ this.supportedProviderIds.clear(); - this.supportedProviderIds.addAll(Arrays.asList(providerId)); + this.supportedProviderIds.addAll(List.of(providerId)); } /** diff --git a/pi4j-test/src/test/java/com/pi4j/test/context/ContextTest.java b/pi4j-test/src/test/java/com/pi4j/test/context/ContextTest.java index f7ba37a5..81acde16 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/context/ContextTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/context/ContextTest.java @@ -51,7 +51,7 @@ public void beforeTest() throws Pi4JException { // An auto context includes AUTO-DETECT BINDINGS enabled // which will load all detected Pi4J extension libraries // (Platforms and Providers) in the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterAll diff --git a/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRawDataTest.java b/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRawDataTest.java index b1594afb..40653e9a 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRawDataTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRawDataTest.java @@ -67,7 +67,8 @@ public void beforeTest() throws Pi4JException { // An auto context enabled AUTO-DETECT loading // which will load any detected Pi4J extension // libraries (Platforms and Providers) from the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); + } @AfterEach diff --git a/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRegisterDataTest.java b/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRegisterDataTest.java index 99fb3053..9a767cbf 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRegisterDataTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/io/i2c/I2CRegisterDataTest.java @@ -68,7 +68,7 @@ public void beforeTest() throws Pi4JException { // An auto context enabled AUTO-DETECT loading // which will load any detected Pi4J extension // libraries (Platforms and Providers) from the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterAll diff --git a/pi4j-test/src/test/java/com/pi4j/test/io/spi/SpiRawDataTest.java b/pi4j-test/src/test/java/com/pi4j/test/io/spi/SpiRawDataTest.java index b4d33588..43b07a1c 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/io/spi/SpiRawDataTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/io/spi/SpiRawDataTest.java @@ -66,7 +66,7 @@ public void beforeTest() throws Pi4JException { // An auto context enabled AUTO-DETECT loading // which will load any detected Pi4J extension // libraries (Platforms and Providers) from the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterEach diff --git a/pi4j-test/src/test/java/com/pi4j/test/platform/AutoPlatformsTest.java b/pi4j-test/src/test/java/com/pi4j/test/platform/AutoPlatformsTest.java index fe844f34..193d6a7d 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/platform/AutoPlatformsTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/platform/AutoPlatformsTest.java @@ -48,7 +48,7 @@ public void beforeTest() throws Pi4JException { // An auto context includes AUTO-DETECT BINDINGS enabled // which will load all detected Pi4J extension libraries // (Platforms and Providers) in the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterAll diff --git a/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsCtorTest.java b/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsCtorTest.java index 816059b2..9484048c 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsCtorTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsCtorTest.java @@ -30,7 +30,6 @@ import com.pi4j.Pi4J; import com.pi4j.context.Context; -import com.pi4j.exception.Pi4JException; import com.pi4j.test.provider.TestI2CProvider; import com.pi4j.test.provider.TestPwmProvider; import com.pi4j.test.provider.TestSerialProvider; diff --git a/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsTest.java b/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsTest.java index d1c2e8f5..e8a6e7c6 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/platform/ManualPlatformsTest.java @@ -61,21 +61,7 @@ public void beforeTest() { // Initialize Pi4J with AUTO-DETECT disabled // we don't want to load any detected Pi4J extension // libraries (Platforms and Providers) from the class path - pi4j = Pi4J.newContextBuilder() - - // add any platforms that we want to work with - .add(new MockPlatform()) - - // add any providers that we want to work with - .add(MockAnalogInputProvider.newInstance(), - MockAnalogOutputProvider.newInstance(), - MockDigitalInputProvider.newInstance(), - MockDigitalOutputProvider.newInstance(), - MockPwmProvider.newInstance(), - MockI2CProvider.newInstance(), - MockSpiProvider.newInstance(), - MockSerialProvider.newInstance()) - .build(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterAll diff --git a/pi4j-test/src/test/java/com/pi4j/test/provider/AutoProvidersTest.java b/pi4j-test/src/test/java/com/pi4j/test/provider/AutoProvidersTest.java index c18bf9a6..ca3d8be3 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/provider/AutoProvidersTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/provider/AutoProvidersTest.java @@ -51,7 +51,7 @@ public void beforeTest() { // An auto context includes AUTO-DETECT BINDINGS enabled // which will load all detected Pi4J extension libraries // (Platforms and Providers) in the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterAll diff --git a/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryGetIoInstance.java b/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryGetIoInstance.java index 96d1bad8..a5f7ecb3 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryGetIoInstance.java +++ b/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryGetIoInstance.java @@ -53,7 +53,7 @@ public void beforeTest() throws Pi4JException { // An auto context includes AUTO-DETECT BINDINGS enabled // which will load all detected Pi4J extension libraries // (Platforms and Providers) in the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterAll diff --git a/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryTest.java b/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryTest.java index 92fcf70d..3ebe45ba 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/registry/RegistryTest.java @@ -52,7 +52,7 @@ public void beforeTest() throws Pi4JException { // An auto context includes AUTO-DETECT BINDINGS enabled // which will load all detected Pi4J extension libraries // (Platforms and Providers) in the class path - pi4j = Pi4J.newAutoContext(); + pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); } @AfterAll diff --git a/pi4j-test/src/test/java/com/pi4j/test/runtime/RuntimeTest.java b/pi4j-test/src/test/java/com/pi4j/test/runtime/RuntimeTest.java index 32988406..30b6f7af 100644 --- a/pi4j-test/src/test/java/com/pi4j/test/runtime/RuntimeTest.java +++ b/pi4j-test/src/test/java/com/pi4j/test/runtime/RuntimeTest.java @@ -52,7 +52,7 @@ public void testRuntimeShutdownEvents() throws Pi4JException { // An auto context includes AUTO-DETECT BINDINGS enabled // which will load all detected Pi4J extension libraries // (Platforms and Providers) in the class path - Context pi4j = Pi4J.newAutoContext(); + Context pi4j = Pi4J.newContextBuilder().autoDetectMockPlugins().autoDetectPlatforms().build(); logger.info("-------------------------------------------------"); logger.info("Pi4J CONTEXT "); diff --git a/plugins/pi4j-plugin-gpiod/pom.xml b/plugins/pi4j-plugin-gpiod/pom.xml index 01cd4865..9e97473d 100644 --- a/plugins/pi4j-plugin-gpiod/pom.xml +++ b/plugins/pi4j-plugin-gpiod/pom.xml @@ -5,14 +5,14 @@ com.pi4j pi4j-plugin - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-plugin/pom.xml 4.0.0 pi4j-plugin-gpiod - Pi4J :: PLUGIN :: GPIOD I/O Providers + Pi4J :: PLUGIN :: GPIOD I/O Providers Pi4J Library Plugin for GPIOD I/O Providers jar @@ -76,18 +76,20 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> - + diff --git a/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalInputProviderImpl.java b/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalInputProviderImpl.java index 4ea0c651..584d5e0c 100644 --- a/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalInputProviderImpl.java +++ b/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalInputProviderImpl.java @@ -1,7 +1,6 @@ package com.pi4j.plugin.gpiod.provider.gpio.digital; -import com.pi4j.boardinfo.util.BoardInfoHelper; import com.pi4j.context.Context; import com.pi4j.exception.InitializeException; import com.pi4j.exception.ShutdownException; diff --git a/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalOutputProviderImpl.java b/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalOutputProviderImpl.java index 58078976..f05335ec 100644 --- a/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalOutputProviderImpl.java +++ b/plugins/pi4j-plugin-gpiod/src/main/java/com/pi4j/plugin/gpiod/provider/gpio/digital/GpioDDigitalOutputProviderImpl.java @@ -27,7 +27,6 @@ * #L% */ -import com.pi4j.boardinfo.util.BoardInfoHelper; import com.pi4j.context.Context; import com.pi4j.exception.InitializeException; import com.pi4j.exception.ShutdownException; diff --git a/plugins/pi4j-plugin-linuxfs/pom.xml b/plugins/pi4j-plugin-linuxfs/pom.xml index 3c0b3d35..d9dc07d6 100644 --- a/plugins/pi4j-plugin-linuxfs/pom.xml +++ b/plugins/pi4j-plugin-linuxfs/pom.xml @@ -5,14 +5,14 @@ com.pi4j pi4j-plugin - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-plugin/pom.xml 4.0.0 pi4j-plugin-linuxfs - Pi4J :: PLUGIN :: LinuxFS I/O Providers + Pi4J :: PLUGIN :: LinuxFS I/O Providers Pi4J Library Plugin for Linux File System I/O Providers jar @@ -86,18 +86,20 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> - + diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/internal/LinuxPwm.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/internal/LinuxPwm.java index 90fb62ca..09ae48da 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/internal/LinuxPwm.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/internal/LinuxPwm.java @@ -71,6 +71,7 @@ public enum Polarity{ *

Constructor for LinuxPwm.

* * @param systemPath a {@link String} object. + * @param chip * @param address a int. */ public LinuxPwm(String systemPath, int chip, int address){ diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProvider.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProvider.java index d2a316f6..3b1a910f 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProvider.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProvider.java @@ -45,6 +45,7 @@ public interface LinuxFsDigitalInputProvider extends DigitalInputProvider { /** *

newInstance.

* + * @param gpioFileSystemPath * @return a {@link com.pi4j.plugin.linuxfs.provider.gpio.digital.LinuxFsDigitalInputProvider} object. */ static LinuxFsDigitalInputProvider newInstance(String gpioFileSystemPath) { diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProviderImpl.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProviderImpl.java index b43b4e72..87ddbda5 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProviderImpl.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalInputProviderImpl.java @@ -46,6 +46,7 @@ public class LinuxFsDigitalInputProviderImpl extends DigitalInputProviderBase im /** *

Constructor for LinuxFsDigitalInputProviderImpl.

+ * @param gpioFileSystemPath */ public LinuxFsDigitalInputProviderImpl(String gpioFileSystemPath) { this.id = ID; diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProvider.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProvider.java index e3ce0b85..6f0af455 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProvider.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProvider.java @@ -45,6 +45,7 @@ public interface LinuxFsDigitalOutputProvider extends DigitalOutputProvider { /** *

newInstance.

* + * @param gpioFileSystemPath * @return a {@link com.pi4j.plugin.linuxfs.provider.gpio.digital.LinuxFsDigitalOutputProvider} object. */ static LinuxFsDigitalOutputProvider newInstance(String gpioFileSystemPath) { diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProviderImpl.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProviderImpl.java index 07bf94ea..21cea185 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProviderImpl.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/gpio/digital/LinuxFsDigitalOutputProviderImpl.java @@ -47,6 +47,7 @@ public class LinuxFsDigitalOutputProviderImpl extends DigitalOutputProviderBase /** *

Constructor for LinuxFsDigitalOutputProviderImpl.

+ * @param gpioFileSystemPath */ public LinuxFsDigitalOutputProviderImpl(String gpioFileSystemPath) { this.id = ID; diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2C.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2C.java index 54b4b6e9..cb4bf185 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2C.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2C.java @@ -47,6 +47,7 @@ public class LinuxFsI2C extends I2CBase implements I2C { /** *

Constructor for PiGpioI2C.

* + * @param i2CBus * @param provider * a {@link I2CProvider} object. * @param config diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2CProviderImpl.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2CProviderImpl.java index 210c74e5..5ff211e8 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2CProviderImpl.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/i2c/LinuxFsI2CProviderImpl.java @@ -28,7 +28,6 @@ */ -import com.pi4j.boardinfo.util.BoardInfoHelper; import com.pi4j.context.Context; import com.pi4j.exception.ShutdownException; import com.pi4j.io.i2c.I2C; diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProvider.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProvider.java index 4bac274b..583a8646 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProvider.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProvider.java @@ -45,6 +45,8 @@ public interface LinuxFsPwmProvider extends PwmProvider { /** *

newInstance.

* + * @param pwmFileSystemPath + * @param pwmChip * @return a {@link LinuxFsPwmProvider} object. */ static LinuxFsPwmProvider newInstance(String pwmFileSystemPath, int pwmChip) { @@ -54,6 +56,7 @@ static LinuxFsPwmProvider newInstance(String pwmFileSystemPath, int pwmChip) { /** *

newInstance.

* + * @param pwmChip * @return a {@link LinuxFsPwmProvider} object. */ static LinuxFsPwmProvider newInstance(int pwmChip) { diff --git a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProviderImpl.java b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProviderImpl.java index 540c32b3..782cba64 100644 --- a/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProviderImpl.java +++ b/plugins/pi4j-plugin-linuxfs/src/main/java/com/pi4j/plugin/linuxfs/provider/pwm/LinuxFsPwmProviderImpl.java @@ -51,6 +51,8 @@ public class LinuxFsPwmProviderImpl extends PwmProviderBase implements LinuxFsPw /** *

Constructor for LinuxFsPwmProviderImpl.

+ * @param pwmFileSystemPath + * @param pwmChip */ public LinuxFsPwmProviderImpl(String pwmFileSystemPath, int pwmChip) { this.id = ID; @@ -67,6 +69,7 @@ public int getPriority() { /** *

Constructor for LinuxFsPwmProviderImpl.

+ * @param pwmFileSystemPath */ public LinuxFsPwmProviderImpl(String pwmFileSystemPath) { this.id = ID; diff --git a/plugins/pi4j-plugin-mock/pom.xml b/plugins/pi4j-plugin-mock/pom.xml index bbd8e287..5607d68c 100644 --- a/plugins/pi4j-plugin-mock/pom.xml +++ b/plugins/pi4j-plugin-mock/pom.xml @@ -5,14 +5,14 @@ pi4j-plugin com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-plugin/pom.xml 4.0.0 pi4j-plugin-mock - Pi4J :: PLUGIN :: Mock Platform & Providers + Pi4J :: PLUGIN :: Mock Platform & Providers Pi4J Library Plugin for the Mock I/O Platform &amp; Providers jar @@ -34,14 +34,15 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> pi4j-plugin com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-plugin/pom.xml 4.0.0 pi4j-plugin-pigpio - Pi4J :: PLUGIN :: PIGPIO I/O Providers + Pi4J :: PLUGIN :: PIGPIO I/O Providers Pi4J Plugin for the PIGPIO I/O Providers jar @@ -55,14 +55,15 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> * This listener implementation will forward pin change events received from PIGPIO * to registered Pi4J 'DigitalChangeEvent' event listeners on this digital pin. */ diff --git a/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/serial/PiGpioSerial.java b/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/serial/PiGpioSerial.java index db846a85..db58370c 100644 --- a/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/serial/PiGpioSerial.java +++ b/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/serial/PiGpioSerial.java @@ -37,8 +37,6 @@ import com.pi4j.library.pigpio.PiGpio; import com.pi4j.library.pigpio.PiGpioMode; -import java.io.IOException; - /** *

PiGpioSerial class.

* diff --git a/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/spi/PiGpioSpi.java b/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/spi/PiGpioSpi.java index 215a11eb..13fcad7e 100644 --- a/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/spi/PiGpioSpi.java +++ b/plugins/pi4j-plugin-pigpio/src/main/java/com/pi4j/plugin/pigpio/provider/spi/PiGpioSpi.java @@ -53,22 +53,22 @@ public class PiGpioSpi extends SpiBase implements Spi { * @param piGpio a {@link com.pi4j.library.pigpio.PiGpio} object. * @param provider a {@link com.pi4j.io.spi.SpiProvider} object. * @param config a {@link com.pi4j.io.spi.SpiConfig} object. - * + *

* ------------------------------------------------------------------ * spiFlags consists of the least significant 22 bits. * ------------------------------------------------------------------ * 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 * b b b b b b R T n n n n W A u2 u1 u0 p2 p1 p0 m m - * + *

* [mm] defines the SPI mode. * Warning: modes 1 and 3 do not appear to work on the auxiliary SPI. - * + *

* Mode POL PHA * 0 0 0 * 1 0 1 * 2 1 0 * 3 1 1 - * + *

* [px] is 0 if CEx is active low (default) and 1 for active high. * [ux] is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise. * [A] is 0 for the main SPI, 1 for the auxiliary SPI. diff --git a/plugins/pi4j-plugin-raspberrypi/pom.xml b/plugins/pi4j-plugin-raspberrypi/pom.xml index a3ec2db8..519e4242 100644 --- a/plugins/pi4j-plugin-raspberrypi/pom.xml +++ b/plugins/pi4j-plugin-raspberrypi/pom.xml @@ -5,14 +5,14 @@ pi4j-plugin com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../pi4j-plugin/pom.xml 4.0.0 pi4j-plugin-raspberrypi - Pi4J :: PLUGIN :: RaspberryPi Platform & Providers + Pi4J :: PLUGIN :: RaspberryPi Platform & Providers Pi4J Library Plugin for the RaspberryPi Platform & I/O Providers jar @@ -35,14 +35,15 @@ + classpathref="maven.plugin.classpath"/> - + - + verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/> pi4j-parent com.pi4j - 2.7.0-SNAPSHOT + 2.7.1-SNAPSHOT ../../pom.xml 4.0.0 pi4j-plugin - Pi4J :: PLUGIN :: Plugins Parent POM + Pi4J :: PLUGIN :: Plugins Parent POM Pi4J Plugin Parent Maven POM pom diff --git a/pom.xml b/pom.xml index 57e4b83a..3cad0495 100644 --- a/pom.xml +++ b/pom.xml @@ -1,22 +1,22 @@ - 4.0.0 - com.pi4j - pi4j-parent - 2.7.0-SNAPSHOT - Pi4J :: Parent POM - Parent Maven POM for the Pi4J Project - https://v2.pi4j.com - 2012 - pom - - - - Pi4J - https://v2.pi4j.com - - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.pi4j + pi4j-parent + 2.7.1-SNAPSHOT + Pi4J :: Parent POM + Parent Maven POM for the Pi4J Project + https://v2.pi4j.com + 2012 + pom + + + + Pi4J + https://v2.pi4j.com + + + Apache License, Version 2.0 @@ -26,25 +26,25 @@ - - - - Robert Savage - robert@pi4j.com - http://robertsavage.me + + + + Robert Savage + robert@pi4j.com + http://robertsavage.me Savage Software - http://savagesoftware.com + http://savagesoftware.com http://savagehomeautomation.com https://www.linkedin.com/in/robert-savage https://twitter.com/savageautomate - - sponsor - architect - developer - - + + sponsor + architect + developer + + Daniel Sendula daniel@pi4j.com @@ -66,16 +66,16 @@ developer - - eitch - Robert von Burg - eitch@eitchnet.ch - http://strolch.li - - developer - - +1 - + + eitch + Robert von Burg + eitch@eitchnet.ch + http://strolch.li + + developer + + +1 + alex9849 Alexander Liggesmeyer @@ -85,7 +85,7 @@ +1 - + Marcus Hirt @@ -109,33 +109,33 @@ - - - scm:git:ssh://git@github.com/Pi4J/pi4j-v2.git - scm:git:ssh://git@github.com/Pi4J/pi4j-v2.git - https://github.com/Pi4J/pi4j-v2.git - - - - - https://github.com/Pi4J/pi4j-v2/issues - github - - - - - https://pi4j.com/download - - sonatype-oss-staging - Sonatype Open Source Maven Repository - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - sonatype-oss-snapshots - Sonatype Open Source Maven Snapshots Repository - https://oss.sonatype.org/content/repositories/snapshots - - + + + scm:git:ssh://git@github.com/Pi4J/pi4j-v2.git + scm:git:ssh://git@github.com/Pi4J/pi4j-v2.git + https://github.com/Pi4J/pi4j-v2.git + + + + + https://github.com/Pi4J/pi4j-v2/issues + github + + + + + https://pi4j.com/download + + sonatype-oss-staging + Sonatype Open Source Maven Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2 + + + sonatype-oss-snapshots + Sonatype Open Source Maven Snapshots Repository + https://oss.sonatype.org/content/repositories/snapshots + + @@ -152,8 +152,8 @@ - - + + libraries/pi4j-library pi4j-core @@ -162,8 +162,8 @@ pi4j-distribution - - + + @@ -276,10 +276,11 @@ 3.3.0 5.1.2 3.13.0 + 3.6.0 3.1.2 3.2.1 3.4.2 - 3.2.0 + 3.6.3 3.0.0-M4 3.2.0 1.11.2 @@ -314,7 +315,7 @@ raspberry /home/pi/deploy - + @@ -399,21 +400,21 @@ - - + + - - - ${basedir} - false - - LICENSE.txt - NOTICE.txt - README.md - - - + + + ${basedir} + false + + LICENSE.txt + NOTICE.txt + README.md + + + @@ -502,6 +503,14 @@ + + ${java.version} + false + none + + false + -Xdoclint:none + @@ -698,50 +707,50 @@ - - - - org.apache.maven.plugins - maven-scm-plugin - - install - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - package - - attach-artifact - - - - - ${basedir}/LICENSE.txt - txt - license - - - ${basedir}/NOTICE.txt - txt - notice - - - ${basedir}/README.md - md - readme - - - - - - false - + + + + org.apache.maven.plugins + maven-scm-plugin + + install + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + package + + attach-artifact + + + + + ${basedir}/LICENSE.txt + txt + license + + + ${basedir}/NOTICE.txt + txt + notice + + + ${basedir}/README.md + md + readme + + + + + + false + org.apache.maven.plugins maven-enforcer-plugin @@ -761,9 +770,29 @@ - - - + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven-checkstyle-plugin.version} + + + checkstyle-check + + check + + validate + + + + true + config/checkstyle/checkstyle.xml + **/module-info.java + plain + true + + + +