Squashed commit of the following: commit 4359262e2fef69b1646e3d76641fe622a78dfd89 Author: Kevin O'Connor <koconnor@usfirst.org> Date: Wed Oct 29 13:43:12 2014 -0400 Add SerialPort to JNI and modify Java SerialPort to use it. Change-Id: Id3e6fa538a50e6a96274d8fb1be546dc396fc9c6 commit 114b192388c2fb01745cb3d5ad83612e9d66ea83 Author: Kevin O'Connor <koconnor@usfirst.org> Date: Tue Oct 28 15:46:06 2014 -0400 Move Serial port handling to HAL and define serial errors Change-Id: I4cc73b64d71aafacb410bce080cb29e5fdf565a3 Change-Id: I35b729ad502137ee4c877a415d78007861991e31
Purpose
The HAL is a hardware abstraction layer that provides a uniform interface that can be used to access a number of primarily I/O features in the underlying platform. The features include:
- Analog input, accumulation and triggers
- PWM, Relay and Solenoid output
- Digital input and output
- I2C and SPI communication
- Encoders and counters
- Interrupts and Notifiers
The initial goal is to allow a higher level like WPILib to support both the CRIO and the upcoming Athena platform only by changing which version of the HAL it's running on.
Editing
You can always use any text editor and then build with Maven. There
are also eclipse project files so that it can be edited in the same
eclipse environment that teams develop with. For the AthenaXX, this
can be found in the root directory of this project. It imports as an
FRC Robot C++ Eclipse project. The Windriver project can be imported
from the src directory.
Building with Maven
There are multiple build targets that the HAL supports. Instructions for setting up the environment and building each of these is described below. Current targets are listed below:
- All: All of the following targets.
- include: The header files for the HAL.
- Azalea: CRIO C++ build.
- AthenaXX: Athena Dos Equis C++ build.
- AthenaXXJava: Athena Dos Equis Java build with auto-generated JNA wrappers.
Output from each build target is placed in the directory
target/<target-name>. So, the Azalea output is placed in
target/Azalea.
All
Note: Windows only due to the Windriver requirement.
- Ensure that
C:\WindRiver\gnu\3.4.4-vxworks-6.3\x86-win32\binis on the system path so thatccppcandarppccan be accessed. - Set the environment variable
WIND_BASEtoC:\WindRiver\vxworks-6.3. - Ensure that
$HOME/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/bin/is on the system path so thatarm-none-linux-gnueabi-g++andarm-none-linux-gnueabi-arcan be accessed. - Checkout and install the NI-Libraries from Github: https://github.com/first/NI-Libraries.
- Run the following maven command:
mvn clean install - Success
include
cdinto the include directory:cd include- Run the following maven command:
mvn clean install - Success
Azalea
Note: Windows only.
- Ensure that
C:\WindRiver\gnu\3.4.4-vxworks-6.3\x86-win32\binis on the system path so thatccppcandarppccan be accessed. - Set the environment variable
WIND_BASEtoC:\WindRiver\vxworks-6.3. cdinto the AthenaXX directory:cd AthenaXXcdinto the Azalea directory:cd Azalea- Run the following maven command:
mvn clean install - Success
AthenaXX
- Ensure that
$HOME/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/bin/is on the system path so thatarm-none-linux-gnueabi-g++andarm-none-linux-gnueabi-arcan be accessed. - Install the include target.
cdinto the AthenaXX directory:cd AthenaXX- Run the following maven command:
mvn clean install - Success
AthenaXXJava
- Ensure that
$HOME/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/bin/is on the system path so thatarm-none-linux-gnueabi-g++andarm-none-linux-gnueabi-arcan be accessed. - Checkout and install the NI-Libraries from Github: https://github.com/first/NI-Libraries.
- Install the include target.
cdinto the AthenaXXJava directory:cd AthenaXXJava- Run the following maven command:
mvn clean install - Success