mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Compare commits
235 Commits
2014-simul
...
test-tag
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8856927fd8 | ||
|
|
66e1f2a184 | ||
|
|
1301d76d61 | ||
|
|
a72ea14f92 | ||
|
|
14b2f14669 | ||
|
|
d2cd5f3571 | ||
|
|
7ecde3a33a | ||
|
|
81143fc534 | ||
|
|
c58a86a3ab | ||
|
|
2f655bb49d | ||
|
|
657054c9e2 | ||
|
|
f4d542b212 | ||
|
|
8db11a4c6c | ||
|
|
14d784bca1 | ||
|
|
7c8124d76c | ||
|
|
b371600f0f | ||
|
|
6c3b002a87 | ||
|
|
0f93247641 | ||
|
|
54439e7198 | ||
|
|
5b8279f404 | ||
|
|
8abbcf53f4 | ||
|
|
b8eeeabbb5 | ||
|
|
9a2bd8c49b | ||
|
|
4db634b342 | ||
|
|
57e670c18d | ||
|
|
59473ab7a7 | ||
|
|
d1d4c75210 | ||
|
|
2356008d8c | ||
|
|
deb335d96d | ||
|
|
1ce03b9c46 | ||
|
|
a09f75934a | ||
|
|
aab98c0638 | ||
|
|
741e28b855 | ||
|
|
f817f6d041 | ||
|
|
7442a7ed7d | ||
|
|
765198f5f5 | ||
|
|
ed08ab2989 | ||
|
|
4b22742cdc | ||
|
|
45f93e9aba | ||
|
|
049377c9ea | ||
|
|
f4ace4a36d | ||
|
|
9ff420547a | ||
|
|
1be31431bc | ||
|
|
32cafd0efc | ||
|
|
0216d1b336 | ||
|
|
43c566bd86 | ||
|
|
b86c747226 | ||
|
|
60a3fd0698 | ||
|
|
b86c114939 | ||
|
|
14f201cd36 | ||
|
|
c49ea255b9 | ||
|
|
065e1c24eb | ||
|
|
ecdb77e4be | ||
|
|
10aad6d1c8 | ||
|
|
e73c8d06eb | ||
|
|
dc341a448e | ||
|
|
d521eb79b9 | ||
|
|
f57a2dc5a9 | ||
|
|
7006d1ebc4 | ||
|
|
c32e5707d4 | ||
|
|
c27da3587d | ||
|
|
f18cccbc30 | ||
|
|
b91b681430 | ||
|
|
b26667f866 | ||
|
|
792e3b6ccc | ||
|
|
fd4379a946 | ||
|
|
a40cdf5197 | ||
|
|
ba4e74d299 | ||
|
|
38583789be | ||
|
|
45e43b627f | ||
|
|
e837d9083a | ||
|
|
e0e2b498a5 | ||
|
|
8fe888dbc9 | ||
|
|
41bb0da4e6 | ||
|
|
97ade3606e | ||
|
|
2735406bfb | ||
|
|
ab04e19aae | ||
|
|
a58288ae6d | ||
|
|
7905259e21 | ||
|
|
f018689d0e | ||
|
|
0bb13d86ea | ||
|
|
526df3679a | ||
|
|
d8da3e5f1f | ||
|
|
c0af235050 | ||
|
|
7f6ca6824e | ||
|
|
231bb55b2a | ||
|
|
76e488061d | ||
|
|
5e8ea38465 | ||
|
|
a5b72d62a1 | ||
|
|
a5e15b16fd | ||
|
|
264c38a674 | ||
|
|
20de3abe80 | ||
|
|
3536d47835 | ||
|
|
60a294fbad | ||
|
|
dc42a1129f | ||
|
|
386dc1f16b | ||
|
|
038478e437 | ||
|
|
26e90a988b | ||
|
|
d5cd47bfa1 | ||
|
|
1e35ef7802 | ||
|
|
65607b5bc1 | ||
|
|
30c0cc0561 | ||
|
|
92bd697417 | ||
|
|
ed0df5432f | ||
|
|
6deb196e90 | ||
|
|
8b612f713b | ||
|
|
d66bafb687 | ||
|
|
78d2ccd299 | ||
|
|
06d59447be | ||
|
|
3475a4a8c6 | ||
|
|
6af242b556 | ||
|
|
c72e704396 | ||
|
|
89fe909ae6 | ||
|
|
c1d8e4ef4b | ||
|
|
338120c3a5 | ||
|
|
a7efbe0d7a | ||
|
|
4c78280308 | ||
|
|
5a3889a3aa | ||
|
|
2fd4964b62 | ||
|
|
6ae6394548 | ||
|
|
310151132d | ||
|
|
7f4e1e39ae | ||
|
|
eebdc3d20c | ||
|
|
980ea96b05 | ||
|
|
1038f98e83 | ||
|
|
326aa2e85c | ||
|
|
6071fc7fb3 | ||
|
|
f958b65ba6 | ||
|
|
f4f7588cfb | ||
|
|
80ecff6bdb | ||
|
|
e487c950e9 | ||
|
|
191e9d5d6b | ||
|
|
40fc8326aa | ||
|
|
fdbe750d3d | ||
|
|
3ec797a8cf | ||
|
|
78e6cf7208 | ||
|
|
2481e98bc8 | ||
|
|
c81d510ebe | ||
|
|
3fb4159101 | ||
|
|
2e1bd171a5 | ||
|
|
25e7a077c1 | ||
|
|
dc48dc7f7b | ||
|
|
2dd45c3ea6 | ||
|
|
461e359484 | ||
|
|
78dac49cf6 | ||
|
|
66ba9a728e | ||
|
|
c3d1e80a62 | ||
|
|
01ca19f78f | ||
|
|
202bfb2959 | ||
|
|
b0369342e9 | ||
|
|
26d101caf9 | ||
|
|
e84e0ebab8 | ||
|
|
0704a697ce | ||
|
|
13f97bb6e3 | ||
|
|
5eddb69aa0 | ||
|
|
41c2b9402c | ||
|
|
99632e003b | ||
|
|
fe12394c93 | ||
|
|
fbf196763f | ||
|
|
b5fb35c0c4 | ||
|
|
48e8b2136e | ||
|
|
e962c770bb | ||
|
|
1b7a352cbb | ||
|
|
1a77cea13a | ||
|
|
afa39deec5 | ||
|
|
f27e16735f | ||
|
|
d8a5ced015 | ||
|
|
8fe606a4b1 | ||
|
|
6053a0cc24 | ||
|
|
be106b3527 | ||
|
|
ebaf2ef058 | ||
|
|
9f1a9a07c9 | ||
|
|
ec2a455bc7 | ||
|
|
3d740a9a25 | ||
|
|
1dd1e0be1e | ||
|
|
437e3ff266 | ||
|
|
f373c8708d | ||
|
|
54a657a7d4 | ||
|
|
60d8508a65 | ||
|
|
02a28c8f04 | ||
|
|
b128828977 | ||
|
|
1a1a12316b | ||
|
|
d0fdb3e704 | ||
|
|
5d2e20eaec | ||
|
|
fc0eb4e956 | ||
|
|
968b69d37d | ||
|
|
343c7f4f3e | ||
|
|
80c5c09f77 | ||
|
|
cb9df310dc | ||
|
|
f566c087dc | ||
|
|
7ca1b498e4 | ||
|
|
8bba58b9ab | ||
|
|
8ae64a12ea | ||
|
|
3b4718fc92 | ||
|
|
5800af49bc | ||
|
|
63fc4f6cfb | ||
|
|
8b770ffb41 | ||
|
|
55fde6b616 | ||
|
|
5ddacb43c1 | ||
|
|
65c3c0ba09 | ||
|
|
fc3ed33f77 | ||
|
|
255a3a5b12 | ||
|
|
0ef5c3adfa | ||
|
|
37ebcabc4a | ||
|
|
244ee8d920 | ||
|
|
b97d2eb0c3 | ||
|
|
ae8d22b0f2 | ||
|
|
ff8016c088 | ||
|
|
f0fb3023ad | ||
|
|
1d33edffee | ||
|
|
5bd546f1fd | ||
|
|
d8003899f5 | ||
|
|
f7bb5cd8f6 | ||
|
|
4f2d1d9d32 | ||
|
|
981f941caf | ||
|
|
5ca2506a7b | ||
|
|
25f65a1581 | ||
|
|
15212967ec | ||
|
|
2aa0301707 | ||
|
|
455506976c | ||
|
|
ef5729b3dd | ||
|
|
256b052a55 | ||
|
|
56cf731680 | ||
|
|
0926fa4937 | ||
|
|
4de246876a | ||
|
|
130485d760 | ||
|
|
3b6e5b9b12 | ||
|
|
b2000a20d0 | ||
|
|
9e6d04b2e8 | ||
|
|
f380d9c102 | ||
|
|
1ba20bc1eb | ||
|
|
a0799718f6 | ||
|
|
afe1b0b342 | ||
|
|
072b92e55a | ||
|
|
b27791544b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,6 +11,7 @@ bin/
|
||||
.cproject
|
||||
.settings/
|
||||
.classpath
|
||||
**/dependency-reduced-pom.xml
|
||||
|
||||
#Java File extentions
|
||||
*.class
|
||||
|
||||
13
.hgignore
13
.hgignore
@@ -1,13 +0,0 @@
|
||||
syntax: re
|
||||
^\.hgignore$
|
||||
.*/target(?:/|$)
|
||||
.*/dist(?:/|$)
|
||||
eclipse-plugins/.*/bin(?:/|$)
|
||||
|
||||
syntax: glob
|
||||
wpilibc/build/
|
||||
hal/build/
|
||||
networktables/cpp/build/
|
||||
build/
|
||||
networktables/OutlineViewer/nbproject/private
|
||||
*~
|
||||
@@ -1,10 +1,11 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(All-WPILib)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wextra -Wno-unused-parameter -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wall -Wextra -Wno-unused-parameter -fPIC")
|
||||
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
|
||||
file(GLOB_RECURSE NI_LIBS ni-libraries/*.so*)
|
||||
get_filename_component(WPILIB_INCLUDES wpilibc/wpilibC++/include REALPATH)
|
||||
get_filename_component(HAL_API_INCLUDES hal/include REALPATH)
|
||||
get_filename_component(NWT_API_INCLUDES networktables/cpp/include REALPATH)
|
||||
add_subdirectory(hal)
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
|
||||
if [ $(which sshpass) ]
|
||||
then
|
||||
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram
|
||||
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
|
||||
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram $*
|
||||
# Send stderr to /dev/null - the only thing printed to it is the login prompt
|
||||
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram java 2> /dev/null
|
||||
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin 2> /dev/null
|
||||
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram --gtest_color=yes $* 2> /dev/null
|
||||
else
|
||||
ssh admin@10.1.90.2 killall FRCUserProgram
|
||||
scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
|
||||
ssh admin@10.1.90.2 ./FRCUserProgram $*
|
||||
ssh admin@10.1.90.2 ./FRCUserProgram --gtest_color=yes $*
|
||||
fi
|
||||
|
||||
|
||||
|
||||
3
eclipse-plugins/.gitattributes
vendored
3
eclipse-plugins/.gitattributes
vendored
@@ -1,3 +1,4 @@
|
||||
*runcppprogram text eol=lf
|
||||
*runjavaprogram text eol=lf
|
||||
|
||||
*robotCommand text eol=lf
|
||||
*robotDebugCommand text eol=lf
|
||||
|
||||
@@ -124,7 +124,7 @@ public class WPILibCore extends AbstractUIPlugin {
|
||||
return target;
|
||||
else {
|
||||
int teamNumber = getTeamNumber(project);
|
||||
return "10." + (teamNumber / 100) + "." + (teamNumber % 100) + ".2";
|
||||
return "roborio-" + teamNumber + ".local";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,15 +35,15 @@ public class NewProjectMainPage extends WizardPage {
|
||||
private Text worldText;
|
||||
private Button worldButton;
|
||||
|
||||
Button simpleRobot, iterativeRobot, commandRobot;
|
||||
Button iterativeRobot, commandRobot;
|
||||
private boolean showPackage;
|
||||
private boolean showProjectTypes;
|
||||
private TeamNumberPage teamNumberPage;
|
||||
|
||||
/**
|
||||
* Constructor for SampleNewWizardPage.
|
||||
* @param teamNumberPage
|
||||
*
|
||||
* @param teamNumberPage
|
||||
*
|
||||
* @param pageName
|
||||
*/
|
||||
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage) {
|
||||
@@ -77,7 +77,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
if (showPackage) {
|
||||
label = new Label(container, SWT.NULL);
|
||||
label.setText("&Package:");
|
||||
|
||||
|
||||
packageText = new Text(container, SWT.BORDER | SWT.SINGLE);
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
packageText.setLayoutData(gd);
|
||||
@@ -87,7 +87,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (showProjectTypes) {
|
||||
Group projectTypeGroup = new Group(container, SWT.BORDER);
|
||||
projectTypeGroup.setText("Project Type");
|
||||
@@ -97,21 +97,13 @@ public class NewProjectMainPage extends WizardPage {
|
||||
GridLayout groupLayout = new GridLayout();
|
||||
groupLayout.numColumns = 1;
|
||||
projectTypeGroup.setLayout(groupLayout);
|
||||
|
||||
simpleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
//simpleRobot.setData( RWT.MARKUP_ENABLED, Boolean.TRUE );
|
||||
simpleRobot.setText("Simple Robot: A flexible robot project intended for robots that implement basic functionality. Can also be used as a starting point for teams with a custom framework.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
simpleRobot.setLayoutData(gd);
|
||||
simpleRobot.setSelection(true);
|
||||
|
||||
|
||||
iterativeRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
iterativeRobot.setText("Iterative Robot: A robot project that allows robots to be implemented in an iterative manner.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.widthHint = 300;
|
||||
iterativeRobot.setLayoutData(gd);
|
||||
|
||||
|
||||
commandRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
|
||||
commandRobot.setText("Command-Based Robot: A robot project that allows robots to be implemented using the command based model to allow complex functionality to be developed from simpler functionality.");
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
@@ -121,7 +113,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
|
||||
label = new Label(container, SWT.NULL);
|
||||
label.setText("Simulation &World:");
|
||||
|
||||
|
||||
|
||||
Composite comp = new Composite(container, SWT.NULL);
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
@@ -144,7 +136,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
browse();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
initialize();
|
||||
dialogChanged();
|
||||
setControl(container);
|
||||
@@ -162,7 +154,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
@Override public void stateChanged(ChangeEvent e) {
|
||||
String teamNumber = TeamNumberPage.getTeamNumberFromPage(teamNumberPage);
|
||||
packageText.setText("org.usfirst.frc.team"+teamNumber+".robot");
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -174,7 +166,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
*/
|
||||
private void dialogChanged() {
|
||||
String projectName = getProjectName();
|
||||
|
||||
|
||||
String packageString = "";
|
||||
if (showPackage) packageString = getPackage();
|
||||
|
||||
@@ -190,7 +182,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
updateStatus("Must be valid java package");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
updateStatus(null);
|
||||
}
|
||||
|
||||
@@ -203,7 +195,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
String result = dialog.open();
|
||||
if (result != null) {
|
||||
worldText.setText(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateStatus(String message) {
|
||||
@@ -218,10 +210,9 @@ public class NewProjectMainPage extends WizardPage {
|
||||
public String getPackage() {
|
||||
return packageText.getText();
|
||||
}
|
||||
|
||||
|
||||
public ProjectType getProjectType() {
|
||||
if (!showProjectTypes) return null;
|
||||
else if (simpleRobot.getSelection()) return types.get(ProjectType.SIMPLE);
|
||||
else if (iterativeRobot.getSelection()) return types.get(ProjectType.ITERATIVE);
|
||||
else return types.get(ProjectType.COMMAND_BASED);
|
||||
}
|
||||
@@ -237,7 +228,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
public void setShowProjectTypes(boolean bool) {
|
||||
showProjectTypes = bool;
|
||||
}
|
||||
|
||||
|
||||
public void setProjectTypes(Map<String, ProjectType> types) {
|
||||
showProjectTypes = true;
|
||||
this.types = types;
|
||||
|
||||
@@ -67,12 +67,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.CommandWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -80,12 +89,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.CommandGroupWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -93,12 +111,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.SubsystemWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -106,12 +133,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.PIDSubsystemWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
<commonWizard
|
||||
@@ -119,12 +155,21 @@
|
||||
type="new"
|
||||
wizardId="edu.wpi.first.wpilib.plugins.cpp.wizards.file_template.TriggerWizard">
|
||||
<enablement>
|
||||
<with
|
||||
variable="activeWorkbenchWindow.activePerspective">
|
||||
<equals
|
||||
value="org.eclipse.cdt.ui.CPerspective">
|
||||
</equals>
|
||||
</with>
|
||||
<with
|
||||
variable="selection">
|
||||
<iterate>
|
||||
<and>
|
||||
<test
|
||||
value="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
<test
|
||||
value="org.eclipse.cdt.core.cnature"
|
||||
property="org.eclipse.core.resources.projectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate>
|
||||
</with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
</extension>
|
||||
@@ -147,10 +192,10 @@
|
||||
point="org.eclipse.debug.ui.launchShortcuts">
|
||||
<shortcut
|
||||
class="edu.wpi.first.wpilib.plugins.cpp.launching.DeployLaunchShortcut"
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
icon="resources/icons/wpi.ico"
|
||||
id="edu.wpi.first.wpilib.plugins.cpp.launching.deploy"
|
||||
label="WPILib Deploy Configure Builder"
|
||||
label="WPILib C++ Deploy"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
@@ -172,20 +217,20 @@
|
||||
</enablement>
|
||||
</contextualLaunch>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
mode="run">
|
||||
</description>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board and debug it."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
mode="debug">
|
||||
</description>
|
||||
</shortcut>
|
||||
<shortcut
|
||||
class="edu.wpi.first.wpilib.plugins.cpp.launching.SimulateLaunchShortcut"
|
||||
description="Test the WPILib project using the Gazebo simulator."
|
||||
icon="resources/icons/wpi.ico"
|
||||
icon="resources/icons/Gazebo.png"
|
||||
id="edu.wpi.first.wpilib.plugins.cpp.launching.simulate"
|
||||
label="WPILib Simulate"
|
||||
label="WPILib C++ Simulation"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 780 B |
@@ -28,6 +28,7 @@
|
||||
<option id="gnu.cpp.compiler.option.optimization.level.549514425" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.1682909384" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.option.include.paths.1597382905" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}/src""/>
|
||||
<listOptionValue builtIn="false" value="$cpp-location/include"/>
|
||||
</option>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.963785380" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
||||
@@ -38,10 +39,11 @@
|
||||
<listOptionValue builtIn="false" value="$cpp-location/lib"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.libs.1072058280" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="WPILibAthena"/>
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="HALAthena"/>
|
||||
<listOptionValue builtIn="false" value="NetworkTables"/>
|
||||
<listOptionValue builtIn="false" value="FRC_FPGA_ChipObject"/>
|
||||
<listOptionValue builtIn="false" value="FRC_NetworkCommunication"/>
|
||||
<listOptionValue builtIn="false" value="i2c"/>
|
||||
<listOptionValue builtIn="false" value="ni_emb"/>
|
||||
@@ -58,6 +60,7 @@
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.flags.1747959472" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath-link,$cpp-location/lib" valueType="string"/>
|
||||
<option id="gnu.cpp.link.option.other.1891020896" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-export-dynamic"/>
|
||||
</option>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1757265359" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
@@ -167,7 +170,9 @@
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.66697269" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
|
||||
<tool command="g++" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.tool.gnu.cpp.linker.base.2094820582" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
|
||||
<option id="gnu.cpp.link.option.libs.1563598353" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="WPILibSim"/>
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="gazebo"/>
|
||||
<listOptionValue builtIn="false" value="gazebo_transport"/>
|
||||
<listOptionValue builtIn="false" value="gazebo_msgs"/>
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
username=admin
|
||||
password=
|
||||
deploy.dir=/home/admin
|
||||
deploy.run.command=./runcppprogram
|
||||
deploy.debug.command=./debugcppprogram
|
||||
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
|
||||
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
|
||||
command.dir=/home/lvuser/
|
||||
|
||||
# Libraries to use
|
||||
wpilib=${user.home}/wpilib/cpp/${cpp-version}
|
||||
@@ -21,8 +22,8 @@ build.dir=build
|
||||
out.exe=Debug/${out}
|
||||
|
||||
# Simulation
|
||||
simulation.world.file=$world
|
||||
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
|
||||
sim.exe=Simulate/${out}
|
||||
wpilib.sim=${wpilib}/sim
|
||||
sim.tools=${wpilib.sim}/tools
|
||||
sim.lib=${wpilib.sim}/lib
|
||||
sim.lib=${wpilib.sim}/lib
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
ExampleSubsystem* CommandBase::examplesubsystem = NULL;
|
||||
OI* CommandBase::oi = NULL;
|
||||
|
||||
CommandBase::CommandBase(std::string name) :
|
||||
CommandBase::CommandBase(char const *name) :
|
||||
Command(name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class CommandBase: public Command
|
||||
{
|
||||
public:
|
||||
CommandBase(std::string name);
|
||||
CommandBase(char const *name);
|
||||
CommandBase();
|
||||
static void init();
|
||||
// Create a single static instance of all of your subsystems
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#include "Commands/Shoot.h"
|
||||
|
||||
DriveAndShootAutonomous::DriveAndShootAutonomous() {
|
||||
AddSequential(new CloseClaw());
|
||||
AddSequential(new WaitForPressure(), 2);
|
||||
#ifdef REAL
|
||||
// NOTE: Simulation doesn't currently have the concept of hot.
|
||||
AddSequential(new CheckForHotGoal(2));
|
||||
#endif
|
||||
AddSequential(new CloseClaw());
|
||||
AddSequential(new SetPivotSetpoint(45));
|
||||
AddSequential(new DriveForward(8, 0.4));
|
||||
AddSequential(new DriveForward(8, 0.3));
|
||||
AddSequential(new Shoot());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ DriveTrain::DriveTrain() :
|
||||
|
||||
// Configure encoders
|
||||
rightEncoder = new Encoder(1, 2, true, Encoder::k4X);
|
||||
leftEncoder = new Encoder(5, 6, false, Encoder::k4X); // TODO: Correct encoder module.
|
||||
leftEncoder = new Encoder(3, 4, false, Encoder::k4X);
|
||||
rightEncoder->SetPIDSourceParameter(PIDSource::kDistance);
|
||||
leftEncoder->SetPIDSourceParameter(PIDSource::kDistance);
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ Pivot::Pivot() :
|
||||
GetPIDController()->SetContinuous(false);
|
||||
#ifdef SIMULATION
|
||||
// PID is different in simulation.
|
||||
GetPIDController()->SetPID(0.5, 0.00001, 4.5);
|
||||
SetAbsoluteTolerance(2.5);
|
||||
GetPIDController()->SetPID(0.5, 0.001, 2);
|
||||
SetAbsoluteTolerance(5);
|
||||
#endif
|
||||
|
||||
// Motor to move the pivot.
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of the RobotBase class.
|
||||
* The SimpleRobot class is the base of a robot application that will automatically call your
|
||||
* This is a demo program showing the use of the RobotDrive class.
|
||||
* The SampleRobot class is the base of a robot application that will automatically call your
|
||||
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
|
||||
* the driver station or the field controls.
|
||||
*
|
||||
* WARNING: While it may look like a good choice to use for your code if you're inexperienced,
|
||||
* don't. Unless you know what you are doing, complex code will be much more difficult under
|
||||
* this system. Use IterativeRobot or Command-Based instead if you're new.
|
||||
*/
|
||||
class Robot: public SimpleRobot
|
||||
class Robot: public SampleRobot
|
||||
{
|
||||
RobotDrive myRobot; // robot drive system
|
||||
Joystick stick; // only joystick
|
||||
@@ -31,7 +35,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motors with arcade steering.
|
||||
* Runs the motors with arcade steering.
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
@@ -48,7 +52,6 @@ public:
|
||||
*/
|
||||
void Test()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@ package edu.wpi.first.wpilib.plugins.cpp.launching;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||
import org.eclipse.cdt.debug.core.executables.Executable;
|
||||
@@ -28,12 +29,13 @@ import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
|
||||
import edu.wpi.first.wpilib.plugins.core.launching.AntLauncher;
|
||||
|
||||
/**
|
||||
* Launch shortcut base functionality, common for deploying to the robot.
|
||||
* Retrieves the project the operation is being called on, and runs the correct
|
||||
* ant targets based on polymorphically determined data values
|
||||
*
|
||||
*
|
||||
* @author Ryan O'Meara
|
||||
* @author Alex Henning
|
||||
*/
|
||||
@@ -46,7 +48,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
/**
|
||||
* Returns the launch type of the shortcut that was used, one of the
|
||||
* constants defined in BaseLaunchShortcut
|
||||
*
|
||||
*
|
||||
* @return Launch shortcut type
|
||||
*/
|
||||
public String getLaunchType()
|
||||
@@ -91,7 +93,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param activeProj
|
||||
* The project that the script will be run on/from
|
||||
* @param mode
|
||||
@@ -99,23 +101,34 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
* ILaunchManager.DEBUG_MODE)
|
||||
*/
|
||||
public void runConfig(IProject activeProj, String mode, Shell shell) {
|
||||
// TODO: figure out UI issues. that's why this is undocumented
|
||||
ILaunchConfigurationWorkingCopy config;
|
||||
try {
|
||||
config = getRemoteDebugConfig(activeProj);
|
||||
//config.doSave(); // NOTE: For debugging
|
||||
//org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager().addLaunch(config.launch(mode, null));
|
||||
//THIS IS MADDENING! we want to add to the recent history, but I can't seem to find a public api to do so, so lets just launch the config dialog
|
||||
//DebugUITools.openLaunchConfigurationPropertiesDialog(shell, config, "org.eclipse.cdt.launch.launchGroup");
|
||||
//config.launch(mode, new NullProgressMonitor(), false, true);
|
||||
DebugUITools.launch(config, mode);
|
||||
} catch (CoreException e) {
|
||||
WPILibCPPPlugin.logError("Debug attach failed.", e);
|
||||
if(mode.equals(ILaunchManager.RUN_MODE)) {
|
||||
// Regular deploys are done with an ant script for now, for both
|
||||
// C++ and Java.
|
||||
WPILibCPPPlugin.logInfo("Running ant file: " + activeProj.getLocation().toOSString() + File.separator + "build.xml");
|
||||
WPILibCPPPlugin.logInfo("Targets: deploy, Mode: " + mode);
|
||||
AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), "deploy", null, mode);
|
||||
} else {
|
||||
// Debug deploys are done with the Eclipse Remote System Explorer,
|
||||
// which lets it work with Eclipse's C++ debugger.
|
||||
|
||||
// TODO: figure out UI issues. that's why this is undocumented
|
||||
ILaunchConfigurationWorkingCopy config;
|
||||
try {
|
||||
config = getRemoteDebugConfig(activeProj);
|
||||
//config.doSave(); // NOTE: For debugging
|
||||
//org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager().addLaunch(config.launch(mode, null));
|
||||
//THIS IS MADDENING! we want to add to the recent history, but I can't seem to find a public api to do so, so lets just launch the config dialog
|
||||
//DebugUITools.openLaunchConfigurationPropertiesDialog(shell, config, "org.eclipse.cdt.launch.launchGroup");
|
||||
//config.launch(mode, new NullProgressMonitor(), false, true);
|
||||
DebugUITools.launch(config, mode);
|
||||
} catch (CoreException e) {
|
||||
WPILibCPPPlugin.logError("Debug attach failed.", e);
|
||||
}
|
||||
|
||||
try {
|
||||
activeProj.refreshLocal(Resource.DEPTH_INFINITE, null);
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
try {
|
||||
activeProj.refreshLocal(Resource.DEPTH_INFINITE, null);
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
private ILaunchConfigurationWorkingCopy getRemoteDebugConfig(IProject activeProj) throws CoreException
|
||||
@@ -128,7 +141,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
ILaunchConfigurationWorkingCopy config = type.newInstance(null, activeProj.getName());
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, activeProj.getName());
|
||||
Collection<Executable> exes = ExecutablesManager.getExecutablesManager().getExecutablesForProject(activeProj);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
|
||||
exes.size() > 0 ? exes.toArray(new Executable[0])[0].getPath().makeRelativeTo(activeProj.getLocation()).toString():
|
||||
"Debug/FRCUserProgram");
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/admin/FRCUserProgram");
|
||||
|
||||
@@ -8,13 +8,6 @@ import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
|
||||
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
|
||||
|
||||
public class CPPProjectType implements ProjectType {
|
||||
static ProjectType SIMPLE = new CPPProjectType() {
|
||||
@Override public Map<String, String> getFiles(String packageName) {
|
||||
Map<String, String> files = super.getFiles(packageName);
|
||||
files.put("src/Robot.cpp", "simple/Robot.cpp");
|
||||
return files;
|
||||
}
|
||||
};
|
||||
static ProjectType ITERATIVE = new CPPProjectType() {
|
||||
@Override public Map<String, String> getFiles(String packageName) {
|
||||
Map<String, String> files = super.getFiles(packageName);
|
||||
@@ -47,7 +40,6 @@ public class CPPProjectType implements ProjectType {
|
||||
};
|
||||
@SuppressWarnings("serial")
|
||||
static Map<String, ProjectType> TYPES = new HashMap<String, ProjectType>() {{
|
||||
put(ProjectType.SIMPLE, SIMPLE);
|
||||
put(ProjectType.ITERATIVE, ITERATIVE);
|
||||
put(ProjectType.COMMAND_BASED, COMMAND_BASED);
|
||||
}};
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project name="athena-project-build" default="deploy">
|
||||
|
||||
<property file="${wpilib.ant.dir}/../so.properties"/>
|
||||
<property name="opkg.name" value="wpilib" />
|
||||
<property name="opkg.arch" value="armv7a-vfp" />
|
||||
|
||||
|
||||
<!-- Load Tasks -->
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
||||
<classpath>
|
||||
@@ -23,107 +19,34 @@
|
||||
<!-- Targets -->
|
||||
|
||||
<target name="get-target-ip">
|
||||
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
|
||||
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
|
||||
<property name="target" value="10.${ip.upper}.${ip.lower}.2" />
|
||||
<echo>Target IP: ${target}</echo>
|
||||
<property name="target" value="roboRIO-${team-number}.local" />
|
||||
<echo>Target: ${target}</echo>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="deploy" depends="get-target-ip" description="Deploy the progam and start it running.">
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="rm ${deploy.dir}/FRCUserProgram" />
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
failonerror="no"
|
||||
command="rm ${deploy.dir}/FRCUserProgram" />
|
||||
|
||||
<echo>[athena-deploy] Copying code over.</echo>
|
||||
<scp file="${out.exe}" sftp="true" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="opkg info wpilib |grep Version | awk '{printf $2}'"
|
||||
outputproperty="installedWpilibSo"/>
|
||||
<if>
|
||||
<equals arg1="${installedWpilibSo}" arg2="${cpp-sos}" />
|
||||
<then>
|
||||
|
||||
<echo>Found version of WPILib: ${installedWpilibSo} (latest)</echo>
|
||||
</then>
|
||||
<else>
|
||||
<echo>Found version of WPILib: ${installedWpilibSo}</echo>
|
||||
<echo>Upgrading WPILib to ${cpp-sos}...</echo>
|
||||
<delete>
|
||||
<fileset dir="${wpilib.ant.dir}">
|
||||
<include name="data.tar*" />
|
||||
<include name="control*" />
|
||||
<include name="post*" />
|
||||
<include name="md5sums" />
|
||||
<include name="*.deb" />
|
||||
</fileset>
|
||||
</delete>
|
||||
<tar destfile="${wpilib.ant.dir}/data.tar">
|
||||
<tarfileset dir="${wpilib.ant.dir}/../lib" username="root" group="admin" uid="0" gid="0"
|
||||
prefix="usr/local/frc/lib">
|
||||
<include name="libWPILibAthena.so" />
|
||||
<include name="libNetworkTables.so" />
|
||||
<include name="libHALAthena.so" />
|
||||
</tarfileset>
|
||||
</tar>
|
||||
<gzip destfile="${wpilib.ant.dir}/data.tar.gz" src="${wpilib.ant.dir}/data.tar"/>
|
||||
<echo file="${wpilib.ant.dir}/debian-binary">2.0</echo>
|
||||
<echo file="${wpilib.ant.dir}/control">Package: ${opkg.name}
|
||||
Version: ${cpp-sos}
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Architecture: ${opkg.arch}
|
||||
Depends: libc6 (>= 2.11.1-r7), libgcc1 (>= 4.4.1)
|
||||
Maintainer: Brad Miller >bamiller@wpi.edu<
|
||||
Description: WPILib, NetworkTables and HAL for RoboRIO target
|
||||
.
|
||||
This package contains the shared objects for WPILib, NetworkTables, and HAL for the 2015 target on the RoboRIO
|
||||
</echo>
|
||||
<echo file="${wpilib.ant.dir}/postinst">#!/bin/sh
|
||||
ldconfig
|
||||
</echo>
|
||||
<echo file="${wpilib.ant.dir}/postrm">#!/bin/sh
|
||||
ldconfig
|
||||
</echo>
|
||||
<checksum property="md5.wpilib" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libWPILibAthena.so" />
|
||||
<checksum property="md5.nwt" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libNetworkTables.so" />
|
||||
<checksum property="md5.hal" format="MD5SUM" file="${wpilib.ant.dir}/../lib/libHALAthena.so" />
|
||||
<echo file="${wpilib.ant.dir}/md5sums">${md5.wpilib} usr/local/frc/lib/libWPILibAthena.so
|
||||
${md5.nwt} usr/local/frc/lib/libNetworkTables.so
|
||||
${md5.hal} usr/local/frc/lib/libHALAthena.so</echo>
|
||||
<tar destfile="${wpilib.ant.dir}/control.tar">
|
||||
<tarfileset dir="${wpilib.ant.dir}" username="root" group="admin" uid="0" gid="0"
|
||||
prefix="">
|
||||
<include name="control" />
|
||||
<include name="md5sums" />
|
||||
</tarfileset>
|
||||
<tarfileset dir="${wpilib.ant.dir}" filemode="755" username="root" group="admin" uid="0" gid="0"
|
||||
prefix="">
|
||||
<include name="postinst" />
|
||||
<include name="postrm" />
|
||||
</tarfileset>
|
||||
</tar>
|
||||
<gzip destfile="${wpilib.ant.dir}/control.tar.gz" src="${wpilib.ant.dir}/control.tar"/>
|
||||
<exec command="${wpilib.ant.dir}\..\..\..\toolchains\arm-none-linux-gnueabi-4.4.1\bin\arm-none-linux-gnueabi-ar -r ${opkg.name}_${cpp-sos}_${opkg.arch}.deb debian-binary control.tar.gz data.tar.gz" dir="${wpilib.ant.dir}"/>
|
||||
<scp file="${wpilib.ant.dir}/${opkg.name}_${cpp-sos}_${opkg.arch}.deb" todir="${username}@${target}:/tmp"
|
||||
password="${password}" trust="true"/>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="opkg install /tmp/${opkg.name}_${cpp-sos}_${opkg.arch}.deb; sh -c 'rm -rf /tmp/wpilib*.deb'"/>
|
||||
</else>
|
||||
</if>
|
||||
<scp file="${out.exe}" sftp="true" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
|
||||
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:/home/lvuser/" password="${password}" trust="true"/>
|
||||
|
||||
<echo>[athena-deploy] Starting program.</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="chmod +x ${deploy.dir}/FRCUserProgram; ${deploy.dir}/FRCUserProgram"/>
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command=". /etc/profile.d/natinst-path.sh; chmod a+x ${deploy.dir}/${out}; ${deploy.kill.command};"/>
|
||||
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="tail -F -s 0 -n 0 ${deploy.log.file}"/>
|
||||
</target>
|
||||
|
||||
<target name="debug-deploy" depends="get-target-ip" description="Deploy the jar and start the program running in debug mode.">
|
||||
@@ -171,4 +94,4 @@ ${md5.hal} usr/local/frc/lib/libHALAthena.so</echo>
|
||||
</sequential>
|
||||
</parallel>
|
||||
</target>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/home/admin/FRCUserProgram
|
||||
@@ -67,10 +67,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.CommandWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -80,10 +86,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.CommandGroupWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -93,10 +105,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.SubsystemWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -106,10 +124,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.PIDSubsystemWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -119,10 +143,16 @@
|
||||
wizardId="edu.wpi.first.wpilib.plugins.java.wizards.file_template.TriggerWizard">
|
||||
<enablement>
|
||||
<with variable="selection"><iterate>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<and>
|
||||
<test
|
||||
args="edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
<test
|
||||
args="org.eclipse.jdt.core.javanature"
|
||||
property="org.eclipse.jdt.launching.hasProjectNature">
|
||||
</test>
|
||||
</and>
|
||||
</iterate></with>
|
||||
</enablement>
|
||||
</commonWizard>
|
||||
@@ -146,10 +176,10 @@
|
||||
point="org.eclipse.debug.ui.launchShortcuts">
|
||||
<shortcut
|
||||
class="edu.wpi.first.wpilib.plugins.java.launching.DeployLaunchShortcut"
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO"
|
||||
icon="resources/icons/wpi.ico"
|
||||
id="edu.wpi.first.wpilib.plugins.java.launching.deploy"
|
||||
label="WPILib Deploy"
|
||||
label="WPILib Java Deploy"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
@@ -171,11 +201,11 @@
|
||||
</enablement>
|
||||
</contextualLaunch>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board."
|
||||
description="Deploy the WPILib project to the roboRIO board."
|
||||
mode="run">
|
||||
</description>
|
||||
<description
|
||||
description="Deploy the WPILib project to the athena board and debug it."
|
||||
description="Deploy the WPILib project to the roboRIO board and debug it."
|
||||
mode="debug">
|
||||
</description>
|
||||
</shortcut>
|
||||
@@ -184,7 +214,7 @@
|
||||
description="Test your WPILib program with the Gazebo simulator."
|
||||
icon="resources/icons/Gazebo.png"
|
||||
id="edu.wpi.first.wpilib.plugins.java.launching.simulate"
|
||||
label="WPILib Simulation"
|
||||
label="WPILib Java Simulation"
|
||||
modes="run,debug">
|
||||
<contextualLaunch>
|
||||
<enablement>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<classifier>sources</classifier>
|
||||
<outputDirectory>${java-zip}/lib</outputDirectory>
|
||||
@@ -102,7 +102,7 @@
|
||||
<!-- Javadoc -->
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
|
||||
@@ -132,6 +132,12 @@
|
||||
<artifactId>JavaGazebo</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaSim</artifactId>
|
||||
@@ -348,11 +354,16 @@
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Javadoc -->
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilibj</groupId>
|
||||
<artifactId>wpilibJava</artifactId>
|
||||
<artifactId>wpilibJavaDevices</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
</dependency>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Trigger;
|
||||
import edu.wpi.first.wpilibj.buttons.Trigger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -51,9 +51,6 @@ public class DriveTrain extends Subsystem {
|
||||
left_encoder.setDistancePerPulse((4.0/12.0*Math.PI) / 360.0);
|
||||
right_encoder.setDistancePerPulse((4.0/12.0*Math.PI) / 360.0);
|
||||
}
|
||||
|
||||
left_encoder.start();
|
||||
right_encoder.start();
|
||||
|
||||
rangefinder = new AnalogInput(6);
|
||||
gyro = new Gyro(1);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Robot extends IterativeRobot {
|
||||
public static Collector collector;
|
||||
public static Shooter shooter;
|
||||
public static Pneumatics pneumatics;
|
||||
public static Pivot pivot;;
|
||||
public static Pivot pivot;
|
||||
|
||||
public SendableChooser autoChooser;
|
||||
public SendableChooser autonomousDirectionChooser;
|
||||
@@ -70,8 +70,8 @@ public class Robot extends IterativeRobot {
|
||||
}
|
||||
|
||||
public void autonomousInit() {
|
||||
Command auto = (Command) autoChooser.getSelected();
|
||||
auto.start();
|
||||
autonomousCommand = (Command) autoChooser.getSelected();
|
||||
autonomousCommand.start();
|
||||
}
|
||||
|
||||
// This function is called periodically during autonomous
|
||||
|
||||
@@ -10,14 +10,14 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
|
||||
*/
|
||||
public class DriveAndShootAutonomous extends CommandGroup {
|
||||
public DriveAndShootAutonomous() {
|
||||
addSequential(new CloseClaw());
|
||||
addSequential(new WaitForPressure(), 2);
|
||||
if (Robot.isReal()) {
|
||||
// NOTE: Simulation doesn't currently have the concept of hot.
|
||||
addSequential(new CheckForHotGoal(2));
|
||||
}
|
||||
addSequential(new CloseClaw());
|
||||
}
|
||||
addSequential(new SetPivotSetpoint(45));
|
||||
addSequential(new DriveForward(8, 0.4));
|
||||
addSequential(new DriveForward(8, 0.3));
|
||||
addSequential(new Shoot());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ import edu.wpi.first.wpilibj.command.Command;
|
||||
public class DriveForward extends Command {
|
||||
private double driveForwardSpeed;
|
||||
private double distance;
|
||||
private final double tolerance = .1; // TODO: Was 5
|
||||
private double error;
|
||||
private final double Kp = -1.0 / 5.0;
|
||||
private final double TOLERANCE = .1;
|
||||
private final double KP = -1.0 / 5.0;
|
||||
|
||||
public DriveForward() {
|
||||
this(10, 0.5);
|
||||
@@ -36,16 +36,16 @@ public class DriveForward extends Command {
|
||||
|
||||
protected void execute() {
|
||||
error = (distance - Robot.drivetrain.getRightEncoder().getDistance());
|
||||
if (driveForwardSpeed * Kp * error >= driveForwardSpeed) {
|
||||
if (driveForwardSpeed * KP * error >= driveForwardSpeed) {
|
||||
Robot.drivetrain.tankDrive(driveForwardSpeed, driveForwardSpeed);
|
||||
} else {
|
||||
Robot.drivetrain.tankDrive(driveForwardSpeed * Kp * error,
|
||||
driveForwardSpeed * Kp * error);
|
||||
Robot.drivetrain.tankDrive(driveForwardSpeed * KP * error,
|
||||
driveForwardSpeed * KP * error);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isFinished() {
|
||||
return (Math.abs(error) <= tolerance) || isTimedOut();
|
||||
return (Math.abs(error) <= TOLERANCE) || isTimedOut();
|
||||
}
|
||||
|
||||
protected void end() {
|
||||
|
||||
@@ -31,4 +31,4 @@ public class DriveWithJoystick extends Command {
|
||||
protected void interrupted() {
|
||||
end();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class DriveTrain extends Subsystem {
|
||||
|
||||
// Configure encoders
|
||||
rightEncoder = new Encoder(1, 2, true, EncodingType.k4X);
|
||||
leftEncoder = new Encoder(5, 6, false, EncodingType.k4X); // XXX: Module 2
|
||||
leftEncoder = new Encoder(3, 4, false, EncodingType.k4X);
|
||||
rightEncoder.setPIDSourceParameter(PIDSourceParameter.kDistance);
|
||||
leftEncoder.setPIDSourceParameter(PIDSourceParameter.kDistance);
|
||||
|
||||
@@ -63,8 +63,6 @@ public class DriveTrain extends Subsystem {
|
||||
leftEncoder.setDistancePerPulse((4.0/*in*/*Math.PI)/(360.0*12.0/*in/ft*/));
|
||||
}
|
||||
|
||||
rightEncoder.start();
|
||||
leftEncoder.start();
|
||||
LiveWindow.addSensor("DriveTrain", "Right Encoder", rightEncoder);
|
||||
LiveWindow.addSensor("DriveTrain", "Left Encoder", leftEncoder);
|
||||
|
||||
@@ -126,4 +124,4 @@ public class DriveTrain extends Subsystem {
|
||||
public double getAngle() {
|
||||
return gyro.getAngle();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,8 +29,8 @@ public class Pivot extends PIDSubsystem {
|
||||
setAbsoluteTolerance(0.005);
|
||||
getPIDController().setContinuous(false);
|
||||
if (Robot.isSimulation()) { // PID is different in simulation.
|
||||
getPIDController().setPID(0.5, 0.00001, 4.5);
|
||||
setAbsoluteTolerance(2.5);
|
||||
getPIDController().setPID(0.5, 0.001, 2);
|
||||
setAbsoluteTolerance(5);
|
||||
}
|
||||
|
||||
// Motor to move the pivot.
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.SampleRobot;
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of the RobotDrive class.
|
||||
* The SampleRobot class is the base of a robot application that will automatically call your
|
||||
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
|
||||
* the driver station or the field controls.
|
||||
*
|
||||
* The VM is configured to automatically run this class, and to call the
|
||||
* functions corresponding to each mode, as described in the SampleRobot
|
||||
* documentation. If you change the name of this class or the package after
|
||||
* creating this project, you must also update the manifest file in the resource
|
||||
* directory.
|
||||
*
|
||||
* WARNING: While it may look like a good choice to use for your code if you're inexperienced,
|
||||
* don't. Unless you know what you are doing, complex code will be much more difficult under
|
||||
* this system. Use IterativeRobot or Command-Based instead if you're new.
|
||||
*/
|
||||
public class Robot extends SampleRobot {
|
||||
RobotDrive myRobot;
|
||||
Joystick stick;
|
||||
|
||||
public Robot() {
|
||||
myRobot = new RobotDrive(1, 2);
|
||||
myRobot.setExpiration(0.1);
|
||||
stick = new Joystick(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drive left & right motors for 2 seconds then stop
|
||||
*/
|
||||
public void autonomous() {
|
||||
myRobot.setSafetyEnabled(false);
|
||||
myRobot.drive(-0.5, 0.0); // drive forwards half speed
|
||||
Timer.delay(2.0); // for 2 seconds
|
||||
myRobot.drive(0.0, 0.0); // stop robot
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motors with arcade steering.
|
||||
*/
|
||||
public void operatorControl() {
|
||||
myRobot.setSafetyEnabled(true);
|
||||
while (isOperatorControl()) {
|
||||
myRobot.arcadeDrive(stick); // drive with arcade style (use right stick)
|
||||
Timer.delay(0.005); // wait for a motor update time
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs during test mode
|
||||
*/
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.SimpleRobot;
|
||||
|
||||
/**
|
||||
* The VM is configured to automatically run this class, and to call the
|
||||
* functions corresponding to each mode, as described in the SimpleRobot
|
||||
* documentation. If you change the name of this class or the package after
|
||||
* creating this project, you must also update the manifest file in the resource
|
||||
* directory.
|
||||
*/
|
||||
public class Robot extends SimpleRobot {
|
||||
/**
|
||||
* This function is called once each time the robot enters autonomous mode.
|
||||
*/
|
||||
public void autonomous() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called once each time the robot enters operator control.
|
||||
*/
|
||||
public void operatorControl() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called once each time the robot enters test mode.
|
||||
*/
|
||||
public void test() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -100,11 +100,15 @@ public class WPILibJavaPlugin extends AbstractUIPlugin implements IStartup {
|
||||
IProject[] projects = root.getProjects();
|
||||
// Loop over all projects
|
||||
for (IProject project : projects) {
|
||||
try {
|
||||
updateVariables(project);
|
||||
} catch (CoreException e) {
|
||||
WPILibJavaPlugin.logError("Error updating projects.", e);
|
||||
}
|
||||
try {
|
||||
if(project.hasNature("edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature")){
|
||||
WPILibJavaPlugin.logInfo("Updating project");
|
||||
updateVariables(project);
|
||||
} else {
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
WPILibJavaPlugin.logError("Error updating projects.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
username=admin
|
||||
password=
|
||||
deploy.dir=/home/admin
|
||||
deploy.run.command=./runjavaprogram
|
||||
deploy.debug.command=./debugjavaprogram
|
||||
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
|
||||
deploy.debug.command = /usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar ${deploy.dir}/FRCUserProgram.jar
|
||||
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
|
||||
command.dir=/home/lvuser/
|
||||
|
||||
# Libraries to use
|
||||
wpilib=${user.home}/wpilib/java/${version}
|
||||
@@ -34,4 +36,4 @@ dist.jar=${dist.dir}/${jar}
|
||||
simulation.dist.jar=${dist.dir}/FRCUserProgramSim.jar
|
||||
wpilib.sim=${wpilib}/sim
|
||||
wpilib.sim.lib=${wpilib.sim}/lib
|
||||
wpilib.sim.tools=${wpilib.sim}/tools
|
||||
wpilib.sim.tools=${wpilib.sim}/tools
|
||||
|
||||
@@ -19,16 +19,14 @@
|
||||
<!-- Targets -->
|
||||
|
||||
<target name="get-target-ip">
|
||||
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
|
||||
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
|
||||
<property name="target" value="10.${ip.upper}.${ip.lower}.2" />
|
||||
<echo>Target IP: ${target}</echo>
|
||||
<property name="target" value="roboRIO-${team-number}.local" />
|
||||
<echo>Target: ${target}</echo>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="compile" description="Compile the source code.">
|
||||
<mkdir dir="${build.dir}"/>
|
||||
<echo>[athena-compile] Compiling ${src.dir} with classpath=${classpath} to ${build.dir}</echo>
|
||||
|
||||
|
||||
<javac srcdir="${src.dir}"
|
||||
destdir="${build.dir}"
|
||||
includeAntRuntime="no"
|
||||
@@ -40,7 +38,7 @@
|
||||
debug="true">
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="jar" depends="compile">
|
||||
<echo>[athena-jar] Making jar ${dist.jar}.</echo>
|
||||
<mkdir dir="${dist.dir}" />
|
||||
@@ -52,16 +50,16 @@
|
||||
<pathelement path="${classpath}"/>
|
||||
</path>
|
||||
</copy>
|
||||
|
||||
|
||||
<jar destfile="${dist.jar}" update="false">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="edu.wpi.first.wpilibj.RobotBase"/>
|
||||
<attribute name="Robot-Class" value="${robot.class}"/>
|
||||
<attribute name="Class-Path" value="."/>
|
||||
</manifest>
|
||||
|
||||
|
||||
<fileset dir="${build.dir}" includes="**/*.class"/>
|
||||
|
||||
|
||||
<zipgroupfileset dir="${build.jars}">
|
||||
<include name="**/*.jar" />
|
||||
</zipgroupfileset>
|
||||
@@ -70,37 +68,39 @@
|
||||
|
||||
<target name="deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
|
||||
<echo>[athena-deploy] Copying code over.</echo>
|
||||
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<scp file="${wpilib.ant.dir}/runjavaprogram" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
|
||||
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:${command.dir}" password="${password}" trust="true"/>
|
||||
|
||||
<echo>[athena-deploy] Starting program.</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="chmod a+x run*program; ${deploy.run.command}"/>
|
||||
</target>
|
||||
command=". /etc/profile.d/natinst-path.sh; ${deploy.kill.command};"/>
|
||||
|
||||
<target name="debug-deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running in debug mode.">
|
||||
<echo>[athena-debug-deploy] Copying code over.</echo>
|
||||
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<echo>[athena-debug-deploy] Copying Debug Script Over.</echo>
|
||||
<scp file="${wpilib.ant.dir}/debugjavaprogram" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<echo>[athena-debug-deploy] Starting program.</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="chmod a+x debug*program; ${deploy.debug.command}"/>
|
||||
command="tail -F -s 0 -n 0 ${deploy.log.file}"/>
|
||||
</target>
|
||||
|
||||
<target name="debug-deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
|
||||
<echo>[athena-deploy] Copying code over.</echo>
|
||||
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
|
||||
|
||||
<echo>[athena-deploy] Starting program.</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command=". /etc/profile.d/natinst-path.sh; ${deploy.debug.command}"/>
|
||||
</target>
|
||||
|
||||
<!-- Simulate -->
|
||||
<target name="jar-for-simulation" depends="compile">
|
||||
<echo>[jar-for-simulation] Building jar.</echo>
|
||||
|
||||
|
||||
<jar destfile="${simulation.dist.jar}">
|
||||
<manifest>
|
||||
<attribute name="Built-By" value="${user.name}"/>
|
||||
@@ -123,12 +123,14 @@
|
||||
</exec>
|
||||
</sequential>
|
||||
<sequential>
|
||||
<sleep seconds="5"/>
|
||||
<echo>[simulate] Running DriverStation.</echo>
|
||||
<java jar="${wpilib.sim.tools}/SimDS.jar" fork="true">
|
||||
<jvmarg value="-Djava.library.path=${wpilib.sim.lib}" />
|
||||
</java>
|
||||
</sequential>
|
||||
<sequential>
|
||||
<sleep seconds="5"/>
|
||||
<echo>[simulate] Running Code.</echo>
|
||||
<java jar="${simulation.dist.jar}" fork="true">
|
||||
<jvmarg value="-Djava.library.path=${wpilib.sim.lib}" />
|
||||
@@ -146,12 +148,14 @@
|
||||
</exec>
|
||||
</sequential>
|
||||
<sequential>
|
||||
<sleep seconds="5"/>
|
||||
<echo>[debug-simulate] Running DriverStation.</echo>
|
||||
<java jar="${wpilib.sim.tools}/SimDS.jar" fork="true">
|
||||
<jvmarg value="-Djava.library.path=${wpilib.sim.lib}" />
|
||||
</java>
|
||||
</sequential>
|
||||
<sequential>
|
||||
<sleep seconds="5"/>
|
||||
<echo>[debug-simulate] Running Code.</echo>
|
||||
<java jar="${simulation.dist.jar}" fork="true">
|
||||
<jvmarg value="-Xdebug" />
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#. ./.profile
|
||||
killall java
|
||||
sleep 1
|
||||
/usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar FRCUserProgram.jar
|
||||
#nohup java -Djna.library.path=$LD_LIBRARY_PATH -Xmx32M -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar FRCUserProgram.jar
|
||||
@@ -0,0 +1,3 @@
|
||||
/usr/local/frc/JRE/bin/java
|
||||
-jar /home/admin/FRCUserProgram.jar
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#. ./.profile
|
||||
killall java
|
||||
killall FRCUserProgram
|
||||
sleep 1
|
||||
nohup /usr/local/frc/JRE/bin/java -jar FRCUserProgram.jar
|
||||
#nohup /usr/local/frc/JRE/bin/java -Djna.library.path=$LD_LIBRARY_PATH -Xmx32M -jar FRCUserProgram.jar
|
||||
@@ -2,13 +2,12 @@ cmake_minimum_required(VERSION 2.8)
|
||||
project(HAL)
|
||||
|
||||
file(GLOB_RECURSE SRC_FILES lib/Athena/*.cpp)
|
||||
include_directories(lib/Athena include)
|
||||
include_directories(lib/Athena lib/Athena/FRC_FPGA_ChipObject include)
|
||||
add_library(HALAthena STATIC ${SRC_FILES})
|
||||
target_link_libraries(HALAthena ${NI_LIBS})
|
||||
INSTALL(TARGETS HALAthena ARCHIVE DESTINATION lib COMPONENT lib)
|
||||
INSTALL(FILES ${NI_LIBS} DESTINATION lib COMPONENT ni_lib)
|
||||
INSTALL(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT headers)
|
||||
# lib/ c m gcc_s ld-linux
|
||||
# usr/lib stdc++
|
||||
# usr/lib
|
||||
# FRC_NetworkCommunication FRC_FPGA_ChipObject RoboRIO_FRC_ChipObject
|
||||
|
||||
|
||||
15
hal/include/HAL/Accelerometer.hpp
Normal file
15
hal/include/HAL/Accelerometer.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
enum AccelerometerRange {
|
||||
kRange_2G = 0,
|
||||
kRange_4G = 1,
|
||||
kRange_8G = 2,
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
void setAccelerometerActive(bool);
|
||||
void setAccelerometerRange(AccelerometerRange);
|
||||
double getAccelerometerX();
|
||||
double getAccelerometerY();
|
||||
double getAccelerometerZ();
|
||||
}
|
||||
@@ -26,11 +26,9 @@ extern "C"
|
||||
void* initializeAnalogInputPort(void* port_pointer, int32_t *status);
|
||||
bool checkAnalogModule(uint8_t module);
|
||||
bool checkAnalogInputChannel(uint32_t pin);
|
||||
|
||||
|
||||
void setAnalogSampleRate(double samplesPerSecond, int32_t *status);
|
||||
float getAnalogSampleRate(int32_t *status);
|
||||
void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status);
|
||||
float getAnalogSampleRateWithModule(uint8_t module, int32_t *status);
|
||||
void setAnalogAverageBits(void* analog_port_pointer, uint32_t bits, int32_t *status);
|
||||
uint32_t getAnalogAverageBits(void* analog_port_pointer, int32_t *status);
|
||||
void setAnalogOversampleBits(void* analog_port_pointer, uint32_t bits, int32_t *status);
|
||||
@@ -71,14 +69,11 @@ extern "C"
|
||||
//// Float JNA Hack
|
||||
// Float
|
||||
int getAnalogSampleRateIntHack(int32_t *status);
|
||||
int getAnalogSampleRateWithModuleIntHack(uint8_t module, int32_t *status);
|
||||
int getAnalogVoltageIntHack(void* analog_port_pointer, int32_t *status);
|
||||
int getAnalogAverageVoltageIntHack(void* analog_port_pointer, int32_t *status);
|
||||
|
||||
// Doubles
|
||||
void setAnalogSampleRateIntHack(int samplesPerSecond, int32_t *status);
|
||||
void setAnalogSampleRateWithModuleIntHack(uint8_t module, int samplesPerSecond,
|
||||
int32_t *status);
|
||||
int32_t getAnalogVoltsToValueIntHack(void* analog_port_pointer, int voltage, int32_t *status);
|
||||
void setAnalogTriggerLimitsVoltageIntHack(void* analog_trigger_pointer, int lower, int upper,
|
||||
int32_t *status);
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include "NetworkCommunication/CANSessionMux.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void JaguarCANSendMessage(uint32_t messageID, const uint8_t *data, uint8_t dataSize,
|
||||
int32_t *status);
|
||||
void JaguarCANReceiveMessage(uint32_t *messageID, uint8_t *data, uint8_t *dataSize,
|
||||
uint32_t timeoutMs, int32_t *status);
|
||||
}
|
||||
void canTxSend(uint32_t arbID, uint8_t length, int32_t period = CAN_SEND_PERIOD_NO_REPEAT);
|
||||
|
||||
void canTxPackInt8 (uint32_t arbID, uint8_t offset, uint8_t value);
|
||||
void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value);
|
||||
void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value);
|
||||
void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value);
|
||||
void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value);
|
||||
|
||||
uint8_t canTxUnpackInt8 (uint32_t arbID, uint8_t offset);
|
||||
uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset);
|
||||
uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset);
|
||||
double canTxUnpackFXP16(uint32_t arbID, uint8_t offset);
|
||||
double canTxUnpackFXP32(uint32_t arbID, uint8_t offset);
|
||||
|
||||
bool canRxReceive(uint32_t arbID);
|
||||
|
||||
uint8_t canRxUnpackInt8 (uint32_t arbID, uint8_t offset);
|
||||
uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset);
|
||||
uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset);
|
||||
double canRxUnpackFXP16(uint32_t arbID, uint8_t offset);
|
||||
double canRxUnpackFXP32(uint32_t arbID, uint8_t offset);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include "HAL/cpp/Synchronized.hpp"
|
||||
|
||||
enum Mode
|
||||
{
|
||||
@@ -12,40 +13,23 @@ enum Mode
|
||||
kPulseLength = 2,
|
||||
kExternalDirection = 3
|
||||
};
|
||||
enum tSPIConstants
|
||||
{
|
||||
kReceiveFIFODepth = 512,
|
||||
kTransmitFIFODepth = 512
|
||||
};
|
||||
enum tFrameMode
|
||||
{
|
||||
kChipSelect,
|
||||
kPreLatchPulse,
|
||||
kPostLatchPulse,
|
||||
kPreAndPostLatchPulse
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void* initializeDigitalPort(void* port_pointer, int32_t *status);
|
||||
bool checkDigitalModule(uint8_t module);
|
||||
bool checkPWMChannel(void* digital_port_pointer);
|
||||
bool checkRelayChannel(void* digital_port_pointer);
|
||||
|
||||
void setPWM(void* digital_port_pointer, unsigned short value, int32_t *status);
|
||||
bool allocatePWMChannel(void* digital_port_pointer, int32_t *status);
|
||||
void freePWMChannel(void* digital_port_pointer, int32_t *status);
|
||||
unsigned short getPWM(void* digital_port_pointer, int32_t *status);
|
||||
void setPWMPeriodScale(void* digital_port_pointer, uint32_t squelchMask, int32_t *status);
|
||||
void* allocatePWM(int32_t *status);
|
||||
void* allocatePWMWithModule(uint8_t module, int32_t *status);
|
||||
void freePWM(void* pwmGenerator, int32_t *status);
|
||||
void freePWMWithModule(uint8_t module, void* pwmGenerator, int32_t *status);
|
||||
void setPWMRate(double rate, int32_t *status);
|
||||
void setPWMRateWithModule(uint8_t module, double rate, int32_t *status);
|
||||
void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status);
|
||||
void setPWMDutyCycleWithModule(uint8_t module, void* pwmGenerator, double dutyCycle,
|
||||
int32_t *status);
|
||||
void setPWMOutputChannel(void* pwmGenerator, uint32_t pin, int32_t *status);
|
||||
void setPWMOutputChannelWithModule(uint8_t module, void* pwmGenerator, uint32_t pin,
|
||||
int32_t *status);
|
||||
|
||||
void setRelayForward(void* digital_port_pointer, bool on, int32_t *status);
|
||||
void setRelayReverse(void* digital_port_pointer, bool on, int32_t *status);
|
||||
@@ -60,18 +44,15 @@ extern "C"
|
||||
void pulse(void* digital_port_pointer, double pulseLength, int32_t *status);
|
||||
bool isPulsing(void* digital_port_pointer, int32_t *status);
|
||||
bool isAnyPulsing(int32_t *status);
|
||||
bool isAnyPulsingWithModule(uint8_t module, int32_t *status);
|
||||
|
||||
void* initializeCounter(Mode mode, uint32_t *index, int32_t *status);
|
||||
void freeCounter(void* counter_pointer, int32_t *status);
|
||||
void setCounterAverageSize(void* counter_pointer, int32_t size, int32_t *status);
|
||||
void setCounterUpSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin,
|
||||
bool analogTrigger, int32_t *status); // TODO: Without Module
|
||||
void setCounterUpSource(void* counter_pointer, uint32_t pin, bool analogTrigger, int32_t *status);
|
||||
void setCounterUpSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge,
|
||||
int32_t *status);
|
||||
void clearCounterUpSource(void* counter_pointer, int32_t *status);
|
||||
void setCounterDownSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin,
|
||||
bool analogTrigger, int32_t *status); // TODO: Without Module
|
||||
void setCounterDownSource(void* counter_pointer, uint32_t pin, bool analogTrigger, int32_t *status);
|
||||
void setCounterDownSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge,
|
||||
int32_t *status);
|
||||
void clearCounterDownSource(void* counter_pointer, int32_t *status);
|
||||
@@ -110,48 +91,30 @@ extern "C"
|
||||
uint32_t getEncoderSamplesToAverage(void* encoder_pointer, int32_t *status);
|
||||
|
||||
uint16_t getLoopTiming(int32_t *status);
|
||||
uint16_t getLoopTimingWithModule(uint8_t module, int32_t *status);
|
||||
|
||||
void* initializeSPI(uint8_t sclk_routing_module, uint32_t sclk_routing_pin,
|
||||
uint8_t mosi_routing_module, uint32_t mosi_routing_pin, uint8_t miso_routing_module,
|
||||
uint32_t miso_routing_pin, int32_t *status);
|
||||
void cleanSPI(void* spi_pointer, int32_t *status);
|
||||
void setSPIBitsPerWord(void* spi_pointer, uint32_t bits, int32_t *status);
|
||||
uint32_t getSPIBitsPerWord(void* spi_pointer, int32_t *status);
|
||||
void setSPIClockRate(void* spi_pointer, double hz, int32_t *status);
|
||||
void setSPIMSBFirst(void* spi_pointer, int32_t *status);
|
||||
void setSPILSBFirst(void* spi_pointer, int32_t *status);
|
||||
void setSPISampleDataOnFalling(void* spi_pointer, int32_t *status);
|
||||
void setSPISampleDataOnRising(void* spi_pointer, int32_t *status);
|
||||
void setSPISlaveSelect(void* spi_pointer, uint8_t ss_routing_module, uint32_t ss_routing_pin,
|
||||
int32_t *status);
|
||||
void setSPILatchMode(void* spi_pointer, tFrameMode mode, int32_t *status);
|
||||
tFrameMode getSPILatchMode(void* spi_pointer, int32_t *status);
|
||||
void setSPIFramePolarity(void* spi_pointer, bool activeLow, int32_t *status);
|
||||
bool getSPIFramePolarity(void* spi_pointer, int32_t *status);
|
||||
void setSPIClockActiveLow(void* spi_pointer, int32_t *status);
|
||||
void setSPIClockActiveHigh(void* spi_pointer, int32_t *status);
|
||||
void applySPIConfig(void* spi_pointer, int32_t *status);
|
||||
uint16_t getSPIOutputFIFOAvailable(void* spi_pointer, int32_t *status);
|
||||
uint16_t getSPINumReceived(void* spi_pointer, int32_t *status);
|
||||
bool isSPIDone(void* spi_pointer, int32_t *status);
|
||||
bool hadSPIReceiveOverflow(void* spi_pointer, int32_t *status);
|
||||
void writeSPI(void* spi_pointer, uint32_t data, int32_t *status);
|
||||
uint32_t readSPI(void* spi_pointer, bool initiate, int32_t *status);
|
||||
void resetSPI(void* spi_pointer, int32_t *status);
|
||||
void clearSPIReceivedData(void* spi_pointer, int32_t *status);
|
||||
void spiInitialize(uint8_t port, int32_t *status);
|
||||
int32_t spiTransaction(uint8_t port, uint8_t *dataToSend, uint8_t *dataReceived, uint8_t size);
|
||||
int32_t spiWrite(uint8_t port, uint8_t* dataToSend, uint8_t sendSize);
|
||||
int32_t spiRead(uint8_t port, uint8_t *buffer, uint8_t count);
|
||||
void spiClose(uint8_t port);
|
||||
void spiSetSpeed(uint8_t port, uint32_t speed);
|
||||
void spiSetBitsPerWord(uint8_t port, uint8_t bpw);
|
||||
void spiSetOpts(uint8_t port, int msb_first, int sample_on_trailing, int clk_idle_high);
|
||||
void spiSetChipSelectActiveHigh(uint8_t port, int32_t *status);
|
||||
void spiSetChipSelectActiveLow(uint8_t port, int32_t *status);
|
||||
int32_t spiGetHandle(uint8_t port);
|
||||
void spiSetHandle(uint8_t port, int32_t handle);
|
||||
MUTEX_ID spiGetSemaphore(uint8_t port);
|
||||
void spiSetSemaphore(uint8_t port, MUTEX_ID semaphore);
|
||||
|
||||
void i2CInitialize(uint8_t port, int32_t *status);
|
||||
int i2CTransaction(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize);
|
||||
int i2CWrite(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize);
|
||||
int i2CRead(uint8_t port, uint8_t deviceAddress, uint8_t *buffer, uint8_t count);
|
||||
int32_t i2CTransaction(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize);
|
||||
int32_t i2CWrite(uint8_t port, uint8_t deviceAddress, uint8_t *dataToSend, uint8_t sendSize);
|
||||
int32_t i2CRead(uint8_t port, uint8_t deviceAddress, uint8_t *buffer, uint8_t count);
|
||||
void i2CClose(uint8_t port);
|
||||
|
||||
//// Float JNA Hack
|
||||
// double
|
||||
void setPWMRateIntHack(int rate, int32_t *status);
|
||||
void setPWMRateWithModuleIntHack(uint8_t module, int32_t rate, int32_t *status);
|
||||
void setPWMDutyCycleIntHack(void* pwmGenerator, int32_t dutyCycle, int32_t *status);
|
||||
void setPWMDutyCycleWithModuleIntHack(uint8_t module, void* pwmGenerator, int32_t dutyCycle,
|
||||
int32_t *status);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define SAMPLE_RATE_TOO_HIGH 1
|
||||
#define SAMPLE_RATE_TOO_HIGH_MESSAGE "Analog module sample rate is too high"
|
||||
#define VOLTAGE_OUT_OF_RANGE 2
|
||||
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "Voltage to convert to raw value is out of range [-10; 10]"
|
||||
#define VOLTAGE_OUT_OF_RANGE_MESSAGE "Voltage to convert to raw value is out of range [0; 5]"
|
||||
#define LOOP_TIMING_ERROR 4
|
||||
#define LOOP_TIMING_ERROR_MESSAGE "Digital module loop timing is not the expected value"
|
||||
#define SPI_WRITE_NO_MOSI 12
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
#endif
|
||||
#include <cmath>
|
||||
|
||||
#include "Accelerometer.hpp"
|
||||
#include "Analog.hpp"
|
||||
#include "CAN.hpp"
|
||||
#include "Compressor.hpp"
|
||||
#include "Digital.hpp"
|
||||
#include "Solenoid.hpp"
|
||||
@@ -20,6 +22,7 @@
|
||||
#include "Interrupts.hpp"
|
||||
#include "Errors.hpp"
|
||||
#include "PDP.hpp"
|
||||
#include "Power.hpp"
|
||||
|
||||
#include "Utilities.hpp"
|
||||
#include "Semaphore.hpp"
|
||||
@@ -28,7 +31,6 @@
|
||||
#define HAL_IO_CONFIG_DATA_SIZE 32
|
||||
#define HAL_SYS_STATUS_DATA_SIZE 44
|
||||
#define HAL_USER_STATUS_DATA_SIZE (984 - HAL_IO_CONFIG_DATA_SIZE - HAL_SYS_STATUS_DATA_SIZE)
|
||||
#define HAL_USER_DS_LCD_DATA_SIZE 128
|
||||
|
||||
#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Input 17
|
||||
#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Output 18
|
||||
@@ -140,119 +142,32 @@ namespace HALUsageReporting
|
||||
};
|
||||
}
|
||||
|
||||
struct HALCommonControlData
|
||||
{
|
||||
uint16_t packetIndex;
|
||||
union
|
||||
{
|
||||
uint8_t control;
|
||||
#ifndef __vxworks
|
||||
struct
|
||||
{
|
||||
uint8_t checkVersions :1;
|
||||
uint8_t test :1;
|
||||
uint8_t resync :1;
|
||||
uint8_t fmsAttached :1;
|
||||
uint8_t autonomous :1;
|
||||
uint8_t enabled :1;
|
||||
uint8_t notEStop :1;
|
||||
uint8_t reset :1;
|
||||
};
|
||||
#else
|
||||
struct
|
||||
{
|
||||
uint8_t reset : 1;
|
||||
uint8_t notEStop : 1;
|
||||
uint8_t enabled : 1;
|
||||
uint8_t autonomous : 1;
|
||||
uint8_t fmsAttached:1;
|
||||
uint8_t resync : 1;
|
||||
uint8_t test :1;
|
||||
uint8_t checkVersions :1;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
uint8_t dsDigitalIn;
|
||||
uint16_t teamID;
|
||||
|
||||
char dsID_Alliance;
|
||||
char dsID_Position;
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick0Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick0Axis1;
|
||||
int8_t stick0Axis2;
|
||||
int8_t stick0Axis3;
|
||||
int8_t stick0Axis4;
|
||||
int8_t stick0Axis5;
|
||||
int8_t stick0Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick0Buttons; // Left-most 4 bits are unused
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick1Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick1Axis1;
|
||||
int8_t stick1Axis2;
|
||||
int8_t stick1Axis3;
|
||||
int8_t stick1Axis4;
|
||||
int8_t stick1Axis5;
|
||||
int8_t stick1Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick1Buttons; // Left-most 4 bits are unused
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick2Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick2Axis1;
|
||||
int8_t stick2Axis2;
|
||||
int8_t stick2Axis3;
|
||||
int8_t stick2Axis4;
|
||||
int8_t stick2Axis5;
|
||||
int8_t stick2Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick2Buttons; // Left-most 4 bits are unused
|
||||
|
||||
union
|
||||
{
|
||||
int8_t stick3Axes[6];
|
||||
struct
|
||||
{ // TODO: ???
|
||||
int8_t stick3Axis1;
|
||||
int8_t stick3Axis2;
|
||||
int8_t stick3Axis3;
|
||||
int8_t stick3Axis4;
|
||||
int8_t stick3Axis5;
|
||||
int8_t stick3Axis6;
|
||||
};
|
||||
};
|
||||
uint16_t stick3Buttons; // Left-most 4 bits are unused
|
||||
|
||||
//Analog inputs are 10 bit right-justified
|
||||
uint16_t analog1;
|
||||
uint16_t analog2;
|
||||
uint16_t analog3;
|
||||
uint16_t analog4;
|
||||
|
||||
uint64_t cRIOChecksum;
|
||||
uint32_t FPGAChecksum0;
|
||||
uint32_t FPGAChecksum1;
|
||||
uint32_t FPGAChecksum2;
|
||||
uint32_t FPGAChecksum3;
|
||||
|
||||
char versionData[8];
|
||||
struct HALControlWord {
|
||||
uint32_t enabled : 1;
|
||||
uint32_t autonomous : 1;
|
||||
uint32_t test :1;
|
||||
uint32_t eStop : 1;
|
||||
uint32_t fmsAttached:1;
|
||||
uint32_t dsAttached:1;
|
||||
uint32_t control_reserved : 26;
|
||||
};
|
||||
|
||||
enum HALAllianceStationID {
|
||||
kHALAllianceStationID_red1,
|
||||
kHALAllianceStationID_red2,
|
||||
kHALAllianceStationID_red3,
|
||||
kHALAllianceStationID_blue1,
|
||||
kHALAllianceStationID_blue2,
|
||||
kHALAllianceStationID_blue3,
|
||||
};
|
||||
|
||||
struct HALJoystickAxes {
|
||||
uint16_t count;
|
||||
int16_t axes[6];
|
||||
};
|
||||
|
||||
typedef uint32_t HALJoystickButtons;
|
||||
|
||||
inline float intToFloat(int value)
|
||||
{
|
||||
return (float)value;
|
||||
@@ -278,18 +193,16 @@ extern "C"
|
||||
uint32_t getFPGARevision(int32_t *status);
|
||||
uint32_t getFPGATime(int32_t *status);
|
||||
|
||||
void setFPGALED(uint32_t state, int32_t *status);
|
||||
int32_t getFPGALED(int32_t *status);
|
||||
bool getFPGAButton(int32_t *status);
|
||||
|
||||
int HALSetErrorData(const char *errors, int errorsLength, int wait_ms);
|
||||
int HALSetUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms);
|
||||
int HALOverrideIOConfig(const char *ioConfig, int wait_ms);
|
||||
int HALGetDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms);
|
||||
int HALGetCommonControlData(HALCommonControlData *data, int wait_ms);
|
||||
|
||||
int HALGetControlWord(HALControlWord *data);
|
||||
int HALGetAllianceStation(enum HALAllianceStationID *allianceStation);
|
||||
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes, uint8_t maxAxes);
|
||||
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons, uint8_t *count);
|
||||
|
||||
void HALSetNewDataSem(pthread_mutex_t *);
|
||||
int HALSetStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
|
||||
const char *userDataHigh, int userDataHighLength, const char *userDataLow,
|
||||
int userDataLowLength, int wait_ms);
|
||||
|
||||
int HALInitialize(int mode = 0);
|
||||
void HALNetworkCommunicationObserveUserProgramStarting();
|
||||
@@ -311,4 +224,3 @@ extern "C"
|
||||
void EDVR_CreateReference();
|
||||
void Occur();
|
||||
}
|
||||
|
||||
|
||||
15
hal/include/HAL/Power.hpp
Normal file
15
hal/include/HAL/Power.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
float getVinVoltage(int32_t *status);
|
||||
float getVinCurrent(int32_t *status);
|
||||
float getUserVoltage6V(int32_t *status);
|
||||
float getUserCurrent6V(int32_t *status);
|
||||
float getUserVoltage5V(int32_t *status);
|
||||
float getUserCurrent5V(int32_t *status);
|
||||
float getUserVoltage3V3(int32_t *status);
|
||||
float getUserCurrent3V3(int32_t *status);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void printCurrentStackTrace();
|
||||
bool getErrnoToName(int32_t errNo, char* name);
|
||||
}
|
||||
234
hal/lib/Athena/Accelerometer.cpp
Normal file
234
hal/lib/Athena/Accelerometer.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
#include "HAL/Accelerometer.hpp"
|
||||
|
||||
#include "ChipObject.h"
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
// The 7-bit I2C address with a 0 "send" bit
|
||||
static const uint8_t kSendAddress = (0x1c << 1) | 0;
|
||||
|
||||
// The 7-bit I2C address with a 1 "receive" bit
|
||||
static const uint8_t kReceiveAddress = (0x1c << 1) | 1;
|
||||
|
||||
static const uint8_t kControlTxRx = 1;
|
||||
static const uint8_t kControlStart = 2;
|
||||
static const uint8_t kControlStop = 4;
|
||||
|
||||
static tAccel *accel = 0;
|
||||
static AccelerometerRange accelerometerRange;
|
||||
|
||||
// Register addresses
|
||||
enum Register {
|
||||
kReg_Status = 0x00,
|
||||
kReg_OutXMSB = 0x01,
|
||||
kReg_OutXLSB = 0x02,
|
||||
kReg_OutYMSB = 0x03,
|
||||
kReg_OutYLSB = 0x04,
|
||||
kReg_OutZMSB = 0x05,
|
||||
kReg_OutZLSB = 0x06,
|
||||
kReg_Sysmod = 0x0B,
|
||||
kReg_IntSource = 0x0C,
|
||||
kReg_WhoAmI = 0x0D,
|
||||
kReg_XYZDataCfg = 0x0E,
|
||||
kReg_HPFilterCutoff = 0x0F,
|
||||
kReg_PLStatus = 0x10,
|
||||
kReg_PLCfg = 0x11,
|
||||
kReg_PLCount = 0x12,
|
||||
kReg_PLBfZcomp = 0x13,
|
||||
kReg_PLThsReg = 0x14,
|
||||
kReg_FFMtCfg = 0x15,
|
||||
kReg_FFMtSrc = 0x16,
|
||||
kReg_FFMtThs = 0x17,
|
||||
kReg_FFMtCount = 0x18,
|
||||
kReg_TransientCfg = 0x1D,
|
||||
kReg_TransientSrc = 0x1E,
|
||||
kReg_TransientThs = 0x1F,
|
||||
kReg_TransientCount = 0x20,
|
||||
kReg_PulseCfg = 0x21,
|
||||
kReg_PulseSrc = 0x22,
|
||||
kReg_PulseThsx = 0x23,
|
||||
kReg_PulseThsy = 0x24,
|
||||
kReg_PulseThsz = 0x25,
|
||||
kReg_PulseTmlt = 0x26,
|
||||
kReg_PulseLtcy = 0x27,
|
||||
kReg_PulseWind = 0x28,
|
||||
kReg_ASlpCount = 0x29,
|
||||
kReg_CtrlReg1 = 0x2A,
|
||||
kReg_CtrlReg2 = 0x2B,
|
||||
kReg_CtrlReg3 = 0x2C,
|
||||
kReg_CtrlReg4 = 0x2D,
|
||||
kReg_CtrlReg5 = 0x2E,
|
||||
kReg_OffX = 0x2F,
|
||||
kReg_OffY = 0x30,
|
||||
kReg_OffZ = 0x31
|
||||
};
|
||||
|
||||
extern "C" uint32_t getFPGATime(int32_t *status);
|
||||
|
||||
static void writeRegister(Register reg, uint8_t data);
|
||||
static uint8_t readRegister(Register reg);
|
||||
|
||||
/**
|
||||
* Initialize the accelerometer.
|
||||
*/
|
||||
static void initializeAccelerometer() {
|
||||
int32_t status;
|
||||
|
||||
if(!accel) {
|
||||
accel = tAccel::create(&status);
|
||||
|
||||
// Enable I2C
|
||||
accel->writeCNFG(1, &status);
|
||||
|
||||
// Set the counter to 100 kbps
|
||||
accel->writeCNTR(213, &status);
|
||||
|
||||
// The device identification number should be 0x2a
|
||||
assert(readRegister(kReg_WhoAmI) == 0x2a);
|
||||
}
|
||||
}
|
||||
|
||||
static void writeRegister(Register reg, uint8_t data) {
|
||||
int32_t status = 0;
|
||||
uint32_t initialTime;
|
||||
|
||||
accel->writeADDR(kSendAddress, &status);
|
||||
|
||||
// Send a start transmit/receive message with the register address
|
||||
accel->writeCNTL(kControlStart | kControlTxRx, &status);
|
||||
accel->writeDATO(reg, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
// Send a stop transmit/receive message with the data
|
||||
accel->writeCNTL(kControlStop | kControlTxRx, &status);
|
||||
accel->writeDATO(data, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static uint8_t readRegister(Register reg) {
|
||||
int32_t status = 0;
|
||||
uint32_t initialTime;
|
||||
|
||||
// Send a start transmit/receive message with the register address
|
||||
accel->writeADDR(kSendAddress, &status);
|
||||
accel->writeCNTL(kControlStart | kControlTxRx, &status);
|
||||
accel->writeDATO(reg, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
// Receive a message with the data and stop
|
||||
accel->writeADDR(kReceiveAddress, &status);
|
||||
accel->writeCNTL(kControlStart | kControlStop | kControlTxRx, &status);
|
||||
accel->strobeGO(&status);
|
||||
|
||||
// Execute and wait until it's done (up to a millisecond)
|
||||
initialTime = getFPGATime(&status);
|
||||
while(accel->readSTAT(&status) & 1) {
|
||||
if(getFPGATime(&status) > initialTime + 1000) break;
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
return accel->readDATI(&status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a 12-bit raw acceleration value into a scaled double in units of
|
||||
* 1 g-force, taking into account the accelerometer range.
|
||||
*/
|
||||
static double unpackAxis(int16_t raw) {
|
||||
// The raw value is actually 12 bits, not 16, so we need to propogate the
|
||||
// 2's complement sign bit to the unused 4 bits for this to work with
|
||||
// negative numbers.
|
||||
raw <<= 4;
|
||||
raw >>= 4;
|
||||
|
||||
switch(accelerometerRange) {
|
||||
case kRange_2G: return raw / 1024.0;
|
||||
case kRange_4G: return raw / 512.0;
|
||||
case kRange_8G: return raw / 256.0;
|
||||
default: return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the accelerometer to active or standby mode. It must be in standby
|
||||
* mode to change any configuration.
|
||||
*/
|
||||
void setAccelerometerActive(bool active) {
|
||||
initializeAccelerometer();
|
||||
|
||||
uint8_t ctrlReg1 = readRegister(kReg_CtrlReg1);
|
||||
ctrlReg1 &= ~1; // Clear the existing active bit
|
||||
writeRegister(kReg_CtrlReg1, ctrlReg1 | (active? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the range of values that can be measured (either 2, 4, or 8 g-forces).
|
||||
* The accelerometer should be in standby mode when this is called.
|
||||
*/
|
||||
void setAccelerometerRange(AccelerometerRange range) {
|
||||
initializeAccelerometer();
|
||||
|
||||
accelerometerRange = range;
|
||||
|
||||
uint8_t xyzDataCfg = readRegister(kReg_XYZDataCfg);
|
||||
xyzDataCfg &= ~3; // Clear the existing two range bits
|
||||
writeRegister(kReg_XYZDataCfg, xyzDataCfg | range);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the x-axis acceleration
|
||||
*
|
||||
* This is a floating point value in units of 1 g-force
|
||||
*/
|
||||
double getAccelerometerX() {
|
||||
initializeAccelerometer();
|
||||
|
||||
int raw = (readRegister(kReg_OutXMSB) << 4) | (readRegister(kReg_OutXLSB) >> 4);
|
||||
return unpackAxis(raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the y-axis acceleration
|
||||
*
|
||||
* This is a floating point value in units of 1 g-force
|
||||
*/
|
||||
double getAccelerometerY() {
|
||||
initializeAccelerometer();
|
||||
|
||||
int raw = (readRegister(kReg_OutYMSB) << 4) | (readRegister(kReg_OutYLSB) >> 4);
|
||||
return unpackAxis(raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the z-axis acceleration
|
||||
*
|
||||
* This is a floating point value in units of 1 g-force
|
||||
*/
|
||||
double getAccelerometerZ() {
|
||||
initializeAccelerometer();
|
||||
|
||||
int raw = (readRegister(kReg_OutZMSB) << 4) | (readRegister(kReg_OutZLSB) >> 4);
|
||||
return unpackAxis(raw);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ bool checkAnalogModule(uint8_t module) {
|
||||
* @return Analog channel is valid
|
||||
*/
|
||||
bool checkAnalogInputChannel(uint32_t pin) {
|
||||
if (pin >= 0 && pin < kAnalogInputPins)
|
||||
if (pin < kAnalogInputPins)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ bool checkAnalogInputChannel(uint32_t pin) {
|
||||
* @return Analog channel is valid
|
||||
*/
|
||||
bool checkAnalogOutputChannel(uint32_t pin) {
|
||||
if (pin >= 0 && pin < kAnalogOutputPins)
|
||||
if (pin < kAnalogOutputPins)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -185,40 +185,6 @@ float getAnalogSampleRate(int32_t *status) {
|
||||
return (float)kTimebase / (float)ticksPerSample;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sample rate on the module.
|
||||
*
|
||||
* This is a global setting for the module and effects all channels.
|
||||
*
|
||||
* @param module The module to use
|
||||
* @param samplesPerSecond The number of samples per channel per second.
|
||||
*/
|
||||
void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status) {
|
||||
if (checkAnalogModule(module)) {
|
||||
setAnalogSampleRate(samplesPerSecond, status);
|
||||
} else {
|
||||
// XXX: Set error status
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current sample rate on the module.
|
||||
*
|
||||
* This assumes one entry in the scan list.
|
||||
* This is a global setting for the module and effects all channels.
|
||||
*
|
||||
* @param module The module to use
|
||||
* @return Sample rate.
|
||||
*/
|
||||
float getAnalogSampleRateWithModule(uint8_t module, int32_t *status) {
|
||||
if (checkAnalogModule(module)) {
|
||||
return getAnalogSampleRate(status);
|
||||
} else {
|
||||
return -1; // XXX: Set error status
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the number of averaging bits.
|
||||
*
|
||||
@@ -283,7 +249,7 @@ uint32_t getAnalogOversampleBits(void* analog_port_pointer, int32_t *status) {
|
||||
/**
|
||||
* Get a sample straight from the channel on this module.
|
||||
*
|
||||
* The sample is a 12-bit value representing the -10V to 10V range of the A/D converter in the module.
|
||||
* The sample is a 12-bit value representing the 0V to 5V range of the A/D converter in the module.
|
||||
* The units are in A/D converter codes. Use GetVoltage() to get the analog value in calibrated units.
|
||||
*
|
||||
* @param analog_port_pointer Pointer to the analog port to use.
|
||||
@@ -322,7 +288,7 @@ int16_t getAnalogValue(void* analog_port_pointer, int32_t *status) {
|
||||
*/
|
||||
int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) {
|
||||
AnalogPort* port = (AnalogPort*) analog_port_pointer;
|
||||
int16_t value;
|
||||
int32_t value;
|
||||
checkAnalogInputChannel(port->port.pin);
|
||||
|
||||
tAI::tReadSelect readSelect;
|
||||
@@ -333,7 +299,7 @@ int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) {
|
||||
Synchronized sync(analogRegisterWindowSemaphore);
|
||||
analogInputSystem->writeReadSelect(readSelect, status);
|
||||
analogInputSystem->strobeLatchOutput(status);
|
||||
value = (int16_t) analogInputSystem->readOutput(status);
|
||||
value = (int32_t) analogInputSystem->readOutput(status);
|
||||
}
|
||||
|
||||
return value;
|
||||
@@ -387,12 +353,12 @@ float getAnalogAverageVoltage(void* analog_port_pointer, int32_t *status) {
|
||||
* @return The raw value for the channel.
|
||||
*/
|
||||
int32_t getAnalogVoltsToValue(void* analog_port_pointer, double voltage, int32_t *status) {
|
||||
if (voltage > 10.0) {
|
||||
voltage = 10.0;
|
||||
if (voltage > 5.0) {
|
||||
voltage = 5.0;
|
||||
*status = VOLTAGE_OUT_OF_RANGE;
|
||||
}
|
||||
if (voltage < -10.0) {
|
||||
voltage = -10.0;
|
||||
if (voltage < 0.0) {
|
||||
voltage = 0.0;
|
||||
*status = VOLTAGE_OUT_OF_RANGE;
|
||||
}
|
||||
uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status);
|
||||
@@ -736,10 +702,6 @@ int getAnalogSampleRateIntHack(int32_t *status) {
|
||||
return floatToInt(getAnalogSampleRate(status));
|
||||
}
|
||||
|
||||
int getAnalogSampleRateWithModuleIntHack(uint8_t module, int32_t *status) {
|
||||
return floatToInt(getAnalogSampleRateWithModuleIntHack(module, status));
|
||||
}
|
||||
|
||||
int getAnalogVoltageIntHack(void* analog_port_pointer, int32_t *status) {
|
||||
return floatToInt(getAnalogVoltage(analog_port_pointer, status));
|
||||
}
|
||||
@@ -754,10 +716,6 @@ void setAnalogSampleRateIntHack(int samplesPerSecond, int32_t *status) {
|
||||
setAnalogSampleRate(intToFloat(samplesPerSecond), status);
|
||||
}
|
||||
|
||||
void setAnalogSampleRateWithModuleIntHack(uint8_t module, int samplesPerSecond, int32_t *status) {
|
||||
setAnalogSampleRateWithModule(module, intToFloat(samplesPerSecond), status);
|
||||
}
|
||||
|
||||
int32_t getAnalogVoltsToValueIntHack(void* analog_port_pointer, int voltage, int32_t *status) {
|
||||
return getAnalogVoltsToValue(analog_port_pointer, intToFloat(voltage), status);
|
||||
}
|
||||
|
||||
232
hal/lib/Athena/CAN.cpp
Normal file
232
hal/lib/Athena/CAN.cpp
Normal file
@@ -0,0 +1,232 @@
|
||||
#include "HAL/CAN.hpp"
|
||||
#include <map>
|
||||
|
||||
struct CANMessage
|
||||
{
|
||||
uint8_t data[8];
|
||||
};
|
||||
|
||||
static std::map<uint32_t, CANMessage> outgoingMessages;
|
||||
static std::map<uint32_t, CANMessage> incomingMessages;
|
||||
|
||||
static const uint32_t kFullMessageIDMask = 0x1fffffff;
|
||||
|
||||
/**
|
||||
* Gets the data from the outgoing hashmap and calls
|
||||
* CANSessionMux...sendMessage.
|
||||
*/
|
||||
void canTxSend(uint32_t arbID, uint8_t length, int32_t period)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
int32_t status;
|
||||
|
||||
FRC_NetworkCommunication_CANSessionMux_sendMessage(
|
||||
arbID, message.data, length, period, &status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time an single byte field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt8(uint32_t arbID, uint8_t offset, uint8_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
message.data[offset] = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a short integer field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
*(uint16_t *)(message.data + offset) = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a long integer field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
*(uint32_t *)(message.data + offset) = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time an 8.8 fixed point field changes in a message,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value)
|
||||
{
|
||||
int16_t raw = value * 255.0;
|
||||
|
||||
canTxPackInt16(arbID, offset, raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a 16.16 fixed point field changes in a message,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value)
|
||||
{
|
||||
int32_t raw = value * 65535.0;
|
||||
|
||||
canTxPackInt32(arbID, offset, raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint8_t canTxUnpackInt8(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return message.data[offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint16_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint32_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
double canTxUnpackFXP16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int16_t raw = canTxUnpackInt16(arbID, offset);
|
||||
|
||||
return raw / 255.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
double canTxUnpackFXP32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int32_t raw = canTxUnpackInt32(arbID, offset);
|
||||
|
||||
return raw / 65535.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data from CANSessionMux (if it's available) and put it in the incoming
|
||||
* hashmap.
|
||||
*
|
||||
* @return true if there's new data. Otherwise, the last received value should
|
||||
* still be in the hashmap.
|
||||
*/
|
||||
bool canRxReceive(uint32_t arbID)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
uint8_t length;
|
||||
uint32_t timestamp;
|
||||
int32_t status;
|
||||
|
||||
FRC_NetworkCommunication_CANSessionMux_receiveMessage(
|
||||
&arbID, kFullMessageIDMask, message.data, &length, ×tamp, &status);
|
||||
|
||||
return status != ERR_CANSessionMux_MessageNotFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint8_t canRxUnpackInt8(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return message.data[offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint16_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint32_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
double canRxUnpackFXP16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int16_t raw = canRxUnpackInt16(arbID, offset);
|
||||
|
||||
return raw / 255.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
double canRxUnpackFXP32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int32_t raw = canRxUnpackInt32(arbID, offset);
|
||||
|
||||
return raw / 65535.0;
|
||||
}
|
||||
@@ -4,33 +4,35 @@
|
||||
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#pragma once
|
||||
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
|
||||
|
||||
#include <stdint.h>
|
||||
#include "ChipObject/RoboRIO_FRC_ChipObject_Aliases.h"
|
||||
#include "ChipObject/tDMAManager.h"
|
||||
#include "ChipObject/tInterruptManager.h"
|
||||
#include "ChipObject/tSystem.h"
|
||||
#include "ChipObject/tSystemInterface.h"
|
||||
|
||||
#include "ChipObject/nInterfaceGlobals.h"
|
||||
#include "ChipObject/tAccel.h"
|
||||
#include "ChipObject/tAccumulator.h"
|
||||
#include "ChipObject/tAI.h"
|
||||
#include "ChipObject/tAlarm.h"
|
||||
#include "ChipObject/tAnalogTrigger.h"
|
||||
#include "ChipObject/tAO.h"
|
||||
#include "ChipObject/tBIST.h"
|
||||
#include "ChipObject/tCounter.h"
|
||||
#include "ChipObject/tDIO.h"
|
||||
#include "ChipObject/tDMA.h"
|
||||
#include "ChipObject/tEncoder.h"
|
||||
#include "ChipObject/tGlobal.h"
|
||||
#include "ChipObject/tInterrupt.h"
|
||||
#include "ChipObject/tPower.h"
|
||||
#include "ChipObject/tPWM.h"
|
||||
#include "ChipObject/tRelay.h"
|
||||
#include "ChipObject/tSPI.h"
|
||||
#include "ChipObject/tSysWatchdog.h"
|
||||
#include "FRC_FPGA_ChipObject/RoboRIO_FRC_ChipObject_Aliases.h"
|
||||
#include "FRC_FPGA_ChipObject/tDMAManager.h"
|
||||
#include "FRC_FPGA_ChipObject/tInterruptManager.h"
|
||||
#include "FRC_FPGA_ChipObject/tSystem.h"
|
||||
#include "FRC_FPGA_ChipObject/tSystemInterface.h"
|
||||
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/nInterfaceGlobals.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccel.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccumulator.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAI.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAlarm.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAnalogTrigger.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAO.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tBIST.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tCounter.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDIO.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDMA.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tEncoder.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tGlobal.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tInterrupt.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPower.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPWM.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tRelay.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSPI.h"
|
||||
#include "FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSysWatchdog.h"
|
||||
|
||||
// FIXME: these should not be here!
|
||||
using namespace nFPGA;
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_nInterfaceGlobals_h__
|
||||
#define __nFRC_2015_1_0_5_nInterfaceGlobals_h__
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
{
|
||||
extern unsigned int g_currentTargetClass;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_nInterfaceGlobals_h__
|
||||
@@ -1,107 +0,0 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Power_h__
|
||||
#define __nFRC_2015_1_0_5_Power_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
{
|
||||
|
||||
class tPower
|
||||
{
|
||||
public:
|
||||
tPower(){}
|
||||
virtual ~tPower(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tPower* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned User3V3 : 8;
|
||||
unsigned User5V : 8;
|
||||
unsigned User6V : 8;
|
||||
#else
|
||||
unsigned User6V : 8;
|
||||
unsigned User5V : 8;
|
||||
unsigned User3V3 : 8;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 24;
|
||||
};
|
||||
} tStatus;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned User3V3 : 1;
|
||||
unsigned User5V : 1;
|
||||
unsigned User6V : 1;
|
||||
#else
|
||||
unsigned User6V : 1;
|
||||
unsigned User5V : 1;
|
||||
unsigned User3V3 : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 3;
|
||||
};
|
||||
} tDisable;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tStatus_IfaceConstants;
|
||||
|
||||
virtual tStatus readStatus(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User3V3(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User5V(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDisable_IfaceConstants;
|
||||
|
||||
virtual void writeDisable(tDisable value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User3V3(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User5V(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User6V(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tDisable readDisable(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User3V3(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User5V(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tIndicateOutOfRange_IfaceConstants;
|
||||
|
||||
virtual void writeIndicateOutOfRange(bool value, tRioStatusCode *status) = 0;
|
||||
virtual bool readIndicateOutOfRange(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tPower(const tPower&);
|
||||
void operator=(const tPower&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Power_h__
|
||||
@@ -2,21 +2,20 @@
|
||||
#include "ctre/PCM.h"
|
||||
#include <iostream>
|
||||
|
||||
static const int NUM_PCMS = 2;
|
||||
extern PCM *modules[NUM_PCMS];
|
||||
extern void initializePCM();
|
||||
static const int NUM_MODULE_NUMBERS = 63;
|
||||
extern PCM *modules[NUM_MODULE_NUMBERS];
|
||||
extern void initializePCM(int module);
|
||||
|
||||
void *initializeCompressor(uint8_t module) {
|
||||
initializePCM();
|
||||
initializePCM(module);
|
||||
|
||||
return modules[module - 1];
|
||||
return modules[module];
|
||||
}
|
||||
|
||||
bool checkCompressorModule(uint8_t module) {
|
||||
return module > 0 and module <= NUM_PCMS;
|
||||
return module < NUM_MODULE_NUMBERS;
|
||||
}
|
||||
|
||||
|
||||
bool getCompressor(void *pcm_pointer, int32_t *status) {
|
||||
PCM *module = (PCM *)pcm_pointer;
|
||||
bool value;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,6 @@
|
||||
#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
#define __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
|
||||
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_5
|
||||
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_7
|
||||
|
||||
#endif // __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_C0EF_1_1_0_AI_h__
|
||||
#define __nFRC_C0EF_1_1_0_AI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_C0EF_1_1_0
|
||||
{
|
||||
|
||||
class tAI
|
||||
{
|
||||
public:
|
||||
tAI(){}
|
||||
virtual ~tAI(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tAI* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 2,
|
||||
} tIfaceConstants;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tCalOK_IfaceConstants;
|
||||
|
||||
virtual bool readCalOK(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDoneTime_IfaceConstants;
|
||||
|
||||
virtual unsigned int readDoneTime(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumOffsetRegisters = 8,
|
||||
} tOffset_IfaceConstants;
|
||||
|
||||
virtual signed int readOffset(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumLSBWeightRegisters = 8,
|
||||
} tLSBWeight_IfaceConstants;
|
||||
|
||||
virtual unsigned int readLSBWeight(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tAI(const tAI&);
|
||||
void operator=(const tAI&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_C0EF_1_1_0_AI_h__
|
||||
@@ -0,0 +1,69 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_C0EF_1_1_0_Global_h__
|
||||
#define __nFRC_C0EF_1_1_0_Global_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_C0EF_1_1_0
|
||||
{
|
||||
|
||||
class tGlobal
|
||||
{
|
||||
public:
|
||||
tGlobal(){}
|
||||
virtual ~tGlobal(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tGlobal* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tVersion_IfaceConstants;
|
||||
|
||||
virtual unsigned short readVersion(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tLocalTime_IfaceConstants;
|
||||
|
||||
virtual unsigned int readLocalTime(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tRevision_IfaceConstants;
|
||||
|
||||
virtual unsigned int readRevision(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReserved_IfaceConstants;
|
||||
|
||||
virtual unsigned char readReserved(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tGlobal(const tGlobal&);
|
||||
void operator=(const tGlobal&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_C0EF_1_1_0_Global_h__
|
||||
@@ -0,0 +1,79 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_C0EF_1_1_0_LoadOut_h__
|
||||
#define __nFRC_C0EF_1_1_0_LoadOut_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_C0EF_1_1_0
|
||||
{
|
||||
|
||||
class tLoadOut
|
||||
{
|
||||
public:
|
||||
tLoadOut(){}
|
||||
virtual ~tLoadOut(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tLoadOut* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReady_IfaceConstants;
|
||||
|
||||
virtual bool readReady(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDoneTime_IfaceConstants;
|
||||
|
||||
virtual unsigned int readDoneTime(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumVendorIDRegisters = 8,
|
||||
} tVendorID_IfaceConstants;
|
||||
|
||||
virtual unsigned short readVendorID(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSerialNumberRegisters = 8,
|
||||
} tSerialNumber_IfaceConstants;
|
||||
|
||||
virtual unsigned int readSerialNumber(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumModuleIDRegisters = 8,
|
||||
} tModuleID_IfaceConstants;
|
||||
|
||||
virtual unsigned short readModuleID(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
private:
|
||||
tLoadOut(const tLoadOut&);
|
||||
void operator=(const tLoadOut&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_C0EF_1_1_0_LoadOut_h__
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_nInterfaceGlobals_h__
|
||||
#define __nFRC_2015_1_0_7_nInterfaceGlobals_h__
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
extern unsigned int g_currentTargetClass;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_nInterfaceGlobals_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_AI_h__
|
||||
#define __nFRC_2015_1_0_5_AI_h__
|
||||
#ifndef __nFRC_2015_1_0_7_AI_h__
|
||||
#define __nFRC_2015_1_0_7_AI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tAI
|
||||
@@ -140,4 +140,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_AI_h__
|
||||
#endif // __nFRC_2015_1_0_7_AI_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_AO_h__
|
||||
#define __nFRC_2015_1_0_5_AO_h__
|
||||
#ifndef __nFRC_2015_1_0_7_AO_h__
|
||||
#define __nFRC_2015_1_0_7_AO_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tAO
|
||||
@@ -47,4 +47,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_AO_h__
|
||||
#endif // __nFRC_2015_1_0_7_AO_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Accel_h__
|
||||
#define __nFRC_2015_1_0_5_Accel_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Accel_h__
|
||||
#define __nFRC_2015_1_0_7_Accel_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tAccel
|
||||
@@ -99,4 +99,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Accel_h__
|
||||
#endif // __nFRC_2015_1_0_7_Accel_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Accumulator_h__
|
||||
#define __nFRC_2015_1_0_5_Accumulator_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Accumulator_h__
|
||||
#define __nFRC_2015_1_0_7_Accumulator_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tAccumulator
|
||||
@@ -84,4 +84,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Accumulator_h__
|
||||
#endif // __nFRC_2015_1_0_7_Accumulator_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Alarm_h__
|
||||
#define __nFRC_2015_1_0_5_Alarm_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Alarm_h__
|
||||
#define __nFRC_2015_1_0_7_Alarm_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tAlarm
|
||||
@@ -54,4 +54,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Alarm_h__
|
||||
#endif // __nFRC_2015_1_0_7_Alarm_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_AnalogTrigger_h__
|
||||
#define __nFRC_2015_1_0_5_AnalogTrigger_h__
|
||||
#ifndef __nFRC_2015_1_0_7_AnalogTrigger_h__
|
||||
#define __nFRC_2015_1_0_7_AnalogTrigger_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tAnalogTrigger
|
||||
@@ -126,4 +126,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_AnalogTrigger_h__
|
||||
#endif // __nFRC_2015_1_0_7_AnalogTrigger_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_BIST_h__
|
||||
#define __nFRC_2015_1_0_5_BIST_h__
|
||||
#ifndef __nFRC_2015_1_0_7_BIST_h__
|
||||
#define __nFRC_2015_1_0_7_BIST_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tBIST
|
||||
@@ -87,4 +87,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_BIST_h__
|
||||
#endif // __nFRC_2015_1_0_7_BIST_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Counter_h__
|
||||
#define __nFRC_2015_1_0_5_Counter_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Counter_h__
|
||||
#define __nFRC_2015_1_0_7_Counter_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tCounter
|
||||
@@ -216,4 +216,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Counter_h__
|
||||
#endif // __nFRC_2015_1_0_7_Counter_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_DIO_h__
|
||||
#define __nFRC_2015_1_0_5_DIO_h__
|
||||
#ifndef __nFRC_2015_1_0_7_DIO_h__
|
||||
#define __nFRC_2015_1_0_7_DIO_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tDIO
|
||||
@@ -137,15 +137,6 @@ public:
|
||||
virtual unsigned char readFilterSelectHdr(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumFilterPeriodMXPElements = 3,
|
||||
} tFilterPeriodMXP_IfaceConstants;
|
||||
|
||||
virtual void writeFilterPeriodMXP(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readFilterPeriodMXP(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOutputEnable_IfaceConstants;
|
||||
@@ -218,15 +209,6 @@ public:
|
||||
virtual unsigned char readPulseLength(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumFilterPeriodHdrElements = 3,
|
||||
} tFilterPeriodHdr_IfaceConstants;
|
||||
|
||||
virtual void writeFilterPeriodHdr(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readFilterPeriodHdr(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tPWMPeriodPower_IfaceConstants;
|
||||
@@ -237,6 +219,24 @@ public:
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumFilterPeriodMXPRegisters = 3,
|
||||
} tFilterPeriodMXP_IfaceConstants;
|
||||
|
||||
virtual void writeFilterPeriodMXP(unsigned char reg_index, unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readFilterPeriodMXP(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumFilterPeriodHdrRegisters = 3,
|
||||
} tFilterPeriodHdr_IfaceConstants;
|
||||
|
||||
virtual void writeFilterPeriodHdr(unsigned char reg_index, unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readFilterPeriodHdr(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
private:
|
||||
tDIO(const tDIO&);
|
||||
void operator=(const tDIO&);
|
||||
@@ -245,4 +245,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_DIO_h__
|
||||
#endif // __nFRC_2015_1_0_7_DIO_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_DMA_h__
|
||||
#define __nFRC_2015_1_0_5_DMA_h__
|
||||
#ifndef __nFRC_2015_1_0_7_DMA_h__
|
||||
#define __nFRC_2015_1_0_7_DMA_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tDMA
|
||||
@@ -185,4 +185,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_DMA_h__
|
||||
#endif // __nFRC_2015_1_0_7_DMA_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Encoder_h__
|
||||
#define __nFRC_2015_1_0_5_Encoder_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Encoder_h__
|
||||
#define __nFRC_2015_1_0_7_Encoder_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tEncoder
|
||||
@@ -196,4 +196,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Encoder_h__
|
||||
#endif // __nFRC_2015_1_0_7_Encoder_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Global_h__
|
||||
#define __nFRC_2015_1_0_5_Global_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Global_h__
|
||||
#define __nFRC_2015_1_0_7_Global_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tGlobal
|
||||
@@ -101,4 +101,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Global_h__
|
||||
#endif // __nFRC_2015_1_0_7_Global_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Interrupt_h__
|
||||
#define __nFRC_2015_1_0_5_Interrupt_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Interrupt_h__
|
||||
#define __nFRC_2015_1_0_7_Interrupt_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tInterrupt
|
||||
@@ -90,4 +90,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Interrupt_h__
|
||||
#endif // __nFRC_2015_1_0_7_Interrupt_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_PWM_h__
|
||||
#define __nFRC_2015_1_0_5_PWM_h__
|
||||
#ifndef __nFRC_2015_1_0_7_PWM_h__
|
||||
#define __nFRC_2015_1_0_7_PWM_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tPWM
|
||||
@@ -108,4 +108,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_PWM_h__
|
||||
#endif // __nFRC_2015_1_0_7_PWM_h__
|
||||
@@ -0,0 +1,217 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Power_h__
|
||||
#define __nFRC_2015_1_0_7_Power_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tPower
|
||||
{
|
||||
public:
|
||||
tPower(){}
|
||||
virtual ~tPower(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tPower* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned User3V3 : 8;
|
||||
unsigned User5V : 8;
|
||||
unsigned User6V : 8;
|
||||
#else
|
||||
unsigned User6V : 8;
|
||||
unsigned User5V : 8;
|
||||
unsigned User3V3 : 8;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 24;
|
||||
};
|
||||
} tStatus;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned OverCurrentFaultCount3V3 : 10;
|
||||
unsigned OverCurrentFaultCount5V : 10;
|
||||
unsigned OverCurrentFaultCount6V : 10;
|
||||
#else
|
||||
unsigned OverCurrentFaultCount6V : 10;
|
||||
unsigned OverCurrentFaultCount5V : 10;
|
||||
unsigned OverCurrentFaultCount3V3 : 10;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 30;
|
||||
};
|
||||
} tOverCurrentFaultCounts;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned User3V3 : 1;
|
||||
unsigned User5V : 1;
|
||||
unsigned User6V : 1;
|
||||
#else
|
||||
unsigned User6V : 1;
|
||||
unsigned User5V : 1;
|
||||
unsigned User3V3 : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 3;
|
||||
};
|
||||
} tDisable;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tUserVoltage3V3_IfaceConstants;
|
||||
|
||||
virtual unsigned short readUserVoltage3V3(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tStatus_IfaceConstants;
|
||||
|
||||
virtual tStatus readStatus(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User3V3(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User5V(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readStatus_User6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tUserVoltage6V_IfaceConstants;
|
||||
|
||||
virtual unsigned short readUserVoltage6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOnChipTemperature_IfaceConstants;
|
||||
|
||||
virtual unsigned short readOnChipTemperature(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tUserVoltage5V_IfaceConstants;
|
||||
|
||||
virtual unsigned short readUserVoltage5V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tResetFaultCounts_IfaceConstants;
|
||||
|
||||
virtual void strobeResetFaultCounts(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOverCurrentFaultCounts_IfaceConstants;
|
||||
|
||||
virtual tOverCurrentFaultCounts readOverCurrentFaultCounts(tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readOverCurrentFaultCounts_OverCurrentFaultCount3V3(tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readOverCurrentFaultCounts_OverCurrentFaultCount5V(tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readOverCurrentFaultCounts_OverCurrentFaultCount6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tIntegratedIO_IfaceConstants;
|
||||
|
||||
virtual unsigned short readIntegratedIO(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tMXP_DIOVoltage_IfaceConstants;
|
||||
|
||||
virtual unsigned short readMXP_DIOVoltage(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tUserCurrent3V3_IfaceConstants;
|
||||
|
||||
virtual unsigned short readUserCurrent3V3(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tVinVoltage_IfaceConstants;
|
||||
|
||||
virtual unsigned short readVinVoltage(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tUserCurrent6V_IfaceConstants;
|
||||
|
||||
virtual unsigned short readUserCurrent6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tUserCurrent5V_IfaceConstants;
|
||||
|
||||
virtual unsigned short readUserCurrent5V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tAOVoltage_IfaceConstants;
|
||||
|
||||
virtual unsigned short readAOVoltage(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tVinCurrent_IfaceConstants;
|
||||
|
||||
virtual unsigned short readVinCurrent(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDisable_IfaceConstants;
|
||||
|
||||
virtual void writeDisable(tDisable value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User3V3(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User5V(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDisable_User6V(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tDisable readDisable(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User3V3(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User5V(tRioStatusCode *status) = 0;
|
||||
virtual bool readDisable_User6V(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tPower(const tPower&);
|
||||
void operator=(const tPower&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Power_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_Relay_h__
|
||||
#define __nFRC_2015_1_0_5_Relay_h__
|
||||
#ifndef __nFRC_2015_1_0_7_Relay_h__
|
||||
#define __nFRC_2015_1_0_7_Relay_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tRelay
|
||||
@@ -65,4 +65,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_Relay_h__
|
||||
#endif // __nFRC_2015_1_0_7_Relay_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_SPI_h__
|
||||
#define __nFRC_2015_1_0_5_SPI_h__
|
||||
#ifndef __nFRC_2015_1_0_7_SPI_h__
|
||||
#define __nFRC_2015_1_0_7_SPI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tSPI
|
||||
@@ -65,4 +65,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_SPI_h__
|
||||
#endif // __nFRC_2015_1_0_7_SPI_h__
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_5_SysWatchdog_h__
|
||||
#define __nFRC_2015_1_0_5_SysWatchdog_h__
|
||||
#ifndef __nFRC_2015_1_0_7_SysWatchdog_h__
|
||||
#define __nFRC_2015_1_0_7_SysWatchdog_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_5
|
||||
namespace nFRC_2015_1_0_7
|
||||
{
|
||||
|
||||
class tSysWatchdog
|
||||
@@ -98,4 +98,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_5_SysWatchdog_h__
|
||||
#endif // __nFRC_2015_1_0_7_SysWatchdog_h__
|
||||
149
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tAI.h
Normal file
149
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tAI.h
Normal file
@@ -0,0 +1,149 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_AI_h__
|
||||
#define __nFRC_2012_1_6_4_AI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tAI
|
||||
{
|
||||
public:
|
||||
tAI(){}
|
||||
virtual ~tAI(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tAI* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 2,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Channel : 3;
|
||||
unsigned Module : 1;
|
||||
unsigned Averaged : 1;
|
||||
#else
|
||||
unsigned Averaged : 1;
|
||||
unsigned Module : 1;
|
||||
unsigned Channel : 3;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 5;
|
||||
};
|
||||
} tReadSelect;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned ScanSize : 3;
|
||||
unsigned ConvertRate : 26;
|
||||
#else
|
||||
unsigned ConvertRate : 26;
|
||||
unsigned ScanSize : 3;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 29;
|
||||
};
|
||||
} tConfig;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tConfig_IfaceConstants;
|
||||
|
||||
virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ScanSize(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ConvertRate(unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual tConfig readConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_ScanSize(tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readConfig_ConvertRate(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tLoopTiming_IfaceConstants;
|
||||
|
||||
virtual unsigned int readLoopTiming(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumOversampleBitsElements = 8,
|
||||
} tOversampleBits_IfaceConstants;
|
||||
|
||||
virtual void writeOversampleBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readOversampleBits(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumAverageBitsElements = 8,
|
||||
} tAverageBits_IfaceConstants;
|
||||
|
||||
virtual void writeAverageBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readAverageBits(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumScanListElements = 8,
|
||||
} tScanList_IfaceConstants;
|
||||
|
||||
virtual void writeScanList(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readScanList(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOutput_IfaceConstants;
|
||||
|
||||
virtual signed int readOutput(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tLatchOutput_IfaceConstants;
|
||||
|
||||
virtual void strobeLatchOutput(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReadSelect_IfaceConstants;
|
||||
|
||||
virtual void writeReadSelect(tReadSelect value, tRioStatusCode *status) = 0;
|
||||
virtual void writeReadSelect_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeReadSelect_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeReadSelect_Averaged(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tReadSelect readReadSelect(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readReadSelect_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readReadSelect_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readReadSelect_Averaged(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tAI(const tAI&);
|
||||
void operator=(const tAI&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_AI_h__
|
||||
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_Accumulator_h__
|
||||
#define __nFRC_2012_1_6_4_Accumulator_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tAccumulator
|
||||
{
|
||||
public:
|
||||
tAccumulator(){}
|
||||
virtual ~tAccumulator(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tAccumulator* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 2,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
signed long long Value;
|
||||
unsigned Count : 32;
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
unsigned value2 : 32;
|
||||
unsigned value3 : 32;
|
||||
};
|
||||
} tOutput;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOutput_IfaceConstants;
|
||||
|
||||
virtual tOutput readOutput(tRioStatusCode *status) = 0;
|
||||
virtual signed long long readOutput_Value(tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readOutput_Count(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tCenter_IfaceConstants;
|
||||
|
||||
virtual void writeCenter(signed int value, tRioStatusCode *status) = 0;
|
||||
virtual signed int readCenter(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDeadband_IfaceConstants;
|
||||
|
||||
virtual void writeDeadband(signed int value, tRioStatusCode *status) = 0;
|
||||
virtual signed int readDeadband(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReset_IfaceConstants;
|
||||
|
||||
virtual void strobeReset(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tAccumulator(const tAccumulator&);
|
||||
void operator=(const tAccumulator&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_Accumulator_h__
|
||||
@@ -0,0 +1,57 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_Alarm_h__
|
||||
#define __nFRC_2012_1_6_4_Alarm_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tAlarm
|
||||
{
|
||||
public:
|
||||
tAlarm(){}
|
||||
virtual ~tAlarm(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tAlarm* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tEnable_IfaceConstants;
|
||||
|
||||
virtual void writeEnable(bool value, tRioStatusCode *status) = 0;
|
||||
virtual bool readEnable(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tTriggerTime_IfaceConstants;
|
||||
|
||||
virtual void writeTriggerTime(unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readTriggerTime(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tAlarm(const tAlarm&);
|
||||
void operator=(const tAlarm&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_Alarm_h__
|
||||
@@ -0,0 +1,133 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_AnalogTrigger_h__
|
||||
#define __nFRC_2012_1_6_4_AnalogTrigger_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tAnalogTrigger
|
||||
{
|
||||
public:
|
||||
tAnalogTrigger(){}
|
||||
virtual ~tAnalogTrigger(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tAnalogTrigger* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 8,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned InHysteresis : 1;
|
||||
unsigned OverLimit : 1;
|
||||
unsigned Rising : 1;
|
||||
unsigned Falling : 1;
|
||||
#else
|
||||
unsigned Falling : 1;
|
||||
unsigned Rising : 1;
|
||||
unsigned OverLimit : 1;
|
||||
unsigned InHysteresis : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 4;
|
||||
};
|
||||
} tOutput;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Channel : 3;
|
||||
unsigned Module : 1;
|
||||
unsigned Averaged : 1;
|
||||
unsigned Filter : 1;
|
||||
unsigned FloatingRollover : 1;
|
||||
signed RolloverLimit : 8;
|
||||
#else
|
||||
signed RolloverLimit : 8;
|
||||
unsigned FloatingRollover : 1;
|
||||
unsigned Filter : 1;
|
||||
unsigned Averaged : 1;
|
||||
unsigned Module : 1;
|
||||
unsigned Channel : 3;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 15;
|
||||
};
|
||||
} tSourceSelect;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tSourceSelect_IfaceConstants;
|
||||
|
||||
virtual void writeSourceSelect(tSourceSelect value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSourceSelect_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSourceSelect_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSourceSelect_Averaged(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSourceSelect_Filter(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSourceSelect_FloatingRollover(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSourceSelect_RolloverLimit(signed short value, tRioStatusCode *status) = 0;
|
||||
virtual tSourceSelect readSourceSelect(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readSourceSelect_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readSourceSelect_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readSourceSelect_Averaged(tRioStatusCode *status) = 0;
|
||||
virtual bool readSourceSelect_Filter(tRioStatusCode *status) = 0;
|
||||
virtual bool readSourceSelect_FloatingRollover(tRioStatusCode *status) = 0;
|
||||
virtual signed short readSourceSelect_RolloverLimit(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tUpperLimit_IfaceConstants;
|
||||
|
||||
virtual void writeUpperLimit(signed int value, tRioStatusCode *status) = 0;
|
||||
virtual signed int readUpperLimit(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tLowerLimit_IfaceConstants;
|
||||
|
||||
virtual void writeLowerLimit(signed int value, tRioStatusCode *status) = 0;
|
||||
virtual signed int readLowerLimit(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumOutputElements = 8,
|
||||
} tOutput_IfaceConstants;
|
||||
|
||||
virtual tOutput readOutput(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual bool readOutput_InHysteresis(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual bool readOutput_OverLimit(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual bool readOutput_Rising(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual bool readOutput_Falling(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tAnalogTrigger(const tAnalogTrigger&);
|
||||
void operator=(const tAnalogTrigger&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_AnalogTrigger_h__
|
||||
@@ -0,0 +1,219 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_Counter_h__
|
||||
#define __nFRC_2012_1_6_4_Counter_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tCounter
|
||||
{
|
||||
public:
|
||||
tCounter(){}
|
||||
virtual ~tCounter(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tCounter* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 8,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Direction : 1;
|
||||
signed Value : 31;
|
||||
#else
|
||||
signed Value : 31;
|
||||
unsigned Direction : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tOutput;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned UpSource_Channel : 4;
|
||||
unsigned UpSource_Module : 1;
|
||||
unsigned UpSource_AnalogTrigger : 1;
|
||||
unsigned DownSource_Channel : 4;
|
||||
unsigned DownSource_Module : 1;
|
||||
unsigned DownSource_AnalogTrigger : 1;
|
||||
unsigned IndexSource_Channel : 4;
|
||||
unsigned IndexSource_Module : 1;
|
||||
unsigned IndexSource_AnalogTrigger : 1;
|
||||
unsigned IndexActiveHigh : 1;
|
||||
unsigned UpRisingEdge : 1;
|
||||
unsigned UpFallingEdge : 1;
|
||||
unsigned DownRisingEdge : 1;
|
||||
unsigned DownFallingEdge : 1;
|
||||
unsigned Mode : 2;
|
||||
unsigned PulseLengthThreshold : 6;
|
||||
unsigned Enable : 1;
|
||||
#else
|
||||
unsigned Enable : 1;
|
||||
unsigned PulseLengthThreshold : 6;
|
||||
unsigned Mode : 2;
|
||||
unsigned DownFallingEdge : 1;
|
||||
unsigned DownRisingEdge : 1;
|
||||
unsigned UpFallingEdge : 1;
|
||||
unsigned UpRisingEdge : 1;
|
||||
unsigned IndexActiveHigh : 1;
|
||||
unsigned IndexSource_AnalogTrigger : 1;
|
||||
unsigned IndexSource_Module : 1;
|
||||
unsigned IndexSource_Channel : 4;
|
||||
unsigned DownSource_AnalogTrigger : 1;
|
||||
unsigned DownSource_Module : 1;
|
||||
unsigned DownSource_Channel : 4;
|
||||
unsigned UpSource_AnalogTrigger : 1;
|
||||
unsigned UpSource_Module : 1;
|
||||
unsigned UpSource_Channel : 4;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tConfig;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Period : 23;
|
||||
signed Count : 8;
|
||||
unsigned Stalled : 1;
|
||||
#else
|
||||
unsigned Stalled : 1;
|
||||
signed Count : 8;
|
||||
unsigned Period : 23;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tTimerOutput;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned StallPeriod : 24;
|
||||
unsigned AverageSize : 7;
|
||||
unsigned UpdateWhenEmpty : 1;
|
||||
#else
|
||||
unsigned UpdateWhenEmpty : 1;
|
||||
unsigned AverageSize : 7;
|
||||
unsigned StallPeriod : 24;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tTimerConfig;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOutput_IfaceConstants;
|
||||
|
||||
virtual tOutput readOutput(tRioStatusCode *status) = 0;
|
||||
virtual bool readOutput_Direction(tRioStatusCode *status) = 0;
|
||||
virtual signed int readOutput_Value(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tConfig_IfaceConstants;
|
||||
|
||||
virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_UpSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_UpSource_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_UpSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_DownSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_DownSource_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_DownSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_UpRisingEdge(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_UpFallingEdge(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_DownRisingEdge(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_DownFallingEdge(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Mode(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_PulseLengthThreshold(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tConfig readConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_UpSource_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_UpSource_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_UpSource_AnalogTrigger(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_DownSource_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_DownSource_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_DownSource_AnalogTrigger(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_UpRisingEdge(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_UpFallingEdge(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_DownRisingEdge(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_DownFallingEdge(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_Mode(tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readConfig_PulseLengthThreshold(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tTimerOutput_IfaceConstants;
|
||||
|
||||
virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0;
|
||||
virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0;
|
||||
virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReset_IfaceConstants;
|
||||
|
||||
virtual void strobeReset(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tTimerConfig_IfaceConstants;
|
||||
|
||||
virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0;
|
||||
virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tCounter(const tCounter&);
|
||||
void operator=(const tCounter&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_Counter_h__
|
||||
330
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tDIO.h
Normal file
330
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tDIO.h
Normal file
@@ -0,0 +1,330 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_DIO_h__
|
||||
#define __nFRC_2012_1_6_4_DIO_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tDIO
|
||||
{
|
||||
public:
|
||||
tDIO(){}
|
||||
virtual ~tDIO(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tDIO* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 2,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Period : 16;
|
||||
unsigned MinHigh : 16;
|
||||
#else
|
||||
unsigned MinHigh : 16;
|
||||
unsigned Period : 16;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tPWMConfig;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned RelayFwd : 8;
|
||||
unsigned RelayRev : 8;
|
||||
unsigned I2CHeader : 4;
|
||||
#else
|
||||
unsigned I2CHeader : 4;
|
||||
unsigned RelayRev : 8;
|
||||
unsigned RelayFwd : 8;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 20;
|
||||
};
|
||||
} tSlowValue;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Transaction : 1;
|
||||
unsigned Done : 1;
|
||||
unsigned Aborted : 1;
|
||||
unsigned DataReceivedHigh : 24;
|
||||
#else
|
||||
unsigned DataReceivedHigh : 24;
|
||||
unsigned Aborted : 1;
|
||||
unsigned Done : 1;
|
||||
unsigned Transaction : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 27;
|
||||
};
|
||||
} tI2CStatus;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Address : 8;
|
||||
unsigned BytesToRead : 3;
|
||||
unsigned BytesToWrite : 3;
|
||||
unsigned DataToSendHigh : 16;
|
||||
unsigned BitwiseHandshake : 1;
|
||||
#else
|
||||
unsigned BitwiseHandshake : 1;
|
||||
unsigned DataToSendHigh : 16;
|
||||
unsigned BytesToWrite : 3;
|
||||
unsigned BytesToRead : 3;
|
||||
unsigned Address : 8;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 31;
|
||||
};
|
||||
} tI2CConfig;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned PeriodPower : 4;
|
||||
unsigned OutputSelect_0 : 4;
|
||||
unsigned OutputSelect_1 : 4;
|
||||
unsigned OutputSelect_2 : 4;
|
||||
unsigned OutputSelect_3 : 4;
|
||||
#else
|
||||
unsigned OutputSelect_3 : 4;
|
||||
unsigned OutputSelect_2 : 4;
|
||||
unsigned OutputSelect_1 : 4;
|
||||
unsigned OutputSelect_0 : 4;
|
||||
unsigned PeriodPower : 4;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 20;
|
||||
};
|
||||
} tDO_PWMConfig;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumFilterSelectElements = 16,
|
||||
} tFilterSelect_IfaceConstants;
|
||||
|
||||
virtual void writeFilterSelect(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readFilterSelect(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tI2CDataToSend_IfaceConstants;
|
||||
|
||||
virtual void writeI2CDataToSend(unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readI2CDataToSend(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDO_IfaceConstants;
|
||||
|
||||
virtual void writeDO(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readDO(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumFilterPeriodElements = 3,
|
||||
} tFilterPeriod_IfaceConstants;
|
||||
|
||||
virtual void writeFilterPeriod(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readFilterPeriod(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOutputEnable_IfaceConstants;
|
||||
|
||||
virtual void writeOutputEnable(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readOutputEnable(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tPulse_IfaceConstants;
|
||||
|
||||
virtual void writePulse(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readPulse(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tSlowValue_IfaceConstants;
|
||||
|
||||
virtual void writeSlowValue(tSlowValue value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSlowValue_RelayFwd(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSlowValue_RelayRev(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeSlowValue_I2CHeader(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual tSlowValue readSlowValue(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readSlowValue_RelayFwd(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readSlowValue_RelayRev(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readSlowValue_I2CHeader(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tI2CStatus_IfaceConstants;
|
||||
|
||||
virtual tI2CStatus readI2CStatus(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readI2CStatus_Transaction(tRioStatusCode *status) = 0;
|
||||
virtual bool readI2CStatus_Done(tRioStatusCode *status) = 0;
|
||||
virtual bool readI2CStatus_Aborted(tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readI2CStatus_DataReceivedHigh(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tI2CDataReceived_IfaceConstants;
|
||||
|
||||
virtual unsigned int readI2CDataReceived(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDI_IfaceConstants;
|
||||
|
||||
virtual unsigned short readDI(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tPulseLength_IfaceConstants;
|
||||
|
||||
virtual void writePulseLength(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readPulseLength(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumPWMPeriodScaleElements = 10,
|
||||
} tPWMPeriodScale_IfaceConstants;
|
||||
|
||||
virtual void writePWMPeriodScale(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readPWMPeriodScale(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumDO_PWMDutyCycleElements = 4,
|
||||
} tDO_PWMDutyCycle_IfaceConstants;
|
||||
|
||||
virtual void writeDO_PWMDutyCycle(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readDO_PWMDutyCycle(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tBFL_IfaceConstants;
|
||||
|
||||
virtual void writeBFL(bool value, tRioStatusCode *status) = 0;
|
||||
virtual bool readBFL(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tI2CConfig_IfaceConstants;
|
||||
|
||||
virtual void writeI2CConfig(tI2CConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeI2CConfig_Address(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeI2CConfig_BytesToRead(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeI2CConfig_BytesToWrite(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeI2CConfig_DataToSendHigh(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual void writeI2CConfig_BitwiseHandshake(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tI2CConfig readI2CConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readI2CConfig_Address(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readI2CConfig_BytesToRead(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readI2CConfig_BytesToWrite(tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readI2CConfig_DataToSendHigh(tRioStatusCode *status) = 0;
|
||||
virtual bool readI2CConfig_BitwiseHandshake(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDO_PWMConfig_IfaceConstants;
|
||||
|
||||
virtual void writeDO_PWMConfig(tDO_PWMConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDO_PWMConfig_PeriodPower(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDO_PWMConfig_OutputSelect_0(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDO_PWMConfig_OutputSelect_1(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDO_PWMConfig_OutputSelect_2(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeDO_PWMConfig_OutputSelect_3(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual tDO_PWMConfig readDO_PWMConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readDO_PWMConfig_PeriodPower(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readDO_PWMConfig_OutputSelect_0(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readDO_PWMConfig_OutputSelect_1(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readDO_PWMConfig_OutputSelect_2(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readDO_PWMConfig_OutputSelect_3(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tI2CStart_IfaceConstants;
|
||||
|
||||
virtual void strobeI2CStart(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tLoopTiming_IfaceConstants;
|
||||
|
||||
virtual unsigned short readLoopTiming(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tPWMConfig_IfaceConstants;
|
||||
|
||||
virtual void writePWMConfig(tPWMConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writePWMConfig_Period(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual void writePWMConfig_MinHigh(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual tPWMConfig readPWMConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readPWMConfig_Period(tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readPWMConfig_MinHigh(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumPWMValueRegisters = 10,
|
||||
} tPWMValue_IfaceConstants;
|
||||
|
||||
virtual void writePWMValue(unsigned char reg_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readPWMValue(unsigned char reg_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tDIO(const tDIO&);
|
||||
void operator=(const tDIO&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_DIO_h__
|
||||
188
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tDMA.h
Normal file
188
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tDMA.h
Normal file
@@ -0,0 +1,188 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_DMA_h__
|
||||
#define __nFRC_2012_1_6_4_DMA_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tDMA
|
||||
{
|
||||
public:
|
||||
tDMA(){}
|
||||
virtual ~tDMA(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tDMA* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Pause : 1;
|
||||
unsigned Enable_AI0_Low : 1;
|
||||
unsigned Enable_AI0_High : 1;
|
||||
unsigned Enable_AIAveraged0_Low : 1;
|
||||
unsigned Enable_AIAveraged0_High : 1;
|
||||
unsigned Enable_AI1_Low : 1;
|
||||
unsigned Enable_AI1_High : 1;
|
||||
unsigned Enable_AIAveraged1_Low : 1;
|
||||
unsigned Enable_AIAveraged1_High : 1;
|
||||
unsigned Enable_Accumulator0 : 1;
|
||||
unsigned Enable_Accumulator1 : 1;
|
||||
unsigned Enable_DI : 1;
|
||||
unsigned Enable_AnalogTriggers : 1;
|
||||
unsigned Enable_Counters_Low : 1;
|
||||
unsigned Enable_Counters_High : 1;
|
||||
unsigned Enable_CounterTimers_Low : 1;
|
||||
unsigned Enable_CounterTimers_High : 1;
|
||||
unsigned Enable_Encoders : 1;
|
||||
unsigned Enable_EncoderTimers : 1;
|
||||
unsigned ExternalClock : 1;
|
||||
#else
|
||||
unsigned ExternalClock : 1;
|
||||
unsigned Enable_EncoderTimers : 1;
|
||||
unsigned Enable_Encoders : 1;
|
||||
unsigned Enable_CounterTimers_High : 1;
|
||||
unsigned Enable_CounterTimers_Low : 1;
|
||||
unsigned Enable_Counters_High : 1;
|
||||
unsigned Enable_Counters_Low : 1;
|
||||
unsigned Enable_AnalogTriggers : 1;
|
||||
unsigned Enable_DI : 1;
|
||||
unsigned Enable_Accumulator1 : 1;
|
||||
unsigned Enable_Accumulator0 : 1;
|
||||
unsigned Enable_AIAveraged1_High : 1;
|
||||
unsigned Enable_AIAveraged1_Low : 1;
|
||||
unsigned Enable_AI1_High : 1;
|
||||
unsigned Enable_AI1_Low : 1;
|
||||
unsigned Enable_AIAveraged0_High : 1;
|
||||
unsigned Enable_AIAveraged0_Low : 1;
|
||||
unsigned Enable_AI0_High : 1;
|
||||
unsigned Enable_AI0_Low : 1;
|
||||
unsigned Pause : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 20;
|
||||
};
|
||||
} tConfig;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned ExternalClockSource_Channel : 4;
|
||||
unsigned ExternalClockSource_Module : 1;
|
||||
unsigned ExternalClockSource_AnalogTrigger : 1;
|
||||
unsigned RisingEdge : 1;
|
||||
unsigned FallingEdge : 1;
|
||||
#else
|
||||
unsigned FallingEdge : 1;
|
||||
unsigned RisingEdge : 1;
|
||||
unsigned ExternalClockSource_AnalogTrigger : 1;
|
||||
unsigned ExternalClockSource_Module : 1;
|
||||
unsigned ExternalClockSource_Channel : 4;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 8;
|
||||
};
|
||||
} tExternalTriggers;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tRate_IfaceConstants;
|
||||
|
||||
virtual void writeRate(unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readRate(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tConfig_IfaceConstants;
|
||||
|
||||
virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Pause(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AI0_Low(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AI0_High(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AIAveraged0_Low(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AIAveraged0_High(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AI1_Low(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AI1_High(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AIAveraged1_Low(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AIAveraged1_High(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_Accumulator0(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_Accumulator1(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_DI(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_AnalogTriggers(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_Counters_Low(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_Counters_High(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_CounterTimers_Low(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_CounterTimers_High(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_Encoders(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable_EncoderTimers(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ExternalClock(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tConfig readConfig(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Pause(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AI0_Low(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AI0_High(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AIAveraged0_Low(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AIAveraged0_High(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AI1_Low(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AI1_High(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AIAveraged1_Low(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AIAveraged1_High(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_Accumulator0(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_Accumulator1(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_DI(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_AnalogTriggers(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_Counters_Low(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_Counters_High(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_CounterTimers_Low(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_CounterTimers_High(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_Encoders(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable_EncoderTimers(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_ExternalClock(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumExternalTriggersElements = 4,
|
||||
} tExternalTriggers_IfaceConstants;
|
||||
|
||||
virtual void writeExternalTriggers(unsigned char bitfield_index, tExternalTriggers value, tRioStatusCode *status) = 0;
|
||||
virtual void writeExternalTriggers_ExternalClockSource_Channel(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeExternalTriggers_ExternalClockSource_Module(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeExternalTriggers_RisingEdge(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeExternalTriggers_FallingEdge(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
|
||||
virtual tExternalTriggers readExternalTriggers(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readExternalTriggers_ExternalClockSource_Channel(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readExternalTriggers_ExternalClockSource_Module(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual bool readExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual bool readExternalTriggers_RisingEdge(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
virtual bool readExternalTriggers_FallingEdge(unsigned char bitfield_index, tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tDMA(const tDMA&);
|
||||
void operator=(const tDMA&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_DMA_h__
|
||||
@@ -0,0 +1,199 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_Encoder_h__
|
||||
#define __nFRC_2012_1_6_4_Encoder_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tEncoder
|
||||
{
|
||||
public:
|
||||
tEncoder(){}
|
||||
virtual ~tEncoder(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tEncoder* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 4,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Direction : 1;
|
||||
signed Value : 31;
|
||||
#else
|
||||
signed Value : 31;
|
||||
unsigned Direction : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tOutput;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned ASource_Channel : 4;
|
||||
unsigned ASource_Module : 1;
|
||||
unsigned ASource_AnalogTrigger : 1;
|
||||
unsigned BSource_Channel : 4;
|
||||
unsigned BSource_Module : 1;
|
||||
unsigned BSource_AnalogTrigger : 1;
|
||||
unsigned IndexSource_Channel : 4;
|
||||
unsigned IndexSource_Module : 1;
|
||||
unsigned IndexSource_AnalogTrigger : 1;
|
||||
unsigned IndexActiveHigh : 1;
|
||||
unsigned Reverse : 1;
|
||||
unsigned Enable : 1;
|
||||
#else
|
||||
unsigned Enable : 1;
|
||||
unsigned Reverse : 1;
|
||||
unsigned IndexActiveHigh : 1;
|
||||
unsigned IndexSource_AnalogTrigger : 1;
|
||||
unsigned IndexSource_Module : 1;
|
||||
unsigned IndexSource_Channel : 4;
|
||||
unsigned BSource_AnalogTrigger : 1;
|
||||
unsigned BSource_Module : 1;
|
||||
unsigned BSource_Channel : 4;
|
||||
unsigned ASource_AnalogTrigger : 1;
|
||||
unsigned ASource_Module : 1;
|
||||
unsigned ASource_Channel : 4;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 21;
|
||||
};
|
||||
} tConfig;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Period : 23;
|
||||
signed Count : 8;
|
||||
unsigned Stalled : 1;
|
||||
#else
|
||||
unsigned Stalled : 1;
|
||||
signed Count : 8;
|
||||
unsigned Period : 23;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tTimerOutput;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned StallPeriod : 24;
|
||||
unsigned AverageSize : 7;
|
||||
unsigned UpdateWhenEmpty : 1;
|
||||
#else
|
||||
unsigned UpdateWhenEmpty : 1;
|
||||
unsigned AverageSize : 7;
|
||||
unsigned StallPeriod : 24;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 32;
|
||||
};
|
||||
} tTimerConfig;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tOutput_IfaceConstants;
|
||||
|
||||
virtual tOutput readOutput(tRioStatusCode *status) = 0;
|
||||
virtual bool readOutput_Direction(tRioStatusCode *status) = 0;
|
||||
virtual signed int readOutput_Value(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tConfig_IfaceConstants;
|
||||
|
||||
virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ASource_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ASource_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ASource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_BSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_BSource_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_BSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Reverse(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tConfig readConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_ASource_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_ASource_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_ASource_AnalogTrigger(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_BSource_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_BSource_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_BSource_AnalogTrigger(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Reverse(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Enable(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tTimerOutput_IfaceConstants;
|
||||
|
||||
virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0;
|
||||
virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0;
|
||||
virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReset_IfaceConstants;
|
||||
|
||||
virtual void strobeReset(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tTimerConfig_IfaceConstants;
|
||||
|
||||
virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0;
|
||||
virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tEncoder(const tEncoder&);
|
||||
void operator=(const tEncoder&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_Encoder_h__
|
||||
@@ -0,0 +1,70 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_Global_h__
|
||||
#define __nFRC_2012_1_6_4_Global_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tGlobal
|
||||
{
|
||||
public:
|
||||
tGlobal(){}
|
||||
virtual ~tGlobal(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tGlobal* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tVersion_IfaceConstants;
|
||||
|
||||
virtual unsigned short readVersion(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tLocalTime_IfaceConstants;
|
||||
|
||||
virtual unsigned int readLocalTime(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tFPGA_LED_IfaceConstants;
|
||||
|
||||
virtual void writeFPGA_LED(bool value, tRioStatusCode *status) = 0;
|
||||
virtual bool readFPGA_LED(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tRevision_IfaceConstants;
|
||||
|
||||
virtual unsigned int readRevision(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tGlobal(const tGlobal&);
|
||||
void operator=(const tGlobal&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_Global_h__
|
||||
@@ -0,0 +1,93 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_Interrupt_h__
|
||||
#define __nFRC_2012_1_6_4_Interrupt_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tInterrupt
|
||||
{
|
||||
public:
|
||||
tInterrupt(){}
|
||||
virtual ~tInterrupt(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tInterrupt* create(unsigned char sys_index, tRioStatusCode *status);
|
||||
virtual unsigned char getSystemIndex() = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 8,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned Source_Channel : 4;
|
||||
unsigned Source_Module : 1;
|
||||
unsigned Source_AnalogTrigger : 1;
|
||||
unsigned RisingEdge : 1;
|
||||
unsigned FallingEdge : 1;
|
||||
unsigned WaitForAck : 1;
|
||||
#else
|
||||
unsigned WaitForAck : 1;
|
||||
unsigned FallingEdge : 1;
|
||||
unsigned RisingEdge : 1;
|
||||
unsigned Source_AnalogTrigger : 1;
|
||||
unsigned Source_Module : 1;
|
||||
unsigned Source_Channel : 4;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 9;
|
||||
};
|
||||
} tConfig;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tTimeStamp_IfaceConstants;
|
||||
|
||||
virtual unsigned int readTimeStamp(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tConfig_IfaceConstants;
|
||||
|
||||
virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Source_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Source_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_Source_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_RisingEdge(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_FallingEdge(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_WaitForAck(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tConfig readConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_Source_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_Source_Module(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_Source_AnalogTrigger(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_RisingEdge(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_FallingEdge(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_WaitForAck(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tInterrupt(const tInterrupt&);
|
||||
void operator=(const tInterrupt&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_Interrupt_h__
|
||||
228
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tSPI.h
Normal file
228
hal/lib/Athena/FRC_FPGA_ChipObject/nRuntimeFPGANamespace/tSPI.h
Normal file
@@ -0,0 +1,228 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_SPI_h__
|
||||
#define __nFRC_2012_1_6_4_SPI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tSPI
|
||||
{
|
||||
public:
|
||||
tSPI(){}
|
||||
virtual ~tSPI(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tSPI* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned ReceivedDataOverflow : 1;
|
||||
unsigned Idle : 1;
|
||||
#else
|
||||
unsigned Idle : 1;
|
||||
unsigned ReceivedDataOverflow : 1;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 2;
|
||||
};
|
||||
} tStatus;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned BusBitWidth : 8;
|
||||
unsigned ClockHalfPeriodDelay : 8;
|
||||
unsigned MSBfirst : 1;
|
||||
unsigned DataOnFalling : 1;
|
||||
unsigned LatchFirst : 1;
|
||||
unsigned LatchLast : 1;
|
||||
unsigned FramePolarity : 1;
|
||||
unsigned WriteOnly : 1;
|
||||
unsigned ClockPolarity : 1;
|
||||
#else
|
||||
unsigned ClockPolarity : 1;
|
||||
unsigned WriteOnly : 1;
|
||||
unsigned FramePolarity : 1;
|
||||
unsigned LatchLast : 1;
|
||||
unsigned LatchFirst : 1;
|
||||
unsigned DataOnFalling : 1;
|
||||
unsigned MSBfirst : 1;
|
||||
unsigned ClockHalfPeriodDelay : 8;
|
||||
unsigned BusBitWidth : 8;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 23;
|
||||
};
|
||||
} tConfig;
|
||||
typedef
|
||||
union{
|
||||
struct{
|
||||
#ifdef __vxworks
|
||||
unsigned SCLK_Channel : 4;
|
||||
unsigned SCLK_Module : 1;
|
||||
unsigned MOSI_Channel : 4;
|
||||
unsigned MOSI_Module : 1;
|
||||
unsigned MISO_Channel : 4;
|
||||
unsigned MISO_Module : 1;
|
||||
unsigned SS_Channel : 4;
|
||||
unsigned SS_Module : 1;
|
||||
#else
|
||||
unsigned SS_Module : 1;
|
||||
unsigned SS_Channel : 4;
|
||||
unsigned MISO_Module : 1;
|
||||
unsigned MISO_Channel : 4;
|
||||
unsigned MOSI_Module : 1;
|
||||
unsigned MOSI_Channel : 4;
|
||||
unsigned SCLK_Module : 1;
|
||||
unsigned SCLK_Channel : 4;
|
||||
#endif
|
||||
};
|
||||
struct{
|
||||
unsigned value : 20;
|
||||
};
|
||||
} tChannels;
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tStatus_IfaceConstants;
|
||||
|
||||
virtual tStatus readStatus(tRioStatusCode *status) = 0;
|
||||
virtual bool readStatus_ReceivedDataOverflow(tRioStatusCode *status) = 0;
|
||||
virtual bool readStatus_Idle(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReceivedData_IfaceConstants;
|
||||
|
||||
virtual unsigned int readReceivedData(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tDataToLoad_IfaceConstants;
|
||||
|
||||
virtual void writeDataToLoad(unsigned int value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned int readDataToLoad(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tConfig_IfaceConstants;
|
||||
|
||||
virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_BusBitWidth(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ClockHalfPeriodDelay(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_MSBfirst(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_DataOnFalling(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_LatchFirst(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_LatchLast(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_FramePolarity(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_WriteOnly(bool value, tRioStatusCode *status) = 0;
|
||||
virtual void writeConfig_ClockPolarity(bool value, tRioStatusCode *status) = 0;
|
||||
virtual tConfig readConfig(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_BusBitWidth(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readConfig_ClockHalfPeriodDelay(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_MSBfirst(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_DataOnFalling(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_LatchFirst(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_LatchLast(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_FramePolarity(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_WriteOnly(tRioStatusCode *status) = 0;
|
||||
virtual bool readConfig_ClockPolarity(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tClearReceivedData_IfaceConstants;
|
||||
|
||||
virtual void strobeClearReceivedData(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReceivedElements_IfaceConstants;
|
||||
|
||||
virtual unsigned short readReceivedElements(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tLoad_IfaceConstants;
|
||||
|
||||
virtual void strobeLoad(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReset_IfaceConstants;
|
||||
|
||||
virtual void strobeReset(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tChannels_IfaceConstants;
|
||||
|
||||
virtual void writeChannels(tChannels value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_SCLK_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_SCLK_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_MOSI_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_MOSI_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_MISO_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_MISO_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_SS_Channel(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual void writeChannels_SS_Module(unsigned char value, tRioStatusCode *status) = 0;
|
||||
virtual tChannels readChannels(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_SCLK_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_SCLK_Module(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_MOSI_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_MOSI_Module(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_MISO_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_MISO_Module(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_SS_Channel(tRioStatusCode *status) = 0;
|
||||
virtual unsigned char readChannels_SS_Module(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tAvailableToLoad_IfaceConstants;
|
||||
|
||||
virtual unsigned short readAvailableToLoad(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tReadReceivedData_IfaceConstants;
|
||||
|
||||
virtual void strobeReadReceivedData(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tSPI(const tSPI&);
|
||||
void operator=(const tSPI&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_SPI_h__
|
||||
@@ -0,0 +1,71 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2012_1_6_4_SysWatchdog_h__
|
||||
#define __nFRC_2012_1_6_4_SysWatchdog_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2012_1_6_4
|
||||
{
|
||||
|
||||
class tSysWatchdog
|
||||
{
|
||||
public:
|
||||
tSysWatchdog(){}
|
||||
virtual ~tSysWatchdog(){}
|
||||
|
||||
virtual tSystemInterface* getSystemInterface() = 0;
|
||||
static tSysWatchdog* create(tRioStatusCode *status);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 1,
|
||||
} tIfaceConstants;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tCommand_IfaceConstants;
|
||||
|
||||
virtual void writeCommand(unsigned short value, tRioStatusCode *status) = 0;
|
||||
virtual unsigned short readCommand(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tChallenge_IfaceConstants;
|
||||
|
||||
virtual unsigned char readChallenge(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tActive_IfaceConstants;
|
||||
|
||||
virtual void writeActive(bool value, tRioStatusCode *status) = 0;
|
||||
virtual bool readActive(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
} tTimer_IfaceConstants;
|
||||
|
||||
virtual unsigned int readTimer(tRioStatusCode *status) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
tSysWatchdog(const tSysWatchdog&);
|
||||
void operator=(const tSysWatchdog&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2012_1_6_4_SysWatchdog_h__
|
||||
@@ -12,9 +12,9 @@ public:
|
||||
tSystemInterface(){}
|
||||
virtual ~tSystemInterface(){}
|
||||
|
||||
virtual uint16_t getExpectedFPGAVersion()=0;
|
||||
virtual uint32_t getExpectedFPGARevision()=0;
|
||||
virtual uint32_t * getExpectedFPGASignature()=0;
|
||||
virtual const uint16_t getExpectedFPGAVersion()=0;
|
||||
virtual const uint32_t getExpectedFPGARevision()=0;
|
||||
virtual const uint32_t * const getExpectedFPGASignature()=0;
|
||||
virtual void getHardwareFpgaSignature(uint32_t *guid_ptr, tRioStatusCode *status)=0;
|
||||
virtual uint32_t getLVHandle(tRioStatusCode *status)=0;
|
||||
virtual uint32_t getHandle()=0;
|
||||
@@ -23,4 +23,3 @@ public:
|
||||
}
|
||||
|
||||
#endif // __tSystemInterface_h__
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user