Version 4 Image

Updated the HAL library to work with the new version 3 headers
from NI. There were multiple changes in this verison: more PWM
generators were added, so the functions for setting PWM signals have
been updated. UserWatchdog has been removed, and Watchdog has been
removed from WPILib to accomodate for this. Digital selection has been
consolidated to one function in the NI headers, so this has been updated
in the HAL. New SPI and I2C libraries have been added, but need to
be implemented in the HAL before they will work.
This commit is contained in:
Fredric Silberberg
2014-02-25 18:43:40 -05:00
committed by Brad Miller
parent b1ef116104
commit 4546abc8c5
238 changed files with 757 additions and 21785 deletions

24
.hgignore Normal file
View File

@@ -0,0 +1,24 @@
# auto-generated from .gitignore files by build-hgignore.py
syntax: re
^\.hgignore$
.*/.*~$ # '*~' in 'eclipse-plugins'
eclipse-plugins/.*/target(?:/|$) # 'target/' in 'eclipse-plugins'
eclipse-plugins/.*/bin(?:/|$) # 'bin/' in 'eclipse-plugins'
eclipse-plugins/.*/\.settings(?:/|$) # '.settings/' in 'eclipse-plugins'
networktables/.*/target(?:/|$) # 'target/' in 'networktables'
networktables/.*/build(?:/|$) # 'build/' in 'networktables'
networktables/.*/dist(?:/|$) # 'dist/' in 'networktables'
^networktables/OutlineViewer/nbproject/private(?:/|$) # '/OutlineViewer/nbproject/private/' in 'networktables'
maven-utilities/.*/target(?:/|$) # 'target/' in 'maven-utilities'
hal/.*/.*#$ # '*#' in 'hal'
hal/.*/PPC603gnu(?:/|$) # 'PPC603gnu/' in 'hal'
hal/.*/Debug(?:/|$) # 'Debug/' in 'hal'
hal/.*/target(?:/|$) # 'target/' in 'hal'
hal/.*/tmp(?:/|$) # 'tmp/' in 'hal'
hal/.*/GPATH$ # 'GPATH' in 'hal'
hal/.*/GRTAGS$ # 'GRTAGS' in 'hal'
hal/.*/GSYMS$ # 'GSYMS' in 'hal'
hal/.*/GTAGS$ # 'GTAGS' in 'hal'
ni-libraries/.*/target(?:/|$) # 'target/' in 'ni-libraries'
wpilib.?/.*/target(?:/|$)

9
arm-toolchain.cmake Normal file
View File

@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 2.8)
INCLUDE(CMakeForceCompiler)
set(ARM_PREFIX arm-linux-gnueabi)
set(CMAKE_SYSTEM_NAME Linux)
CMAKE_FORCE_CXX_COMPILER(${ARM_PREFIX}-g++ GNU)
set(CMAKE_CXX_FLAGS "-march=armv7-a -mcpu=cortex-a9 -mfloat-abi=softfp -Wall" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g" CACHE STRING "" FORCE) # still want debugging for release?
SET(CMAKE_FIND_ROOT_PATH /home/patrick/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/arm-none-linux-gnueabi/libc)

View File

@@ -29,3 +29,4 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: edu.wpi.first.wpilib.plugins.cpp,
edu.wpi.first.wpilib.plugins.cpp.preferences
Bundle-Vendor: WPI & FIRST

View File

@@ -1,31 +1,38 @@
#include "$classname.h"
$classname::$classname() {
$classname::$classname()
{
// Use Requires() here to declare subsystem dependencies
// eg. Requires(chassis);
}
// Called just before this Command runs the first time
void $classname::Initialize() {
void $classname::Initialize()
{
}
// Called repeatedly when this Command is scheduled to run
void $classname::Execute() {
void $classname::Execute()
{
}
// Make this return true when this Command no longer needs to run execute()
bool $classname::IsFinished() {
bool $classname::IsFinished()
{
return false;
}
// Called once after isFinished returns true
void $classname::End() {
void $classname::End()
{
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void $classname::Interrupted() {
void $classname::Interrupted()
{
}

View File

@@ -3,19 +3,15 @@
#include "../CommandBase.h"
/**
*
*
* @author ExampleAuthor
*/
class $classname: public CommandBase {
class $classname: public CommandBase
{
public:
$classname();
virtual void Initialize();
virtual void Execute();
virtual bool IsFinished();
virtual void End();
virtual void Interrupted();
void Initialize();
void Execute();
bool IsFinished();
void End();
void Interrupted();
};
#endif

View File

@@ -2,20 +2,26 @@
#include "Subsystems/ExampleSubsystem.h"
#include "Commands/Scheduler.h"
CommandBase::CommandBase(const char *name) : Command(name) {
}
CommandBase::CommandBase() : Command() {
}
// Initialize a single static instance of all of your subsystems to NULL
ExampleSubsystem* CommandBase::examplesubsystem = NULL;
OI* CommandBase::oi = NULL;
void CommandBase::init() {
// Create a single static instance of all of your subsystems. The following
CommandBase::CommandBase(std::string name) :
Command(name)
{
}
CommandBase::CommandBase() :
Command()
{
}
void CommandBase::init()
{
// Create a single static instance of all of your subsystems. The following
// line should be repeated for each subsystem in the project.
examplesubsystem = new ExampleSubsystem();
oi = new OI();
}

View File

@@ -1,19 +1,20 @@
#ifndef COMMAND_BASE_H
#define COMMAND_BASE_H
#include <string>
#include "Commands/Command.h"
#include "Subsystems/ExampleSubsystem.h"
#include "OI.h"
/**
* The base for all commands. All atomic commands should subclass CommandBase.
* CommandBase stores creates and stores each control system. To access a
* subsystem elsewhere in your code in your code use CommandBase.examplesubsystem
*/
class CommandBase: public Command {
class CommandBase: public Command
{
public:
CommandBase(const char *name);
CommandBase(std::string name);
CommandBase();
static void init();
// Create a single static instance of all of your subsystems

View File

@@ -1,7 +1,7 @@
#include "$classname.h"
$classname::$classname() {
$classname::$classname()
{
// Add Commands here:
// e.g. AddSequential(new Command1());
// AddSequential(new Command2());

View File

@@ -1,16 +1,11 @@
#ifndef $classname_H
#define $classname_H
#include "Commands/CommandGroup.h"
/**
*
*
* @author ExampleAuthor
*/
class $classname: public CommandGroup {
public:
class $classname: public CommandGroup
{
public:
$classname();
};

View File

@@ -1,31 +1,38 @@
#include "ExampleCommand.h"
ExampleCommand::ExampleCommand() {
ExampleCommand::ExampleCommand()
{
// Use Requires() here to declare subsystem dependencies
// eg. Requires(chassis);
}
// Called just before this Command runs the first time
void ExampleCommand::Initialize() {
void ExampleCommand::Initialize()
{
}
// Called repeatedly when this Command is scheduled to run
void ExampleCommand::Execute() {
void ExampleCommand::Execute()
{
}
// Make this return true when this Command no longer needs to run execute()
bool ExampleCommand::IsFinished() {
bool ExampleCommand::IsFinished()
{
return false;
}
// Called once after isFinished returns true
void ExampleCommand::End() {
void ExampleCommand::End()
{
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void ExampleCommand::Interrupted() {
void ExampleCommand::Interrupted()
{
}

View File

@@ -3,19 +3,15 @@
#include "../CommandBase.h"
/**
*
*
* @author ExampleAuthor
*/
class ExampleCommand: public CommandBase {
class ExampleCommand: public CommandBase
{
public:
ExampleCommand();
virtual void Initialize();
virtual void Execute();
virtual bool IsFinished();
virtual void End();
virtual void Interrupted();
void Initialize();
void Execute();
bool IsFinished();
void End();
void Interrupted();
};
#endif

View File

@@ -1,16 +1,17 @@
#include "ExampleSubsystem.h"
#include "../Robotmap.h"
#include "../RobotMap.h"
ExampleSubsystem::ExampleSubsystem() :
Subsystem("ExampleSubsystem")
{
ExampleSubsystem::ExampleSubsystem() : Subsystem("ExampleSubsystem") {
}
void ExampleSubsystem::InitDefaultCommand() {
void ExampleSubsystem::InitDefaultCommand()
{
// Set the default command for a subsystem here.
//SetDefaultCommand(new MySpecialCommand());
}
// Put methods for controlling this subsystem
// here. Call these from Commands.

View File

@@ -1,14 +1,11 @@
#ifndef EXAMPLE_SUBSYSTEM_H
#define EXAMPLE_SUBSYSTEM_H
#include "Commands/Subsystem.h"
#include "WPILib.h"
/**
*
*
* @author ExampleAuthor
*/
class ExampleSubsystem: public Subsystem {
class ExampleSubsystem: public Subsystem
{
private:
// It's desirable that everything possible under private except
// for methods that implement subsystem capabilities

View File

@@ -1,5 +1,6 @@
#include "OI.h"
OI::OI() {
OI::OI()
{
// Process operator interface input here.
}

View File

@@ -3,7 +3,8 @@
#include "WPILib.h"
class OI {
class OI
{
private:
public:

View File

@@ -1,31 +1,35 @@
#include "$classname.h"
#include "../Robotmap.h"
#include "../RobotMap.h"
#include "SmartDashboard/SmartDashboard.h"
#include "LiveWindow/LiveWindow.h"
#@autogenerated_code("pid", "")
#parse("${exporter-path}PIDSubsystem-pid.cpp")
#end
$classname::$classname() : PIDSubsystem("$classname", 1.0, 0.0, 0.0) {
$classname::$classname() :
PIDSubsystem("$classname", 1.0, 0.0, 0.0)
{
// Use these to get going:
// SetSetpoint() - Sets where the PID controller should move the system
// to
// Enable() - Enables the PID controller.
}
double $classname::ReturnPIDInput() {
double $classname::ReturnPIDInput()
{
// Return your input value for the PID loop
// e.g. a sensor, like a potentiometer:
// yourPot->SetAverageVoltage() / kYourMaxVoltage;
}
void $classname::UsePIDOutput(double output) {
void $classname::UsePIDOutput(double output)
{
// Use output to drive your system, like a motor
// e.g. yourMotor->Set(output);
}
void $classname::InitDefaultCommand() {
void $classname::InitDefaultCommand()
{
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
}

View File

@@ -1,17 +1,12 @@
#ifndef $classname_H
#define $classname_H
#include "Commands/PIDSubsystem.h"
#include "WPILib.h"
/**
*
*
* @author ExampleAuthor
*/
class $classname: public PIDSubsystem {
public:
class $classname: public PIDSubsystem
{
public:
$classname();
double ReturnPIDInput();
void UsePIDOutput(double output);

View File

@@ -1,48 +1,47 @@
//============================================================================
// Name : Robot.cpp
// Author :
// Version :
// Copyright :
// Description : Hello World in C++, Ansi-style
//============================================================================
#include "WPILib.h"
#include "Commands/Command.h"
#include "Commands/ExampleCommand.h"
#include "CommandBase.h"
class Robot : public IterativeRobot {
class Robot: public IterativeRobot
{
private:
Command *autonomousCommand;
LiveWindow *lw;
virtual void RobotInit() {
void RobotInit()
{
CommandBase::init();
autonomousCommand = new ExampleCommand();
lw = LiveWindow::GetInstance();
}
virtual void AutonomousInit() {
void AutonomousInit()
{
autonomousCommand->Start();
}
virtual void AutonomousPeriodic() {
void AutonomousPeriodic()
{
Scheduler::GetInstance()->Run();
}
virtual void TeleopInit() {
void TeleopInit()
{
// This makes sure that the autonomous stops running when
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
autonomousCommand->Cancel();
}
virtual void TeleopPeriodic() {
void TeleopPeriodic()
{
Scheduler::GetInstance()->Run();
}
virtual void TestPeriodic() {
void TestPeriodic()
{
lw->Run();
}
};

View File

@@ -11,12 +11,12 @@
// For example to map the left and right motors, you could define the
// following variables to use with your drivetrain subsystem.
// #define LEFTMOTOR 1
// #define RIGHTMOTOR 2
//const int LEFTMOTOR = 1;
//const int RIGHTMOTOR = 2;
// If you are using multiple modules, make sure to define both the port
// number and the module. For example you with a rangefinder:
// #define RANGE_FINDER_PORT 1
// #define RANGE_FINDER_MODULE 1
//const int RANGE_FINDER_PORT = 1;
//const int RANGE_FINDER_MODULE = 1;
#endif

View File

@@ -1,15 +1,17 @@
#include "$classname.h"
#include "../Robotmap.h"
#include "../RobotMap.h"
$classname::$classname() :
Subsystem("ExampleSubsystem")
{
$classname::$classname() : Subsystem("ExampleSubsystem") {
}
void $classname::InitDefaultCommand() {
void $classname::InitDefaultCommand()
{
// Set the default command for a subsystem here.
//SetDefaultCommand(new MySpecialCommand());
}
// Put methods for controlling this subsystem
// here. Call these from Commands.

View File

@@ -1,14 +1,11 @@
#ifndef $classname_H
#define $classname_H
#include "Commands/Subsystem.h"
#include "WPILib.h"
/**
*
*
* @author ExampleAuthor
*/
class $classname: public Subsystem {
class $classname: public Subsystem
{
private:
// It's desirable that everything possible under private except
// for methods that implement subsystem capabilities

View File

@@ -1,13 +1,15 @@
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
/**
* New and improved C++
*/
public class $classname extends Trigger {
public boolean get() {
return false;
}
public class $classname extends Trigger
{
public:
bool get()
{
return false;
}
}

View File

@@ -1,13 +1,9 @@
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
/**
* New and improved C++
*/
public class $classname extends Trigger {
public boolean get() {
return false;
}
public class $classname extends Trigger
{
public:
bool get();
}

View File

@@ -1,29 +1,23 @@
//============================================================================
// Name : Robot.cpp
// Author :
// Version :
// Copyright :
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <networktables/NetworkTable.h>
#include <iostream>
using namespace std;
// This is a simple robot program
int main() {
int main()
{
NetworkTable::SetServerMode();
NetworkTable::SetTeam(190);
NetworkTable* table = NetworkTable::GetTable("SmartDashboard");
cout << "Started up" << endl;
long i = 0;
while (true) {
while (true)
{
cout << i << endl;
table->PutNumber("i", i);
i++;
table->PutNumber("i", i);
i++;
sleep(1);
sleep(1);
}
return 0;

View File

@@ -1,46 +1,37 @@
//============================================================================
// Name : Robot.cpp
// Author :
// Version :
// Copyright :
// Description : Hello World in C++, Ansi-style
//============================================================================
//============================================================================
// Name : Robot.cpp
// Author :
// Version :
// Copyright :
// Description : Hello World in C++, Ansi-style
//============================================================================
#include "WPILib.h"
class Robot : public IterativeRobot {
class Robot: public IterativeRobot
{
private:
LiveWindow *lw;
virtual void RobotInit() {
void RobotInit()
{
lw = LiveWindow::GetInstance();
}
virtual void AutonomousInit() {
void AutonomousInit()
{
}
virtual void AutonomousPeriodic() {
void AutonomousPeriodic()
{
}
virtual void TeleopInit() {
}
virtual void TeleopPeriodic() {
void TeleopInit()
{
}
virtual void TestPeriodic() {
void TeleopPeriodic()
{
}
void TestPeriodic()
{
lw->Run();
}
};

View File

@@ -1,11 +1,3 @@
//============================================================================
// Name : Robot.cpp
// Author :
// Version :
// Copyright :
// Description : Hello World in C++, Ansi-style
//============================================================================
#include "WPILib.h"
/**
@@ -13,16 +5,16 @@
* The SimpleRobot 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.
*/
class Robot : public SimpleRobot
*/
class Robot: public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
public:
Robot(void):
myRobot(1, 2), // these must be initialized in the same order
stick(1) // as they are declared above.
Robot() :
myRobot(1, 2), // these must be initialized in the same order
stick(1) // as they are declared above.
{
myRobot.SetExpiration(0.1);
}
@@ -30,7 +22,7 @@ public:
/**
* Drive left & right motors for 2 seconds then stop
*/
void Autonomous(void)
void Autonomous()
{
myRobot.SetSafetyEnabled(false);
myRobot.Drive(-0.5, 0.0); // drive forwards half speed
@@ -41,7 +33,7 @@ public:
/**
* Runs the motors with arcade steering.
*/
void OperatorControl(void)
void OperatorControl()
{
myRobot.SetSafetyEnabled(true);
while (IsOperatorControl())
@@ -50,11 +42,12 @@ public:
Wait(0.005); // wait for a motor update time
}
}
/**
* Runs during test mode
*/
void Test() {
void Test()
{
}
};

View File

@@ -52,15 +52,6 @@
</build>
<profiles>
<profile>
<id>jenkins</id>
<distributionManagement>
<repository>
<id>myrepository</id>
<url>file:${local-repository}</url>
</repository>
</distributionManagement>
</profile>
<!-- TODO: Sign the jars for verification. -->
<!-- Currently disabled since eclipse runs out of memory verifying the -->
<!-- signatures of the toolchains. -->

View File

@@ -16,7 +16,11 @@
#ifdef SIMULATION
#include <vxWorks_compat.h>
#ifdef USE_THRIFT
#define EXPORT_FUNC
#else
#define EXPORT_FUNC __declspec(dllexport) __cdecl
#endif
#else
#if defined(__vxworks)
#include <vxWorks.h>
@@ -145,12 +149,14 @@ struct FRCCommonControlData{
#define kFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24
#define kFRC_NetworkCommunication_DynamicType_Kinect_Custom 25
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SIMULATION
void EXPORT_FUNC getFPGAHardwareVersion(uint16_t *fpgaVersion, uint32_t *fpgaRevision);
#endif
int EXPORT_FUNC getCommonControlData(FRCCommonControlData *data, int wait_ms);
int EXPORT_FUNC getRecentCommonControlData(FRCCommonControlData *commonData, int wait_ms);
int EXPORT_FUNC getCommonControlData(struct FRCCommonControlData *data, int wait_ms);
int EXPORT_FUNC getRecentCommonControlData(struct FRCCommonControlData *commonData, int wait_ms);
int EXPORT_FUNC getRecentStatusData(uint8_t *batteryInt, uint8_t *batteryDec, uint8_t *dsDigitalOut, int wait_ms);
int EXPORT_FUNC getDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms);
int EXPORT_FUNC setStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
@@ -162,7 +168,7 @@ extern "C" {
int EXPORT_FUNC setErrorData(const char *errors, int errorsLength, int wait_ms);
int EXPORT_FUNC setUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms);
int EXPORT_FUNC overrideIOConfig(const char *ioConfig, int wait_ms);
#ifdef SIMULATION
void EXPORT_FUNC setNewDataSem(HANDLE);
#else
@@ -188,6 +194,8 @@ extern "C" {
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramAutonomous(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTeleop(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTest(void);
};
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -14,6 +14,25 @@
#include <stdint.h>
#include <pthread.h>
#endif
#ifdef USE_THRIFT
#include "NetCommRPCComm.h"
#include <vector>
#endif
namespace nJaguarCANDriver
{
void sendMessage_wrapper(uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t *status);
void receiveMessage_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, uint32_t timeoutMs, int32_t *status);
int32_t receiveMessageStart_wrapper(uint32_t messageID, uint32_t occurRefNum, uint32_t timeoutMs, int32_t *status);
#if defined (__vxworks)
int32_t receiveMessageStart_sem_wrapper(uint32_t messageID, uint32_t semaphoreID, uint32_t timeoutMs, int32_t *status);
#else
int32_t receiveMessageStart_mutex_wrapper(uint32_t messageID, pthread_mutex_t *mutex, uint32_t timeoutMs, int32_t *status);
#endif
void receiveMessageComplete_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, int32_t *status);
#ifdef USE_THRIFT
void checkEvent_CAN(std::vector< CANEvent >& events);
#endif
}
#ifdef __cplusplus
extern "C"

View File

@@ -8,10 +8,13 @@
#define __ChipObject_h__
#include <stdint.h>
#include "ChipObject/NiRio.h"
#include "ChipObject/RoboRIO_FRC_ChipObject_Aliases.h"
#include "ChipObject/FRC_FPGA_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"
@@ -25,11 +28,11 @@
#include "ChipObject/tEncoder.h"
#include "ChipObject/tGlobal.h"
#include "ChipObject/tInterrupt.h"
#include "ChipObject/tInterruptManager.h"
#include "ChipObject/tPower.h"
#include "ChipObject/tPWM.h"
#include "ChipObject/tRelay.h"
#include "ChipObject/tWatchdog.h"
#include "ChipObject/tSPI.h"
#include "ChipObject/tSysWatchdog.h"
using namespace nFPGA;
using namespace nRoboRIO_FPGANamespace;

View File

@@ -1,9 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
#ifndef __NiRio_h__
#define __NiRio_h__
#include "fpgainterfacecapi/NiFpga.h"
typedef NiFpga_Status tRioStatusCode;
#endif // __NiRio_h__

View File

@@ -4,6 +4,6 @@
#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
#define __RoboRIO_FRC_ChipObject_Aliases_h__
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_2
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_4
#endif // __RoboRIO_FRC_ChipObject_Aliases_h__

View File

@@ -1,15 +1,15 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_nInterfaceGlobals_h__
#define __nFRC_2015_1_0_2_nInterfaceGlobals_h__
#ifndef __nFRC_2015_1_0_4_nInterfaceGlobals_h__
#define __nFRC_2015_1_0_4_nInterfaceGlobals_h__
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
extern unsigned int g_currentTargetClass;
}
}
#endif // __nFRC_2015_1_0_2_nInterfaceGlobals_h__
#endif // __nFRC_2015_1_0_4_nInterfaceGlobals_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_AI_h__
#define __nFRC_2015_1_0_2_AI_h__
#ifndef __nFRC_2015_1_0_4_AI_h__
#define __nFRC_2015_1_0_4_AI_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tAI
@@ -140,4 +140,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_AI_h__
#endif // __nFRC_2015_1_0_4_AI_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_AO_h__
#define __nFRC_2015_1_0_2_AO_h__
#ifndef __nFRC_2015_1_0_4_AO_h__
#define __nFRC_2015_1_0_4_AO_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tAO
@@ -39,15 +39,6 @@ public:
virtual unsigned short readMXP(unsigned char reg_index, tRioStatusCode *status) = 0;
typedef enum
{
kNumValueRegisters = 2,
} tValue_IfaceConstants;
virtual void writeValue(unsigned char reg_index, unsigned short value, tRioStatusCode *status) = 0;
virtual unsigned short readValue(unsigned char reg_index, tRioStatusCode *status) = 0;
private:
tAO(const tAO&);
void operator=(const tAO&);
@@ -56,4 +47,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_AO_h__
#endif // __nFRC_2015_1_0_4_AO_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Accel_h__
#define __nFRC_2015_1_0_2_Accel_h__
#ifndef __nFRC_2015_1_0_4_Accel_h__
#define __nFRC_2015_1_0_4_Accel_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tAccel
@@ -59,4 +59,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Accel_h__
#endif // __nFRC_2015_1_0_4_Accel_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Accumulator_h__
#define __nFRC_2015_1_0_2_Accumulator_h__
#ifndef __nFRC_2015_1_0_4_Accumulator_h__
#define __nFRC_2015_1_0_4_Accumulator_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tAccumulator
@@ -84,4 +84,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Accumulator_h__
#endif // __nFRC_2015_1_0_4_Accumulator_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Alarm_h__
#define __nFRC_2015_1_0_2_Alarm_h__
#ifndef __nFRC_2015_1_0_4_Alarm_h__
#define __nFRC_2015_1_0_4_Alarm_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tAlarm
@@ -54,4 +54,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Alarm_h__
#endif // __nFRC_2015_1_0_4_Alarm_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_AnalogTrigger_h__
#define __nFRC_2015_1_0_2_AnalogTrigger_h__
#ifndef __nFRC_2015_1_0_4_AnalogTrigger_h__
#define __nFRC_2015_1_0_4_AnalogTrigger_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tAnalogTrigger
@@ -126,4 +126,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_AnalogTrigger_h__
#endif // __nFRC_2015_1_0_4_AnalogTrigger_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_BIST_h__
#define __nFRC_2015_1_0_2_BIST_h__
#ifndef __nFRC_2015_1_0_4_BIST_h__
#define __nFRC_2015_1_0_4_BIST_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tBIST
@@ -87,4 +87,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_BIST_h__
#endif // __nFRC_2015_1_0_4_BIST_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Counter_h__
#define __nFRC_2015_1_0_2_Counter_h__
#ifndef __nFRC_2015_1_0_4_Counter_h__
#define __nFRC_2015_1_0_4_Counter_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tCounter
@@ -216,4 +216,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Counter_h__
#endif // __nFRC_2015_1_0_4_Counter_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_DIO_h__
#define __nFRC_2015_1_0_2_DIO_h__
#ifndef __nFRC_2015_1_0_4_DIO_h__
#define __nFRC_2015_1_0_4_DIO_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tDIO
@@ -93,27 +93,6 @@ public:
unsigned value : 32;
};
} tDI;
typedef
union{
struct{
#ifdef __vxworks
unsigned PeriodPower : 6;
unsigned OutputSelect_0 : 5;
unsigned OutputSelect_1 : 5;
unsigned OutputSelect_2 : 5;
unsigned OutputSelect_3 : 5;
#else
unsigned OutputSelect_3 : 5;
unsigned OutputSelect_2 : 5;
unsigned OutputSelect_1 : 5;
unsigned OutputSelect_0 : 5;
unsigned PeriodPower : 6;
#endif
};
struct{
unsigned value : 26;
};
} tPWMConfig;
@@ -133,11 +112,20 @@ public:
typedef enum
{
kNumPWMDutyCycleElements = 4,
} tPWMDutyCycle_IfaceConstants;
kNumPWMDutyCycleAElements = 4,
} tPWMDutyCycleA_IfaceConstants;
virtual void writePWMDutyCycle(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readPWMDutyCycle(unsigned char bitfield_index, tRioStatusCode *status) = 0;
virtual void writePWMDutyCycleA(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readPWMDutyCycleA(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
{
kNumPWMDutyCycleBElements = 2,
} tPWMDutyCycleB_IfaceConstants;
virtual void writePWMDutyCycleB(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readPWMDutyCycleB(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
@@ -172,6 +160,15 @@ public:
virtual unsigned short readOutputEnable_MXP(tRioStatusCode *status) = 0;
typedef enum
{
kNumPWMOutputSelectElements = 6,
} tPWMOutputSelect_IfaceConstants;
virtual void writePWMOutputSelect(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readPWMOutputSelect(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
{
} tPulse_IfaceConstants;
@@ -232,20 +229,10 @@ public:
typedef enum
{
} tPWMConfig_IfaceConstants;
} tPWMPeriodPower_IfaceConstants;
virtual void writePWMConfig(tPWMConfig value, tRioStatusCode *status) = 0;
virtual void writePWMConfig_PeriodPower(unsigned char value, tRioStatusCode *status) = 0;
virtual void writePWMConfig_OutputSelect_0(unsigned char value, tRioStatusCode *status) = 0;
virtual void writePWMConfig_OutputSelect_1(unsigned char value, tRioStatusCode *status) = 0;
virtual void writePWMConfig_OutputSelect_2(unsigned char value, tRioStatusCode *status) = 0;
virtual void writePWMConfig_OutputSelect_3(unsigned char value, tRioStatusCode *status) = 0;
virtual tPWMConfig readPWMConfig(tRioStatusCode *status) = 0;
virtual unsigned char readPWMConfig_PeriodPower(tRioStatusCode *status) = 0;
virtual unsigned char readPWMConfig_OutputSelect_0(tRioStatusCode *status) = 0;
virtual unsigned char readPWMConfig_OutputSelect_1(tRioStatusCode *status) = 0;
virtual unsigned char readPWMConfig_OutputSelect_2(tRioStatusCode *status) = 0;
virtual unsigned char readPWMConfig_OutputSelect_3(tRioStatusCode *status) = 0;
virtual void writePWMPeriodPower(unsigned short value, tRioStatusCode *status) = 0;
virtual unsigned short readPWMPeriodPower(tRioStatusCode *status) = 0;
@@ -258,4 +245,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_DIO_h__
#endif // __nFRC_2015_1_0_4_DIO_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_DMA_h__
#define __nFRC_2015_1_0_2_DMA_h__
#ifndef __nFRC_2015_1_0_4_DMA_h__
#define __nFRC_2015_1_0_4_DMA_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tDMA
@@ -185,4 +185,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_DMA_h__
#endif // __nFRC_2015_1_0_4_DMA_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Encoder_h__
#define __nFRC_2015_1_0_2_Encoder_h__
#ifndef __nFRC_2015_1_0_4_Encoder_h__
#define __nFRC_2015_1_0_4_Encoder_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tEncoder
@@ -196,4 +196,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Encoder_h__
#endif // __nFRC_2015_1_0_4_Encoder_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Global_h__
#define __nFRC_2015_1_0_2_Global_h__
#ifndef __nFRC_2015_1_0_4_Global_h__
#define __nFRC_2015_1_0_4_Global_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tGlobal
@@ -101,4 +101,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Global_h__
#endif // __nFRC_2015_1_0_4_Global_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Interrupt_h__
#define __nFRC_2015_1_0_2_Interrupt_h__
#ifndef __nFRC_2015_1_0_4_Interrupt_h__
#define __nFRC_2015_1_0_4_Interrupt_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tInterrupt
@@ -90,4 +90,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Interrupt_h__
#endif // __nFRC_2015_1_0_4_Interrupt_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_PWM_h__
#define __nFRC_2015_1_0_2_PWM_h__
#ifndef __nFRC_2015_1_0_4_PWM_h__
#define __nFRC_2015_1_0_4_PWM_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tPWM
@@ -108,4 +108,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_PWM_h__
#endif // __nFRC_2015_1_0_4_PWM_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Power_h__
#define __nFRC_2015_1_0_2_Power_h__
#ifndef __nFRC_2015_1_0_4_Power_h__
#define __nFRC_2015_1_0_4_Power_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tPower
@@ -31,15 +31,15 @@ public:
#ifdef __vxworks
unsigned User3V3 : 8;
unsigned User5V : 8;
signed User6V : 16;
unsigned User6V : 8;
#else
signed User6V : 16;
unsigned User6V : 8;
unsigned User5V : 8;
unsigned User3V3 : 8;
#endif
};
struct{
unsigned value : 32;
unsigned value : 24;
};
} tStatus;
typedef
@@ -69,7 +69,7 @@ public:
virtual tStatus readStatus(tRioStatusCode *status) = 0;
virtual unsigned char readStatus_User3V3(tRioStatusCode *status) = 0;
virtual unsigned char readStatus_User5V(tRioStatusCode *status) = 0;
virtual signed short readStatus_User6V(tRioStatusCode *status) = 0;
virtual unsigned char readStatus_User6V(tRioStatusCode *status) = 0;
typedef enum
@@ -104,4 +104,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Power_h__
#endif // __nFRC_2015_1_0_4_Power_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Relay_h__
#define __nFRC_2015_1_0_2_Relay_h__
#ifndef __nFRC_2015_1_0_4_Relay_h__
#define __nFRC_2015_1_0_4_Relay_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tRelay
@@ -65,4 +65,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_Relay_h__
#endif // __nFRC_2015_1_0_4_Relay_h__

View File

@@ -0,0 +1,68 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_4_SPI_h__
#define __nFRC_2015_1_0_4_SPI_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_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 Hdr : 4;
unsigned MXP : 1;
#else
unsigned MXP : 1;
unsigned Hdr : 4;
#endif
};
struct{
unsigned value : 5;
};
} tChipSelectActiveHigh;
typedef enum
{
} tChipSelectActiveHigh_IfaceConstants;
virtual void writeChipSelectActiveHigh(tChipSelectActiveHigh value, tRioStatusCode *status) = 0;
virtual void writeChipSelectActiveHigh_Hdr(unsigned char value, tRioStatusCode *status) = 0;
virtual void writeChipSelectActiveHigh_MXP(unsigned char value, tRioStatusCode *status) = 0;
virtual tChipSelectActiveHigh readChipSelectActiveHigh(tRioStatusCode *status) = 0;
virtual unsigned char readChipSelectActiveHigh_Hdr(tRioStatusCode *status) = 0;
virtual unsigned char readChipSelectActiveHigh_MXP(tRioStatusCode *status) = 0;
private:
tSPI(const tSPI&);
void operator=(const tSPI&);
};
}
}
#endif // __nFRC_2015_1_0_4_SPI_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_SysWatchdog_h__
#define __nFRC_2015_1_0_2_SysWatchdog_h__
#ifndef __nFRC_2015_1_0_4_SysWatchdog_h__
#define __nFRC_2015_1_0_4_SysWatchdog_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
namespace nFRC_2015_1_0_4
{
class tSysWatchdog
@@ -25,9 +25,39 @@ public:
kNumSystems = 1,
} tIfaceConstants;
typedef
union{
struct{
#ifdef __vxworks
unsigned SystemActive : 1;
unsigned PowerAlive : 1;
unsigned SysDisableCount : 15;
unsigned PowerDisableCount : 15;
#else
unsigned PowerDisableCount : 15;
unsigned SysDisableCount : 15;
unsigned PowerAlive : 1;
unsigned SystemActive : 1;
#endif
};
struct{
unsigned value : 32;
};
} tStatus;
typedef enum
{
} tStatus_IfaceConstants;
virtual tStatus readStatus(tRioStatusCode *status) = 0;
virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0;
virtual bool readStatus_PowerAlive(tRioStatusCode *status) = 0;
virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0;
virtual unsigned short readStatus_PowerDisableCount(tRioStatusCode *status) = 0;
typedef enum
{
} tCommand_IfaceConstants;
@@ -68,4 +98,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_2_SysWatchdog_h__
#endif // __nFRC_2015_1_0_4_SysWatchdog_h__

View File

@@ -12,9 +12,9 @@ public:
tSystemInterface(){}
virtual ~tSystemInterface(){}
virtual const uint16_t getExpectedFPGAVersion()=0;
virtual const uint32_t getExpectedFPGARevision()=0;
virtual const uint32_t * const getExpectedFPGASignature()=0;
virtual uint16_t getExpectedFPGAVersion()=0;
virtual uint32_t getExpectedFPGARevision()=0;
virtual uint32_t * getExpectedFPGASignature()=0;
virtual void getHardwareFpgaSignature(uint32_t *guid_ptr, tRioStatusCode *status)=0;
virtual uint32_t getLVHandle(tRioStatusCode *status)=0;
virtual uint32_t getHandle()=0;

View File

@@ -1,108 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_2_Watchdog_h__
#define __nFRC_2015_1_0_2_Watchdog_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_2
{
class tWatchdog
{
public:
tWatchdog(){}
virtual ~tWatchdog(){}
virtual tSystemInterface* getSystemInterface() = 0;
static tWatchdog* create(tRioStatusCode *status);
typedef enum
{
kNumSystems = 1,
} tIfaceConstants;
typedef
union{
struct{
#ifdef __vxworks
unsigned SystemActive : 1;
unsigned Alive : 1;
unsigned SysDisableCount : 15;
unsigned DisableCount : 15;
#else
unsigned DisableCount : 15;
unsigned SysDisableCount : 15;
unsigned Alive : 1;
unsigned SystemActive : 1;
#endif
};
struct{
unsigned value : 32;
};
} tStatus;
typedef enum
{
} tStatus_IfaceConstants;
virtual tStatus readStatus(tRioStatusCode *status) = 0;
virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0;
virtual bool readStatus_Alive(tRioStatusCode *status) = 0;
virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0;
virtual unsigned short readStatus_DisableCount(tRioStatusCode *status) = 0;
typedef enum
{
} tKill_IfaceConstants;
virtual void strobeKill(tRioStatusCode *status) = 0;
typedef enum
{
} tFeed_IfaceConstants;
virtual void strobeFeed(tRioStatusCode *status) = 0;
typedef enum
{
} tTimer_IfaceConstants;
virtual unsigned int readTimer(tRioStatusCode *status) = 0;
typedef enum
{
} tExpiration_IfaceConstants;
virtual void writeExpiration(unsigned int value, tRioStatusCode *status) = 0;
virtual unsigned int readExpiration(tRioStatusCode *status) = 0;
typedef enum
{
} tImmortal_IfaceConstants;
virtual void writeImmortal(bool value, tRioStatusCode *status) = 0;
virtual bool readImmortal(tRioStatusCode *status) = 0;
private:
tWatchdog(const tWatchdog&);
void operator=(const tWatchdog&);
};
}
}
#endif // __nFRC_2015_1_0_2_Watchdog_h__

View File

@@ -78,7 +78,7 @@ void initializeDigital(int32_t *status) {
digitalI2CSemaphore = initializeMutexRecursive();
Resource::CreateResourceObject(&DIOChannels, tDIO::kNumSystems * kDigitalPins);
Resource::CreateResourceObject(&DO_PWMGenerators, tDIO::kNumPWMDutyCycleElements);
Resource::CreateResourceObject(&DO_PWMGenerators, tDIO::kNumPWMDutyCycleAElements + tDIO::kNumPWMDutyCycleBElements);
digitalSystem = tDIO::create(status);
// Relay Setup
@@ -273,7 +273,7 @@ void setPWMRateWithModule(uint8_t module, double rate, int32_t *status) {
// Currently rounding in the log rate domain... heavy weight toward picking a higher freq.
// TODO: Round in the linear rate domain.
uint8_t pwmPeriodPower = (uint8_t)(log(1.0 / (pwmSystem->readLoopTiming(status) * 0.25E-6 * rate))/log(2.0) + 0.5);
digitalSystem->writePWMConfig_PeriodPower(pwmPeriodPower, status);
digitalSystem->writePWMPeriodPower(pwmPeriodPower, status);
}
/**
@@ -301,12 +301,13 @@ void setPWMDutyCycleWithModule(uint8_t module, void* pwmGenerator, double dutyCy
if (rawDutyCycle > 255.5) rawDutyCycle = 255.5;
{
Synchronized sync(digitalPwmSemaphore);
uint8_t pwmPeriodPower = digitalSystem->readPWMConfig_PeriodPower(status);
uint8_t pwmPeriodPower = digitalSystem->readPWMPeriodPower(status);
if (pwmPeriodPower < 4) {
// The resolution of the duty cycle drops close to the highest frequencies.
rawDutyCycle = rawDutyCycle / pow(2.0, 4 - pwmPeriodPower);
}
digitalSystem->writePWMDutyCycle(id, (uint8_t)rawDutyCycle, status);
digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status);
digitalSystem->writePWMDutyCycleB(id, (uint8_t)rawDutyCycle, status);
}
}
@@ -331,16 +332,22 @@ void setPWMOutputChannelWithModule(uint8_t module, void* pwmGenerator, uint32_t
if (id == ~0ul) return;
switch(id) {
case 0:
digitalSystem->writePWMConfig_OutputSelect_0(remapDigitalChannel(pin - 1, status), status);
digitalSystem->writePWMOutputSelect(0, remapDigitalChannel(pin - 1, status), status);
break;
case 1:
digitalSystem->writePWMConfig_OutputSelect_1(remapDigitalChannel(pin - 1, status), status);
digitalSystem->writePWMOutputSelect(1, remapDigitalChannel(pin - 1, status), status);
break;
case 2:
digitalSystem->writePWMConfig_OutputSelect_2(remapDigitalChannel(pin - 1, status), status);
digitalSystem->writePWMOutputSelect(2, remapDigitalChannel(pin - 1, status), status);
break;
case 3:
digitalSystem->writePWMConfig_OutputSelect_3(remapDigitalChannel(pin - 1, status), status);
digitalSystem->writePWMOutputSelect(3, remapDigitalChannel(pin - 1, status), status);
break;
case 4:
digitalSystem->writePWMOutputSelect(4, remapDigitalChannel(pin - 1, status), status);
break;
case 5:
digitalSystem->writePWMOutputSelect(5, remapDigitalChannel(pin - 1, status), status);
break;
}
}

View File

@@ -6,6 +6,8 @@
#include "ChipObject.h"
#include "NetworkCommunication/FRCComm.h"
#include "NetworkCommunication/UsageReporting.h"
#include "NetworkCommunication/LoadOut.h"
#include "ChipObject/nInterfaceGlobals.h"
// XXX: What to do with solenoids? const uint32_t solenoid_kNumDO7_0Elements = tSolenoid::kNumDO7_0Elements;
const uint32_t dio_kNumSystems = tDIO::kNumSystems;
@@ -149,7 +151,7 @@ int HALSetStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
void HALNetworkCommunicationReserve()
{
FRC_NetworkCommunication_Reserve();
nFPGA::nRoboRIO_FPGANamespace::g_currentTargetClass = nLoadOut::kTargetClass_RoboRIO;
}
void HALNetworkCommunicationObserveUserProgramStarting(void)
@@ -179,7 +181,8 @@ void HALNetworkCommunicationObserveUserProgramTest(void)
uint32_t HALReport(uint8_t resource, uint8_t instanceNumber, uint8_t context, const char *feature)
{
return FRC_NetworkCommunication_nUsageReporting_report( resource, instanceNumber, context, feature);
//return FRC_NetworkCommunication_nUsageReporting_report( resource, instanceNumber, context, feature);
return 0;
}

View File

@@ -16,7 +16,11 @@
#ifdef SIMULATION
#include <vxWorks_compat.h>
#ifdef USE_THRIFT
#define EXPORT_FUNC
#else
#define EXPORT_FUNC __declspec(dllexport) __cdecl
#endif
#else
#if defined(__vxworks)
#include <vxWorks.h>
@@ -145,12 +149,14 @@ struct FRCCommonControlData{
#define kFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24
#define kFRC_NetworkCommunication_DynamicType_Kinect_Custom 25
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SIMULATION
void EXPORT_FUNC getFPGAHardwareVersion(uint16_t *fpgaVersion, uint32_t *fpgaRevision);
#endif
int EXPORT_FUNC getCommonControlData(FRCCommonControlData *data, int wait_ms);
int EXPORT_FUNC getRecentCommonControlData(FRCCommonControlData *commonData, int wait_ms);
int EXPORT_FUNC getCommonControlData(struct FRCCommonControlData *data, int wait_ms);
int EXPORT_FUNC getRecentCommonControlData(struct FRCCommonControlData *commonData, int wait_ms);
int EXPORT_FUNC getRecentStatusData(uint8_t *batteryInt, uint8_t *batteryDec, uint8_t *dsDigitalOut, int wait_ms);
int EXPORT_FUNC getDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms);
int EXPORT_FUNC setStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
@@ -162,7 +168,7 @@ extern "C" {
int EXPORT_FUNC setErrorData(const char *errors, int errorsLength, int wait_ms);
int EXPORT_FUNC setUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms);
int EXPORT_FUNC overrideIOConfig(const char *ioConfig, int wait_ms);
#ifdef SIMULATION
void EXPORT_FUNC setNewDataSem(HANDLE);
#else
@@ -188,8 +194,8 @@ extern "C" {
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramAutonomous(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTeleop(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTest(void);
void EXPORT_FUNC FRC_NetworkCommunication_Reserve();
};
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -14,6 +14,25 @@
#include <stdint.h>
#include <pthread.h>
#endif
#ifdef USE_THRIFT
#include "NetCommRPCComm.h"
#include <vector>
#endif
namespace nJaguarCANDriver
{
void sendMessage_wrapper(uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t *status);
void receiveMessage_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, uint32_t timeoutMs, int32_t *status);
int32_t receiveMessageStart_wrapper(uint32_t messageID, uint32_t occurRefNum, uint32_t timeoutMs, int32_t *status);
#if defined (__vxworks)
int32_t receiveMessageStart_sem_wrapper(uint32_t messageID, uint32_t semaphoreID, uint32_t timeoutMs, int32_t *status);
#else
int32_t receiveMessageStart_mutex_wrapper(uint32_t messageID, pthread_mutex_t *mutex, uint32_t timeoutMs, int32_t *status);
#endif
void receiveMessageComplete_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, int32_t *status);
#ifdef USE_THRIFT
void checkEvent_CAN(std::vector< CANEvent >& events);
#endif
}
#ifdef __cplusplus
extern "C"

View File

@@ -23,7 +23,7 @@ void delayMillis(double ms) {
void delaySeconds(double s) {
struct timespec test, remaining;
test.tv_sec = 0;
test.tv_nsec = s * 1000000000.0;
test.tv_sec = (int) s;
test.tv_nsec = (s - (int)s) * 1000000000.0;
nanosleep(&test, &remaining);
}

View File

@@ -1,140 +0,0 @@
#include "HAL/Watchdog.h"
#include "HAL/HAL.h"
#include "ChipObject.h"
typedef tWatchdog Watchdog;
const double kDefaultWatchdogExpiration = 0.5;
void* initializeWatchdog(int32_t *status) {
Watchdog* watchdog = tWatchdog::create(status);
setWatchdogExpiration(watchdog, kDefaultWatchdogExpiration, status);
setWatchdogEnabled(watchdog, true, status);
return watchdog;
}
void cleanWatchdog(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
setWatchdogEnabled(watchdog, false, status);
delete watchdog;
}
/**
* Throw the dog a bone.
*
* When everything is going well, you feed your dog when you get home.
* Let's hope you don't drive your car off a bridge on the way home...
* Your dog won't get fed and he will starve to death.
*
* By the way, it's not cool to ask the neighbor (some random task) to
* feed your dog for you. He's your responsibility!
*
* @returns Returns the previous state of the watchdog before feeding it.
*/
bool feedWatchdog(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
bool previous = getWatchdogEnabled(watchdog_pointer, status);
watchdog->strobeFeed(status);
return previous;
}
/**
* Put the watchdog out of its misery.
*
* Don't wait for your dying robot to starve when there is a problem.
* Kill it quickly, cleanly, and humanely.
*/
void killWatchdog(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
watchdog->strobeKill(status);
}
/**
* Read how long it has been since the watchdog was last fed.
*
* @return The number of seconds since last meal.
*/
double getWatchdogLastFed(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
uint32_t timer = watchdog->readTimer(status);
return timer / (kSystemClockTicksPerMicrosecond * 1e6);
}
/**
* Read what the current expiration is.
*
* @return The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often).
*/
double getWatchdogExpiration(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
uint32_t expiration = watchdog->readExpiration(status);
return expiration / (kSystemClockTicksPerMicrosecond * 1e6);
}
/**
* Configure how many seconds your watchdog can be neglected before it starves to death.
*
* @param expiration The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often).
*/
void setWatchdogExpiration(void* watchdog_pointer, double expiration, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
watchdog->writeExpiration((uint32_t)(expiration * (kSystemClockTicksPerMicrosecond * 1e6)), status);
}
/**
* Find out if the watchdog is currently enabled or disabled (mortal or immortal).
*
* @return Enabled or disabled.
*/
bool getWatchdogEnabled(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
bool enabled = !watchdog->readImmortal(status);
return enabled;
}
/**
* Enable or disable the watchdog timer.
*
* When enabled, you must keep feeding the watchdog timer to
* keep the watchdog active, and hence the dangerous parts
* (motor outputs, etc.) can keep functioning.
* When disabled, the watchdog is immortal and will remain active
* even without being fed. It will also ignore any kill commands
* while disabled.
*
* @param enabled Enable or disable the watchdog.
*/
void setWatchdogEnabled(void* watchdog_pointer, bool enabled, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
watchdog->writeImmortal(!enabled, status);
}
/**
* Check in on the watchdog and make sure he's still kicking.
*
* This indicates that your watchdog is allowing the system to operate.
* It is still possible that the network communications is not allowing the
* system to run, but you can check this to make sure it's not your fault.
* Check IsSystemActive() for overall system status.
*
* If the watchdog is disabled, then your watchdog is immortal.
*
* @return Is the watchdog still alive?
*/
bool isWatchdogAlive(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
bool alive = watchdog->readStatus_Alive(status);
return alive;
}
/**
* Check on the overall status of the system.
*
* @return Is the system active (i.e. PWM motor outputs, etc. enabled)?
*/
bool isWatchdogSystemActive(void* watchdog_pointer, int32_t *status) {
Watchdog* watchdog = (Watchdog*) watchdog_pointer;
bool alive = watchdog->readStatus_SystemActive(status);
return alive;
}

View File

@@ -0,0 +1,66 @@
/*!
\file environs.h
\brief Defines export symbols and namespace aliases
*/
/*
Copyright (c) 2014,
National Instruments Corporation.
All rights reserved.
File: $Id: //lvaddon/FIRST/FRC/trunk/2015/tools/frcrti/export/1.0/1.0.0a5/includes/wpilib/i2clib/i2clib/environs.h#1 $
Author: nipg.pl
Originated: Mon Feb 10 10:39:42 2014
*/
#ifndef ___i2clib_environs_h___
#define ___i2clib_environs_h___
#include <nibuild/platform.h>
/*
* kI2CLIBExportSymbols directs the build to export symbols modified by
* the kI2CLIBExport keyword. kI2CLIBNoExportSymbols directs the build to not
* import or export symbols modified by the kI2CLIBExport keyword. If
* neither of these are defined, the symbols modified by kI2CLIBExport are
* imported. These should be defined only when building the component,
* so clients do not need to trouble themselves with it.
*/
#if defined(kI2CLIBExportSymbols)
#define kI2CLIBExport kNIExport
#define kI2CLIBExportPre kNIExportPre
#define kI2CLIBExportPost kNIExportPost
#define kI2CLIBExportInline kNIExportInline
#define kI2CLIBExportData kNIExportData
#elif defined(kI2CLIBNoExportSymbols)
#define kI2CLIBExport
#define kI2CLIBExportPre
#define kI2CLIBExportPost
#define kI2CLIBExportInline
#define kI2CLIBExportData
#else
#define kI2CLIBExport kNIImport
#define kI2CLIBExportPre kNIImportPre
#define kI2CLIBExportPost kNIImportPost
#define kI2CLIBExportInline kNIImportInline
#define kI2CLIBExportData kNIImportData
#endif
// namespace declarations for aliasing ...
#ifdef __cplusplus
/*!
\namespace nI2CLIB_1_0
\brief i2c user-mode library Release 1.0
*/
namespace nI2CLIB_1_0
{
// current versioned namespace aliases used by this package
}
#endif // __cplusplus
#endif // ___i2clib_environs_h___

View File

@@ -1,94 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wpi.first.wpilib.hal</groupId>
<artifactId>libHALAthenaJava</artifactId>
<packaging>so</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.templates.athena</groupId>
<artifactId>shared-library</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.nativelibs4java</groupId>
<artifactId>jnaerator-runtime</artifactId>
<version>0.12-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilib.hal</groupId>
<artifactId>include</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>inczip</type>
</dependency>
<dependency>
<groupId>com.ni.first.libraries</groupId>
<artifactId>libFRC_NetworkCommunication</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>so</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype</id>
<name>Sonatype OSS Snapshots Repository</name>
<url>http://oss.sonatype.org/content/groups/public</url>
</repository>
<!-- For old snapshots, please use groupId `com.jnaerator` and the following repo -->
<repository>
<id>nativelibs4java-repo</id>
<url>http://nativelibs4java.sourceforge.net/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype</id>
<name>Sonatype OSS Snapshots Repository</name>
<url>http://oss.sonatype.org/content/groups/public</url>
</pluginRepository>
<!-- For old snapshots, please use groupId `com.jnaerator` and the following repo -->
<pluginRepository>
<id>nativelibs4java-repo</id>
<url>http://nativelibs4java.sourceforge.net/maven</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<sources>
<source>
<directory>../Athena/src/main/native</directory>
<includes>
<include>**/*.cpp</include>
</includes>
</source>
</sources>
</configuration>
</plugin>
<plugin>
<groupId>com.nativelibs4java</groupId>
<artifactId>maven-jnaerator-plugin</artifactId>
<version>0.12-SNAPSHOT</version>
<extensions>true</extensions>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,15 +0,0 @@
-dontCastConstants
-runtime JNAerator
-direct
// -reification
-M__java=true
-package edu.wpi.first.wpilibj.hal
// -entryClass HAL
-library HAL
-Itarget/native/include/
target/native/include/HAL/HAL.h
// include/HAL/Errors.h

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wpi.first.wpilib.hal</groupId>
<artifactId>libHALAthenaXX</artifactId>
<packaging>a</packaging>
<parent>
<groupId>edu.wpi.first.wpilib.templates.athena</groupId>
<artifactId>static-library</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../../maven-utilities/Athena/static-library/pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>edu.wpi.first.wpilib.hal</groupId>
<artifactId>include</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>inczip</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<sources>
<source>
<directory>src/main/native</directory>
<includes>
<include>**/*.cpp</include>
</includes>
</source>
</sources>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,696 +0,0 @@
#include "HAL/Analog.h"
#include "Port.h"
#include "HAL/Errors.h"
#include "HAL/Semaphore.h"
#include "ChipObject.h"
#include "HAL/cpp/Synchronized.h"
#include "HAL/cpp/Resource.h"
#include "NetworkCommunication/AICalibration.h"
#include "NetworkCommunication/LoadOut.h"
#include <stdio.h> // TODO: remove printf for debugging
static const long kTimebase = 40000000; ///< 40 MHz clock
static const long kDefaultOversampleBits = 0;
static const long kDefaultAverageBits = 7;
static const float kDefaultSampleRate = 50000.0;
static const uint32_t kAnalogPins = 8;
static const uint8_t kAccumulatorModuleNumber = 1;
static const uint32_t kAccumulatorNumChannels = 2;
static const uint32_t kAccumulatorChannels[] = {1, 2};
struct analog_port_t {
Port port;
tAI *module;
tAccumulator *accumulator;
};
typedef struct analog_port_t AnalogPort;
bool analogSampleRateSet[2] = {false, false};
MUTEX_ID analogRegisterWindowSemaphore = NULL;
tAI* analogModules[2] = {NULL, NULL};
uint32_t analogNumChannelsToActivate[2] = {0, 0};
// Utility methods defined below.
uint32_t getAnalogNumActiveChannels(uint8_t module, int32_t *status);
uint32_t getAnalogNumChannelsToActivate(uint8_t module, int32_t *status);
void setAnalogNumChannelsToActivate(uint8_t module, uint32_t channels);
bool analogModulesInitialized = false;
/**
* Initialize the analog modules.
*/
void initializeAnalog(int32_t *status) {
if (analogModulesInitialized) return;
// Needs to be global since the protected resource spans both module singletons.
analogRegisterWindowSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE);
for (unsigned int i = 0; i < (sizeof(analogModules)/sizeof(analogModules[0])); i++) {
analogModules[i] = tAI::create(i, status);
setAnalogNumChannelsToActivate(i + 1, kAnalogPins);
setAnalogSampleRateWithModule(i + 1, kDefaultSampleRate, status);
}
analogModulesInitialized = true;
}
/**
* Initialize the analog port using the given port object.
*/
void* initializeAnalogPort(void* port_pointer, int32_t *status) {
initializeAnalog(status);
Port* port = (Port*) port_pointer;
// Initialize port structure
AnalogPort* analog_port = new AnalogPort();
analog_port->port = *port;
analog_port->module = analogModules[analog_port->port.module-1];
if (isAccumulatorChannel(analog_port, status)) {
analog_port->accumulator = tAccumulator::create(port->pin - 1, status);
} else analog_port->accumulator = NULL;
// Set default configuration
analog_port->module->writeScanList(port->pin - 1, port->pin - 1, status);
setAnalogAverageBits(analog_port, kDefaultAverageBits, status);
setAnalogOversampleBits(analog_port, kDefaultOversampleBits, status);
return analog_port;
}
/**
* Check that the analog module number is valid.
*
* @return Analog module is valid and present
*/
bool checkAnalogModule(uint8_t module) {
if (nLoadOut::getModulePresence(nLoadOut::kModuleType_Analog, module - 1))
return true;
return false;
}
/**
* Check that the analog channel number is value.
* Verify that the analog channel number is one of the legal channel numbers. Channel numbers
* are 1-based.
*
* @return Analog channel is valid
*/
bool checkAnalogChannel(uint32_t pin) {
if (pin > 0 && pin <= kAnalogPins)
return true;
return false;
}
/**
* Set the sample rate on module 0.
*
* This is a global setting for the module and effects all channels.
*
* @param samplesPerSecond The number of samples per channel per second.
*/
void setAnalogSampleRate(double samplesPerSecond, int32_t *status) {
setAnalogSampleRateWithModule(1, samplesPerSecond, status);
}
/**
* Get the current sample rate on module 0.
*
* This assumes one entry in the scan list.
* This is a global setting for the module and effects all channels.
*
* @return Sample rate.
*/
float getAnalogSampleRate(int32_t *status) {
return getAnalogSampleRateWithModule(1, status);
}
/**
* 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) {
// TODO: This will change when variable size scan lists are implemented.
// TODO: Need float comparison with epsilon.
//wpi_assert(!sampleRateSet || GetSampleRate() == samplesPerSecond);
analogSampleRateSet[module-1] = true;
// Compute the convert rate
uint32_t ticksPerSample = (uint32_t)((float)kTimebase / samplesPerSecond);
uint32_t ticksPerConversion = ticksPerSample / getAnalogNumChannelsToActivate(module, status);
// ticksPerConversion must be at least 80
if (ticksPerConversion < 80) {
if ((*status) >= 0) *status = SAMPLE_RATE_TOO_HIGH;
ticksPerConversion = 80;
}
// Atomically set the scan size and the convert rate so that the sample rate is constant
tAI::tConfig config;
config.ScanSize = getAnalogNumChannelsToActivate(module, status);
config.ConvertRate = ticksPerConversion;
analogModules[module-1]->writeConfig(config, status);
// Indicate that the scan size has been commited to hardware.
setAnalogNumChannelsToActivate(module, 0);
}
/**
* 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) {
uint32_t ticksPerConversion = analogModules[module-1]->readLoopTiming(status);
uint32_t ticksPerSample = ticksPerConversion * getAnalogNumActiveChannels(module, status);
return (float)kTimebase / (float)ticksPerSample;
}
/**
* Set the number of averaging bits.
*
* This sets the number of averaging bits. The actual number of averaged samples is 2**bits.
* Use averaging to improve the stability of your measurement at the expense of sampling rate.
* The averaging is done automatically in the FPGA.
*
* @param analog_port_pointer Pointer to the analog port to configure.
* @param bits Number of bits to average.
*/
void setAnalogAverageBits(void* analog_port_pointer, uint32_t bits, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
port->module->writeAverageBits(port->port.pin - 1, bits, status);
}
/**
* Get the number of averaging bits.
*
* This gets the number of averaging bits from the FPGA. The actual number of averaged samples is 2**bits.
* The averaging is done automatically in the FPGA.
*
* @param analog_port_pointer Pointer to the analog port to use.
* @return Bits to average.
*/
uint32_t getAnalogAverageBits(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
uint32_t result = port->module->readAverageBits(port->port.pin - 1, status);
return result;
}
/**
* Set the number of oversample bits.
*
* This sets the number of oversample bits. The actual number of oversampled values is 2**bits.
* Use oversampling to improve the resolution of your measurements at the expense of sampling rate.
* The oversampling is done automatically in the FPGA.
*
* @param analog_port_pointer Pointer to the analog port to use.
* @param bits Number of bits to oversample.
*/
void setAnalogOversampleBits(void* analog_port_pointer, uint32_t bits, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
port->module->writeOversampleBits(port->port.pin - 1, bits, status);
}
/**
* Get the number of oversample bits.
*
* This gets the number of oversample bits from the FPGA. The actual number of oversampled values is
* 2**bits. The oversampling is done automatically in the FPGA.
*
* @param analog_port_pointer Pointer to the analog port to use.
* @return Bits to oversample.
*/
uint32_t getAnalogOversampleBits(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
uint32_t result = port->module->readOversampleBits(port->port.pin - 1, status);
return result;
}
/**
* 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 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.
* @return A sample straight from the channel on this module.
*/
int16_t getAnalogValue(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
int16_t value;
checkAnalogChannel(port->port.pin);
tAI::tReadSelect readSelect;
readSelect.Channel = port->port.pin - 1;
readSelect.Module = port->port.module - 1;
readSelect.Averaged = false;
{
Synchronized sync(analogRegisterWindowSemaphore);
port->module->writeReadSelect(readSelect, status);
port->module->strobeLatchOutput(status);
value = (int16_t) port->module->readOutput(status);
}
return value;
}
/**
* Get a sample from the output of the oversample and average engine for the channel.
*
* The sample is 12-bit + the value configured in SetOversampleBits().
* The value configured in SetAverageBits() will cause this value to be averaged 2**bits number of samples.
* This is not a sliding window. The sample will not change until 2**(OversamplBits + AverageBits) samples
* have been acquired from the module on this channel.
* Use GetAverageVoltage() to get the analog value in calibrated units.
*
* @param analog_port_pointer Pointer to the analog port to use.
* @return A sample from the oversample and average engine for the channel.
*/
int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
int16_t value;
checkAnalogChannel(port->port.pin);
tAI::tReadSelect readSelect;
readSelect.Channel = port->port.pin - 1;
readSelect.Module = port->port.module - 1;
readSelect.Averaged = true;
{
Synchronized sync(analogRegisterWindowSemaphore);
port->module->writeReadSelect(readSelect, status);
port->module->strobeLatchOutput(status);
value = (int16_t) port->module->readOutput(status);
}
return value;
}
/**
* Get a scaled sample straight from the channel on this module.
*
* The value is scaled to units of Volts using the calibrated scaling data from GetLSBWeight() and GetOffset().
*
* @param analog_port_pointer Pointer to the analog port to use.
* @return A scaled sample straight from the channel on this module.
*/
float getAnalogVoltage(void* analog_port_pointer, int32_t *status) {
int16_t value = getAnalogValue(analog_port_pointer, status);
uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status);
int32_t offset = getAnalogOffset(analog_port_pointer, status);
float voltage = LSBWeight * 1.0e-9 * value - offset * 1.0e-9;
return voltage;
}
/**
* Get a scaled sample from the output of the oversample and average engine for the channel.
*
* The value is scaled to units of Volts using the calibrated scaling data from GetLSBWeight() and GetOffset().
* Using oversampling will cause this value to be higher resolution, but it will update more slowly.
* Using averaging will cause this value to be more stable, but it will update more slowly.
*
* @param analog_port_pointer Pointer to the analog port to use.
* @return A scaled sample from the output of the oversample and average engine for the channel.
*/
float getAnalogAverageVoltage(void* analog_port_pointer, int32_t *status) {
int32_t value = getAnalogAverageValue(analog_port_pointer, status);
uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status);
int32_t offset = getAnalogOffset(analog_port_pointer, status);
uint32_t oversampleBits = getAnalogOversampleBits(analog_port_pointer, status);
float voltage = ((LSBWeight * 1.0e-9 * value) / (float)(1 << oversampleBits)) - offset * 1.0e-9;
return voltage;
}
/**
* Convert a voltage to a raw value for a specified channel.
*
* This process depends on the calibration of each channel, so the channel
* must be specified.
*
* @todo This assumes raw values. Oversampling not supported as is.
*
* @param analog_port_pointer Pointer to the analog port to use.
* @param voltage The voltage to convert.
* @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;
*status = VOLTAGE_OUT_OF_RANGE;
}
if (voltage < -10.0) {
voltage = -10.0;
*status = VOLTAGE_OUT_OF_RANGE;
}
uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status);
int32_t offset = getAnalogOffset(analog_port_pointer, status);
int32_t value = (int32_t) ((voltage + offset * 1.0e-9) / (LSBWeight * 1.0e-9));
return value;
}
/**
* Get the factory scaling least significant bit weight constant.
* The least significant bit weight constant for the channel that was calibrated in
* manufacturing and stored in an eeprom in the module.
*
* Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
*
* @param analog_port_pointer Pointer to the analog port to use.
* @return Least significant bit weight.
*/
uint32_t getAnalogLSBWeight(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
uint32_t lsbWeight = FRC_NetworkCommunication_nAICalibration_getLSBWeight(port->module->getSystemIndex(),
port->port.pin - 1, status);
return lsbWeight;
}
/**
* Get the factory scaling offset constant.
* The offset constant for the channel that was calibrated in manufacturing and stored
* in an eeprom in the module.
*
* Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
*
* @param analog_port_pointer Pointer to the analog port to use.
* @return Offset constant.
*/
int32_t getAnalogOffset(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
int32_t offset = FRC_NetworkCommunication_nAICalibration_getOffset(port->module->getSystemIndex(),
port->port.pin - 1, status);
return offset;
}
/**
* Return the number of channels on the module in use.
*
* @return Active channels.
*/
uint32_t getAnalogNumActiveChannels(uint8_t module, int32_t *status) {
uint32_t scanSize = analogModules[module-1]->readConfig_ScanSize(status);
if (scanSize == 0)
return 8;
return scanSize;
}
/**
* Get the number of active channels.
*
* This is an internal function to allow the atomic update of both the
* number of active channels and the sample rate.
*
* When the number of channels changes, use the new value. Otherwise,
* return the curent value.
*
* @return Value to write to the active channels field.
*/
uint32_t getAnalogNumChannelsToActivate(uint8_t module, int32_t *status) {
if(analogNumChannelsToActivate[module-1] == 0) return getAnalogNumActiveChannels(module, status);
return analogNumChannelsToActivate[module-1];
}
/**
* Set the number of active channels.
*
* Store the number of active channels to set. Don't actually commit to hardware
* until SetSampleRate().
*
* @param channels Number of active channels.
*/
void setAnalogNumChannelsToActivate(uint8_t module, uint32_t channels) {
analogNumChannelsToActivate[module-1] = channels;
}
//// Accumulator Stuff
/**
* Is the channel attached to an accumulator.
*
* @return The analog channel is attached to an accumulator.
*/
bool isAccumulatorChannel(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
if(port->port.module != kAccumulatorModuleNumber) return false;
for (uint32_t i=0; i < kAccumulatorNumChannels; i++) {
if (port->port.pin == kAccumulatorChannels[i]) return true;
}
return false;
}
/**
* Initialize the accumulator.
*/
void initAccumulator(void* analog_port_pointer, int32_t *status) {
setAccumulatorCenter(analog_port_pointer, 0, status);
resetAccumulator(analog_port_pointer, status);
}
/**
* Resets the accumulator to the initial value.
*/
void resetAccumulator(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
if (port->accumulator == NULL) {
*status = NULL_PARAMETER;
return;
}
port->accumulator->strobeReset(status);
}
/**
* Set the center value of the accumulator.
*
* The center value is subtracted from each A/D value before it is added to the accumulator. This
* is used for the center value of devices like gyros and accelerometers to make integration work
* and to take the device offset into account when integrating.
*
* This center value is based on the output of the oversampled and averaged source from channel 1.
* Because of this, any non-zero oversample bits will affect the size of the value for this field.
*/
void setAccumulatorCenter(void* analog_port_pointer, int32_t center, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
if (port->accumulator == NULL) {
*status = NULL_PARAMETER;
return;
}
port->accumulator->writeCenter(center, status);
}
/**
* Set the accumulator's deadband.
*/
void setAccumulatorDeadband(void* analog_port_pointer, int32_t deadband, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
if (port->accumulator == NULL) {
*status = NULL_PARAMETER;
return;
}
port->accumulator->writeDeadband(deadband, status);
}
/**
* Read the accumulated value.
*
* Read the value that has been accumulating on channel 1.
* The accumulator is attached after the oversample and average engine.
*
* @return The 64-bit value accumulated since the last Reset().
*/
int64_t getAccumulatorValue(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
if (port->accumulator == NULL) {
*status = NULL_PARAMETER;
return 0;
}
int64_t value = port->accumulator->readOutput_Value(status);
return value;
}
/**
* Read the number of accumulated values.
*
* Read the count of the accumulated values since the accumulator was last Reset().
*
* @return The number of times samples from the channel were accumulated.
*/
uint32_t getAccumulatorCount(void* analog_port_pointer, int32_t *status) {
AnalogPort* port = (AnalogPort*) analog_port_pointer;
if (port->accumulator == NULL) {
*status = NULL_PARAMETER;
return 0;
}
return port->accumulator->readOutput_Count(status);
}
/**
* Read the accumulated value and the number of accumulated values atomically.
*
* This function reads the value and count from the FPGA atomically.
* This can be used for averaging.
*
* @param value Pointer to the 64-bit accumulated output.
* @param count Pointer to the number of accumulation cycles.
*/
void getAccumulatorOutput(void* analog_port_pointer, int64_t *value, uint32_t *count, int32_t *status) {
// printf("[HAL] getAccumulatorOutput()\n");
AnalogPort* port = (AnalogPort*) analog_port_pointer;
if (port->accumulator == NULL) {
*status = NULL_PARAMETER;
return;
}
if (value == NULL || count == NULL) {
*status = NULL_PARAMETER;
return;
}
// printf("[HAL]\t Getting output...\n");
tAccumulator::tOutput output = port->accumulator->readOutput(status);
// printf("[HAL]\t Status: %d, Value: %lld, Count: %d.\n", *status, output.Value, output.Count);
// printf("[HAL]\t value: %d, value2: %d, value3: %d.\n", output.value, output.value2, output.value3);
// printf("[HAL]\t Value: %lld, Count: %d.\n", port->accumulator->readOutput_Value(status), port->accumulator->readOutput_Count(status));
*value = output.Value;
*count = output.Count;
}
struct trigger_t {
tAnalogTrigger* trigger;
AnalogPort* port;
uint32_t index;
};
typedef struct trigger_t AnalogTrigger;
static Resource *triggers = NULL;
void* initializeAnalogTrigger(void* port_pointer, uint32_t *index, int32_t *status) {
Port* port = (Port*) port_pointer;
Resource::CreateResourceObject(&triggers, tAnalogTrigger::kNumSystems);
AnalogTrigger* trigger = new AnalogTrigger();
trigger->port = (AnalogPort*) initializeAnalogPort(port, status);
trigger->index = triggers->Allocate("Analog Trigger");
*index = trigger->index;
// TODO: if (index == ~0ul) { CloneError(triggers); return; }
trigger->trigger = tAnalogTrigger::create(trigger->index, status);
trigger->trigger->writeSourceSelect_Channel(port->pin - 1, status);
trigger->trigger->writeSourceSelect_Module(port->module - 1, status);
return trigger;
}
void cleanAnalogTrigger(void* analog_trigger_pointer, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
triggers->Free(trigger->index);
delete trigger->trigger;
delete trigger;
}
void setAnalogTriggerLimitsRaw(void* analog_trigger_pointer, int32_t lower, int32_t upper, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
if (lower > upper) {
*status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR;
}
trigger->trigger->writeLowerLimit(lower, status);
trigger->trigger->writeUpperLimit(upper, status);
}
/**
* Set the upper and lower limits of the analog trigger.
* The limits are given as floating point voltage values.
*/
void setAnalogTriggerLimitsVoltage(void* analog_trigger_pointer, double lower, double upper, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
if (lower > upper) {
*status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR;
}
// TODO: This depends on the averaged setting. Only raw values will work as is.
trigger->trigger->writeLowerLimit(getAnalogVoltsToValue(trigger->port, lower, status), status);
trigger->trigger->writeUpperLimit(getAnalogVoltsToValue(trigger->port, upper, status), status);
}
/**
* Configure the analog trigger to use the averaged vs. raw values.
* If the value is true, then the averaged value is selected for the analog trigger, otherwise
* the immediate value is used.
*/
void setAnalogTriggerAveraged(void* analog_trigger_pointer, bool useAveragedValue, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
if (trigger->trigger->readSourceSelect_Filter(status) != 0) {
*status = INCOMPATIBLE_STATE;
// TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not support average and filtering at the same time.");
}
trigger->trigger->writeSourceSelect_Averaged(useAveragedValue, status);
}
/**
* Configure the analog trigger to use a filtered value.
* The analog trigger will operate with a 3 point average rejection filter. This is designed to
* help with 360 degree pot applications for the period where the pot crosses through zero.
*/
void setAnalogTriggerFiltered(void* analog_trigger_pointer, bool useFilteredValue, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
if (trigger->trigger->readSourceSelect_Averaged(status) != 0) {
*status = INCOMPATIBLE_STATE;
// TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not support average and filtering at the same time.");
}
trigger->trigger->writeSourceSelect_Filter(useFilteredValue, status);
}
/**
* Return the InWindow output of the analog trigger.
* True if the analog input is between the upper and lower limits.
* @return The InWindow output of the analog trigger.
*/
bool getAnalogTriggerInWindow(void* analog_trigger_pointer, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
return trigger->trigger->readOutput_InHysteresis(trigger->index, status) != 0;
}
/**
* Return the TriggerState output of the analog trigger.
* True if above upper limit.
* False if below lower limit.
* If in Hysteresis, maintain previous state.
* @return The TriggerState output of the analog trigger.
*/
bool getAnalogTriggerTriggerState(void* analog_trigger_pointer, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
return trigger->trigger->readOutput_OverLimit(trigger->index, status) != 0;
}
/**
* Get the state of the analog trigger output.
* @return The state of the analog trigger output.
*/
bool getAnalogTriggerOutput(void* analog_trigger_pointer, AnalogTriggerType type, int32_t *status) {
AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer;
bool result = false;
switch(type) {
case kInWindow:
result = trigger->trigger->readOutput_InHysteresis(trigger->index, status);
break; // XXX: Backport
case kState:
result = trigger->trigger->readOutput_OverLimit(trigger->index, status);
break; // XXX: Backport
case kRisingPulse:
case kFallingPulse:
*status = ANALOG_TRIGGER_PULSE_OUTPUT_ERROR;
return false;
}
return result;
}

View File

@@ -1,32 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
/*----------------------------------------------------------------------------*/
#ifndef __ChipObject_h__
#define __ChipObject_h__
#include <stdint.h>
#include "ChipObject/NiRio.h"
#include "ChipObject/tAccumulator.h"
#include "ChipObject/tAI.h"
#include "ChipObject/tAlarm.h"
#include "ChipObject/tAnalogTrigger.h"
#include "ChipObject/tCounter.h"
#include "ChipObject/tDIO.h"
#include "ChipObject/tDMA.h"
//#include "ChipObject/tDMAManager.h"
#include "ChipObject/tEncoder.h"
#include "ChipObject/tGlobal.h"
#include "ChipObject/tInterrupt.h"
#include "ChipObject/tInterruptManager.h"
#include "ChipObject/tSolenoid.h"
#include "ChipObject/tSPI.h"
#include "ChipObject/tWatchdog.h"
using namespace nFPGA;
using namespace nFRC_2012_1_6_4;
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
#ifndef __NiRio_h__
#define __NiRio_h__
#include "NiFpga.h"
typedef NiFpga_Status tRioStatusCode;
#endif // __NiRio_h__

View File

@@ -1,15 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2012_1_6_4_nInterfaceGlobals_h__
#define __nFRC_2012_1_6_4_nInterfaceGlobals_h__
namespace nFPGA
{
namespace nFRC_2012_1_6_4
{
extern unsigned int g_currentTargetClass;
}
}
#endif // __nFRC_2012_1_6_4_nInterfaceGlobals_h__

View File

@@ -1,149 +0,0 @@
// 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__

View File

@@ -1,87 +0,0 @@
// 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__

View File

@@ -1,57 +0,0 @@
// 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__

View File

@@ -1,133 +0,0 @@
// 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__

View File

@@ -1,219 +0,0 @@
// 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__

View File

@@ -1,330 +0,0 @@
// 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__

View File

@@ -1,188 +0,0 @@
// 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__

View File

@@ -1,46 +0,0 @@
// Class for handling DMA transters.
// Copyright (c) National Instruments 2008. All Rights Reserved.
#ifndef __tDMAManager_h__
#define __tDMAManager_h__
#include "tSystem.h"
namespace nFPGA
{
// TODO: Implement DMA Manager
/*
class tDMAManager : public tSystem
{
public:
tDMAManager(tNIRIO_u32 dmaChannel, tNIRIO_u32 hostBufferSize, tRioStatusCode *status);
~tDMAManager();
void start(tRioStatusCode *status);
void stop(tRioStatusCode *status);
bool isStarted() {return _started;}
void read(
tNIRIO_u32* buf,
tNIRIO_u32 num,
tNIRIO_u32 timeout,
tNIRIO_u32* read,
tNIRIO_u32* remaining,
tRioStatusCode *status);
void write(
tNIRIO_u32* buf,
tNIRIO_u32 num,
tNIRIO_u32 timeout,
tNIRIO_u32* remaining,
tRioStatusCode *status);
private:
bool _started;
tNIRIO_u32 _dmaChannel;
tNIRIO_u32 _hostBufferSize;
tDMAChannelDescriptor const *_dmaChannelDescriptor;
};
*/
}
#endif // __tDMAManager_h__

View File

@@ -1,199 +0,0 @@
// 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__

View File

@@ -1,70 +0,0 @@
// 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__

View File

@@ -1,93 +0,0 @@
// 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__

View File

@@ -1,61 +0,0 @@
// Class for handling interrupts.
// Copyright (c) National Instruments 2008. All Rights Reserved.
#ifndef __tInterruptManager_h__
#define __tInterruptManager_h__
#include "tSystem.h"
namespace ni
{
namespace dsc
{
namespace osdep
{
class CriticalSection;
}
}
}
namespace nFPGA
{
typedef void (*tInterruptHandler)(uint32_t interruptAssertedMask, void *param);
class tInterruptManager : public tSystem
{
public:
tInterruptManager(uint32_t interruptMask, bool watcher, tRioStatusCode *status);
~tInterruptManager();
void registerHandler(tInterruptHandler handler, void *param, tRioStatusCode *status);
uint32_t watch(int32_t timeoutInMs, tRioStatusCode *status);
void enable(tRioStatusCode *status);
void disable(tRioStatusCode *status);
bool isEnabled(tRioStatusCode *status);
private:
class tInterruptThread;
friend class tInterruptThread;
void handler();
static int handlerWrapper(tInterruptManager *pInterrupt);
void acknowledge(tRioStatusCode *status);
void reserve(tRioStatusCode *status);
void unreserve(tRioStatusCode *status);
tInterruptHandler _handler;
uint32_t _interruptMask;
tInterruptThread *_thread;
NiFpga_IrqContext _rioContext;
bool _watcher;
bool _enabled;
void *_userParam;
// maintain the interrupts that are already dealt with.
static uint32_t _globalInterruptMask;
static ni::dsc::osdep::CriticalSection *_globalInterruptMaskSemaphore;
};
}
#endif // __tInterruptManager_h__

View File

@@ -1,228 +0,0 @@
// 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__

View File

@@ -1,50 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2012_1_6_4_Solenoid_h__
#define __nFRC_2012_1_6_4_Solenoid_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2012_1_6_4
{
class tSolenoid
{
public:
tSolenoid(){}
virtual ~tSolenoid(){}
virtual tSystemInterface* getSystemInterface() = 0;
static tSolenoid* create(tRioStatusCode *status);
typedef enum
{
kNumSystems = 1,
} tIfaceConstants;
typedef enum
{
kNumDO7_0Elements = 2,
} tDO7_0_IfaceConstants;
virtual void writeDO7_0(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
virtual unsigned char readDO7_0(unsigned char bitfield_index, tRioStatusCode *status) = 0;
private:
tSolenoid(const tSolenoid&);
void operator=(const tSolenoid&);
};
}
}
#endif // __nFRC_2012_1_6_4_Solenoid_h__

View File

@@ -1,71 +0,0 @@
// 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__

View File

@@ -1,47 +0,0 @@
// Base class for generated chip objects
// Copyright (c) National Instruments 2008. All Rights Reserved.
#ifndef __tSystem_h__
#define __tSystem_h__
#include "NiFpga.h"
typedef NiFpga_Status tRioStatusCode;
#define FRC_FPGA_PRELOAD_BITFILE
typedef uint32_t NiFpga_Session;
namespace nFPGA
{
class tSystem
{
public:
tSystem(tRioStatusCode *status);
~tSystem();
void getFpgaGuid(uint32_t *guid_ptr, tRioStatusCode *status);
protected:
static NiFpga_Session _DeviceHandle;
#ifdef FRC_FPGA_PRELOAD_BITFILE
void NiFpga_SharedOpen_common(const char* bitfile);
NiFpga_Status NiFpga_SharedOpen(const char* bitfile,
const char* signature,
const char* resource,
uint32_t attribute,
NiFpga_Session* session);
NiFpga_Status NiFpgaLv_SharedOpen(const char* const bitfile,
const char* const apiSignature,
const char* const resource,
const uint32_t attribute,
NiFpga_Session* const session);
private:
static char *_FileName;
static char *_Bitfile;
#endif
};
}
#endif // __tSystem_h__

View File

@@ -1,26 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
#ifndef __tSystemInterface_h__
#define __tSystemInterface_h__
namespace nFPGA
{
class tSystemInterface
{
public:
tSystemInterface(){}
virtual ~tSystemInterface(){}
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;
};
}
#endif // __tSystemInterface_h__

View File

@@ -1,108 +0,0 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2012_1_6_4_Watchdog_h__
#define __nFRC_2012_1_6_4_Watchdog_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2012_1_6_4
{
class tWatchdog
{
public:
tWatchdog(){}
virtual ~tWatchdog(){}
virtual tSystemInterface* getSystemInterface() = 0;
static tWatchdog* create(tRioStatusCode *status);
typedef enum
{
kNumSystems = 1,
} tIfaceConstants;
typedef
union{
struct{
#ifdef __vxworks
unsigned SystemActive : 1;
unsigned Alive : 1;
unsigned SysDisableCount : 15;
unsigned DisableCount : 15;
#else
unsigned DisableCount : 15;
unsigned SysDisableCount : 15;
unsigned Alive : 1;
unsigned SystemActive : 1;
#endif
};
struct{
unsigned value : 32;
};
} tStatus;
typedef enum
{
} tStatus_IfaceConstants;
virtual tStatus readStatus(tRioStatusCode *status) = 0;
virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0;
virtual bool readStatus_Alive(tRioStatusCode *status) = 0;
virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0;
virtual unsigned short readStatus_DisableCount(tRioStatusCode *status) = 0;
typedef enum
{
} tKill_IfaceConstants;
virtual void strobeKill(tRioStatusCode *status) = 0;
typedef enum
{
} tFeed_IfaceConstants;
virtual void strobeFeed(tRioStatusCode *status) = 0;
typedef enum
{
} tTimer_IfaceConstants;
virtual unsigned int readTimer(tRioStatusCode *status) = 0;
typedef enum
{
} tExpiration_IfaceConstants;
virtual void writeExpiration(unsigned int value, tRioStatusCode *status) = 0;
virtual unsigned int readExpiration(tRioStatusCode *status) = 0;
typedef enum
{
} tImmortal_IfaceConstants;
virtual void writeImmortal(bool value, tRioStatusCode *status) = 0;
virtual bool readImmortal(tRioStatusCode *status) = 0;
private:
tWatchdog(const tWatchdog&);
void operator=(const tWatchdog&);
};
}
}
#endif // __nFRC_2012_1_6_4_Watchdog_h__

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +0,0 @@
#ifndef __AICalibration_h__
#define __AICalibration_h__
#include <stdint.h>
#ifdef __cplusplus
extern "C"
{
#endif
uint32_t FRC_NetworkCommunication_nAICalibration_getLSBWeight(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status);
int32_t FRC_NetworkCommunication_nAICalibration_getOffset(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status);
#ifdef __cplusplus
}
#endif
#endif // __AICalibration_h__

View File

@@ -1,193 +0,0 @@
/*************************************************************
* NOTICE
*
* These are the only externally exposed functions to the
* NetworkCommunication library
*
* This is an implementation of FRC Spec for Comm Protocol
* Revision 4.5, June 30, 2008
*
* Copyright (c) National Instruments 2008. All Rights Reserved.
*
*************************************************************/
#ifndef __FRC_COMM_H__
#define __FRC_COMM_H__
#ifdef SIMULATION
#include <vxWorks_compat.h>
#define EXPORT_FUNC __declspec(dllexport) __cdecl
#else
#if defined(__vxworks)
#include <vxWorks.h>
#define EXPORT_FUNC
#else
#include <stdint.h>
#include <pthread.h>
#define EXPORT_FUNC
#endif
#endif
// Commandeer some bytes at the end for advanced I/O feedback.
#define IO_CONFIG_DATA_SIZE 32
#define SYS_STATUS_DATA_SIZE 44
#define USER_STATUS_DATA_SIZE (984 - IO_CONFIG_DATA_SIZE - SYS_STATUS_DATA_SIZE)
#define USER_DS_LCD_DATA_SIZE 128
struct FRCCommonControlData{
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 {
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 {
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 {
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 {
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];
};
#define kFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Input 17
#define kFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Output 18
#define kFRC_NetworkCommunication_DynamicType_Kinect_Header 19
#define kFRC_NetworkCommunication_DynamicType_Kinect_Extra1 20
#define kFRC_NetworkCommunication_DynamicType_Kinect_Vertices1 21
#define kFRC_NetworkCommunication_DynamicType_Kinect_Extra2 22
#define kFRC_NetworkCommunication_DynamicType_Kinect_Vertices2 23
#define kFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24
#define kFRC_NetworkCommunication_DynamicType_Kinect_Custom 25
extern "C" {
#ifndef SIMULATION
void EXPORT_FUNC getFPGAHardwareVersion(uint16_t *fpgaVersion, uint32_t *fpgaRevision);
#endif
int EXPORT_FUNC getCommonControlData(FRCCommonControlData *data, int wait_ms);
int EXPORT_FUNC getRecentCommonControlData(FRCCommonControlData *commonData, int wait_ms);
int EXPORT_FUNC getRecentStatusData(uint8_t *batteryInt, uint8_t *batteryDec, uint8_t *dsDigitalOut, int wait_ms);
int EXPORT_FUNC getDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms);
int EXPORT_FUNC setStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
const char *userDataHigh, int userDataHighLength,
const char *userDataLow, int userDataLowLength, int wait_ms);
int EXPORT_FUNC setStatusDataFloatAsInt(int battery, uint8_t dsDigitalOut, uint8_t updateNumber,
const char *userDataHigh, int userDataHighLength,
const char *userDataLow, int userDataLowLength, int wait_ms);
int EXPORT_FUNC setErrorData(const char *errors, int errorsLength, int wait_ms);
int EXPORT_FUNC setUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms);
int EXPORT_FUNC overrideIOConfig(const char *ioConfig, int wait_ms);
#ifdef SIMULATION
void EXPORT_FUNC setNewDataSem(HANDLE);
#else
# if defined (__vxworks)
void EXPORT_FUNC setNewDataSem(SEM_ID);
void EXPORT_FUNC setResyncSem(SEM_ID);
# else
void EXPORT_FUNC setNewDataSem(pthread_mutex_t *);
void EXPORT_FUNC setResyncSem(pthread_mutex_t *);
# endif
void EXPORT_FUNC signalResyncActionDone(void);
#endif
// this uint32_t is really a LVRefNum
void EXPORT_FUNC setNewDataOccurRef(uint32_t refnum);
#ifndef SIMULATION
void EXPORT_FUNC setResyncOccurRef(uint32_t refnum);
#endif
void EXPORT_FUNC FRC_NetworkCommunication_getVersionString(char *version);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramStarting(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramDisabled(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramAutonomous(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTeleop(void);
void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTest(void);
};
#endif

View File

@@ -1,52 +0,0 @@
#ifndef __LoadOut_h__
#define __LoadOut_h__
#ifdef SIMULATION
#include <vxWorks_compat.h>
#define EXPORT_FUNC __declspec(dllexport) __cdecl
#elif defined (__vxworks)
#include <vxWorks.h>
#define EXPORT_FUNC
#else
#include <stdint.h>
#define EXPORT_FUNC
#endif
#define kMaxModuleNumber 2
namespace nLoadOut
{
typedef enum {
kModuleType_Unknown = 0x00,
kModuleType_Analog = 0x01,
kModuleType_Digital = 0x02,
kModuleType_Solenoid = 0x03,
} tModuleType;
bool EXPORT_FUNC getModulePresence(tModuleType moduleType, uint8_t moduleNumber);
typedef enum {
kTargetClass_Unknown = 0x00,
kTargetClass_FRC1 = 0x10,
kTargetClass_FRC2 = 0x20,
kTargetClass_FRC3 = 0x30,
kTargetClass_RoboRIO = 0x40,
kTargetClass_FRC2_Analog = kTargetClass_FRC2 | kModuleType_Analog,
kTargetClass_FRC2_Digital = kTargetClass_FRC2 | kModuleType_Digital,
kTargetClass_FRC2_Solenoid = kTargetClass_FRC2 | kModuleType_Solenoid,
kTargetClass_FamilyMask = 0xF0,
kTargetClass_ModuleMask = 0x0F,
} tTargetClass;
tTargetClass EXPORT_FUNC getTargetClass();
}
#ifdef __cplusplus
extern "C" {
#endif
uint32_t EXPORT_FUNC FRC_NetworkCommunication_nLoadOut_getModulePresence(uint32_t moduleType, uint8_t moduleNumber);
uint32_t EXPORT_FUNC FRC_NetworkCommunication_nLoadOut_getTargetClass();
#ifdef __cplusplus
}
#endif
#endif // __LoadOut_h__

View File

@@ -1,139 +0,0 @@
#ifndef __UsageReporting_h__
#define __UsageReporting_h__
#ifdef SIMULATION
#include <vxWorks_compat.h>
#define EXPORT_FUNC __declspec(dllexport) __cdecl
#elif defined (__vxworks)
#include <vxWorks.h>
#define EXPORT_FUNC
#else
#include <stdint.h>
#include <stdlib.h>
#define EXPORT_FUNC
#endif
#define kUsageReporting_version 1
namespace nUsageReporting
{
typedef enum
{
kResourceType_Controller,
kResourceType_Module,
kResourceType_Language,
kResourceType_CANPlugin,
kResourceType_Accelerometer,
kResourceType_ADXL345,
kResourceType_AnalogChannel,
kResourceType_AnalogTrigger,
kResourceType_AnalogTriggerOutput,
kResourceType_CANJaguar,
kResourceType_Compressor,
kResourceType_Counter,
kResourceType_Dashboard,
kResourceType_DigitalInput,
kResourceType_DigitalOutput,
kResourceType_DriverStationCIO,
kResourceType_DriverStationEIO,
kResourceType_DriverStationLCD,
kResourceType_Encoder,
kResourceType_GearTooth,
kResourceType_Gyro,
kResourceType_I2C,
kResourceType_Framework,
kResourceType_Jaguar,
kResourceType_Joystick,
kResourceType_Kinect,
kResourceType_KinectStick,
kResourceType_PIDController,
kResourceType_Preferences,
kResourceType_PWM,
kResourceType_Relay,
kResourceType_RobotDrive,
kResourceType_SerialPort,
kResourceType_Servo,
kResourceType_Solenoid,
kResourceType_SPI,
kResourceType_Task,
kResourceType_Ultrasonic,
kResourceType_Victor,
kResourceType_Button,
kResourceType_Command,
kResourceType_AxisCamera,
kResourceType_PCVideoServer,
kResourceType_SmartDashboard,
kResourceType_Talon,
kResourceType_HiTechnicColorSensor,
kResourceType_HiTechnicAccel,
kResourceType_HiTechnicCompass,
kResourceType_SRF08,
} tResourceType;
typedef enum
{
kLanguage_LabVIEW = 1,
kLanguage_CPlusPlus = 2,
kLanguage_Java = 3,
kLanguage_Python = 4,
kCANPlugin_BlackJagBridge = 1,
kCANPlugin_2CAN = 2,
kFramework_Iterative = 1,
kFramework_Simple = 2,
kRobotDrive_ArcadeStandard = 1,
kRobotDrive_ArcadeButtonSpin = 2,
kRobotDrive_ArcadeRatioCurve = 3,
kRobotDrive_Tank = 4,
kRobotDrive_MecanumPolar = 5,
kRobotDrive_MecanumCartesian = 6,
kDriverStationCIO_Analog = 1,
kDriverStationCIO_DigitalIn = 2,
kDriverStationCIO_DigitalOut = 3,
kDriverStationEIO_Acceleration = 1,
kDriverStationEIO_AnalogIn = 2,
kDriverStationEIO_AnalogOut = 3,
kDriverStationEIO_Button = 4,
kDriverStationEIO_LED = 5,
kDriverStationEIO_DigitalIn = 6,
kDriverStationEIO_DigitalOut = 7,
kDriverStationEIO_FixedDigitalOut = 8,
kDriverStationEIO_PWM = 9,
kDriverStationEIO_Encoder = 10,
kDriverStationEIO_TouchSlider = 11,
kADXL345_SPI = 1,
kADXL345_I2C = 2,
kCommand_Scheduler = 1,
kSmartDashboard_Instance = 1,
} tInstances;
/**
* Report the usage of a resource of interest.
*
* @param resource one of the values in the tResourceType above (max value 51).
* @param instanceNumber an index that identifies the resource instance.
* @param context an optional additional context number for some cases (such as module number). Set to 0 to omit.
* @param feature a string to be included describing features in use on a specific resource. Setting the same resource more than once allows you to change the feature string.
*/
uint32_t EXPORT_FUNC report(tResourceType resource, uint8_t instanceNumber, uint8_t context = 0, const char *feature = NULL);
}
#ifdef __cplusplus
extern "C" {
#endif
uint32_t EXPORT_FUNC FRC_NetworkCommunication_nUsageReporting_report(uint8_t resource, uint8_t instanceNumber, uint8_t context, const char *feature);
#ifdef __cplusplus
}
#endif
#endif // __UsageReporting_h__

View File

@@ -1,94 +0,0 @@
/*!
\file environs.h
\brief Defines export symbols and namespace aliases
*/
/*
Copyright (c) 2013,
National Instruments Corporation.
All rights reserved.
File: $Id: //lvaddon/FIRST/FRC/trunk/2015/tools/FRCNetworkCommunication/export/1.5/1.5.0a3/includes/FRC_NetworkCommunication/environs.h#1 $
Author: nipg.pl
Originated: Wed Aug 28 16:07:10 2013
*/
#ifndef ___FRC_NetworkCommunication_environs_h___
#define ___FRC_NetworkCommunication_environs_h___
#include <nibuild/platform.h>
/*
* kFRC_NETWORKCOMMUNICATIONExportSymbols directs the build to export symbols modified by
* the kFRC_NETWORKCOMMUNICATIONExport keyword. kFRC_NETWORKCOMMUNICATIONNoExportSymbols directs the build to not
* import or export symbols modified by the kFRC_NETWORKCOMMUNICATIONExport keyword. If
* neither of these are defined, the symbols modified by kFRC_NETWORKCOMMUNICATIONExport are
* imported. These should be defined only when building the component,
* so clients do not need to trouble themselves with it.
*/
#if defined(kFRC_NETWORKCOMMUNICATIONExportSymbols)
#define kFRC_NETWORKCOMMUNICATIONExport kNIExport
#define kFRC_NETWORKCOMMUNICATIONExportPre kNIExportPre
#define kFRC_NETWORKCOMMUNICATIONExportPost kNIExportPost
#define kFRC_NETWORKCOMMUNICATIONExportInline kNIExportInline
#define kFRC_NETWORKCOMMUNICATIONExportData kNIExportData
#elif defined(kFRC_NETWORKCOMMUNICATIONNoExportSymbols)
#define kFRC_NETWORKCOMMUNICATIONExport
#define kFRC_NETWORKCOMMUNICATIONExportPre
#define kFRC_NETWORKCOMMUNICATIONExportPost
#define kFRC_NETWORKCOMMUNICATIONExportInline
#define kFRC_NETWORKCOMMUNICATIONExportData
#else
#define kFRC_NETWORKCOMMUNICATIONExport kNIImport
#define kFRC_NETWORKCOMMUNICATIONExportPre kNIImportPre
#define kFRC_NETWORKCOMMUNICATIONExportPost kNIImportPost
#define kFRC_NETWORKCOMMUNICATIONExportInline kNIImportInline
#define kFRC_NETWORKCOMMUNICATIONExportData kNIImportData
#endif
// namespace declarations for aliasing ...
#ifdef __cplusplus
namespace nACE_STATIC_5_6 { }
namespace nCINTOOLS_1_2 { }
namespace nFRC_FPGA_CHIPOBJECT_1_2 { }
namespace nIAK_SHARED_13_0 { }
namespace nNIFPGA_13_0 { }
namespace nNI_EMB_6_0 { }
namespace nROBORIO_FRC_CHIPOBJECT_1_2 { }
/*!
\namespace nFRC_NETWORKCOMMUNICATION_1_5
\brief FRC Network Communication Release 1.5
*/
namespace nFRC_NETWORKCOMMUNICATION_1_5
{
// current versioned namespace aliases used by this package
// FRC_FPGA_ChipObject 1.2:
namespace nFRC_FPGA_CHIPOBJECT = nFRC_FPGA_CHIPOBJECT_1_2;
// RoboRIO_FRC_ChipObject 1.2:
namespace nROBORIO_FRC_CHIPOBJECT = nROBORIO_FRC_CHIPOBJECT_1_2;
// ace_static 5.6:
namespace nACE_STATIC = nACE_STATIC_5_6;
// cintools 1.2:
namespace nCINTOOLS = nCINTOOLS_1_2;
// iak_shared 13.0:
namespace nIAK_SHARED = nIAK_SHARED_13_0;
// ni_emb 6.0:
namespace nNI_EMB = nNI_EMB_6_0;
// nifpga 13.0:
namespace nNIFPGA = nNIFPGA_13_0;
}
#endif // __cplusplus
#endif // ___FRC_NetworkCommunication_environs_h___

View File

@@ -1,122 +0,0 @@
#include "HAL/HAL.h"
#include "Port.h"
#include "HAL/Errors.h"
#include "ChipObject.h"
const uint32_t solenoid_kNumDO7_0Elements = tSolenoid::kNumDO7_0Elements;
const uint32_t dio_kNumSystems = tDIO::kNumSystems;
const uint32_t interrupt_kNumSystems = tInterrupt::kNumSystems;
const uint32_t kSystemClockTicksPerMicrosecond = 40;
void* getPort(uint8_t pin) {
Port* port = new Port();
port->pin = pin;
port->module = 1;
return port;
}
/**
* @deprecated Uses module numbers
*/
void* getPortWithModule(uint8_t module, uint8_t pin) {
Port* port = new Port();
port->pin = pin;
port->module = module;
return port;
}
const char* getHALErrorMessage(int32_t code) {
if (code == 0) return "";
else if (code == SAMPLE_RATE_TOO_HIGH) return SAMPLE_RATE_TOO_HIGH_MESSAGE;
else if (code == VOLTAGE_OUT_OF_RANGE) return VOLTAGE_OUT_OF_RANGE_MESSAGE;
else if (code == LOOP_TIMING_ERROR) return LOOP_TIMING_ERROR_MESSAGE;
else if (code == SPI_WRITE_NO_MOSI) return SPI_WRITE_NO_MOSI_MESSAGE;
else if (code == SPI_READ_NO_MISO) return SPI_READ_NO_MISO_MESSAGE;
else if (code == SPI_READ_NO_DATA) return SPI_READ_NO_DATA_MESSAGE;
else if (code == INCOMPATIBLE_STATE) return INCOMPATIBLE_STATE_MESSAGE;
else if (code == NO_AVAILABLE_RESOURCES) return NO_AVAILABLE_RESOURCES_MESSAGE;
else if (code == NULL_PARAMETER) return NULL_PARAMETER_MESSAGE;
else if (code == ANALOG_TRIGGER_LIMIT_ORDER_ERROR) return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE;
else if (code == ANALOG_TRIGGER_PULSE_OUTPUT_ERROR) return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE;
else if (code == PARAMETER_OUT_OF_RANGE) return PARAMETER_OUT_OF_RANGE_MESSAGE;
else return "";
}
/**
* Return the FPGA Version number.
* For now, expect this to be competition year.
* @return FPGA Version number.
*/
uint16_t getFPGAVersion(int32_t *status) {
tGlobal *global = tGlobal::create(status);
uint16_t version = global->readVersion(status);
delete global;
return version;
}
/**
* Return the FPGA Revision number.
* The format of the revision is 3 numbers.
* The 12 most significant bits are the Major Revision.
* the next 8 bits are the Minor Revision.
* The 12 least significant bits are the Build Number.
* @return FPGA Revision number.
*/
uint32_t getFPGARevision(int32_t *status) {
tGlobal *global = tGlobal::create(status);
uint32_t revision = global->readRevision(status);
delete global;
return revision;
}
/**
* Read the microsecond-resolution timer on the FPGA.
*
* @return The current time in microseconds according to the FPGA (since FPGA reset).
*/
uint32_t getFPGATime(int32_t *status) {
tGlobal *global = tGlobal::create(status);
uint32_t time = global->readLocalTime(status);
delete global;
return time;
}
/**
* Set the state of the FPGA status LED on the cRIO.
*/
void setFPGALED(uint32_t state, int32_t *status) {
tGlobal *global = tGlobal::create(status);
global->writeFPGA_LED(state, status);
delete global;
}
/**
* Get the current state of the FPGA status LED on the cRIO.
* @return The curent state of the FPGA LED.
*/
int32_t getFPGALED(int32_t *status) {
tGlobal *global = tGlobal::create(status);
bool ledValue = global->readFPGA_LED(status);
delete global;
return ledValue;
}
// TODO: HACKS
void NumericArrayResize() {}
void RTSetCleanupProc() {}
void EDVR_CreateReference() {}
void Occur() {}
void imaqGetErrorText() {}
void imaqGetLastError() {}
void niTimestamp64() {}
#include "NetworkCommunication/LoadOut.h"
namespace nLoadOut {
bool getModulePresence(tModuleType moduleType, uint8_t moduleNumber) {
return true;
}
}

View File

@@ -1,86 +0,0 @@
#include "HAL/Interrupts.h"
#include "ChipObject.h"
struct interrupt_t {
tInterrupt *anInterrupt;
tInterruptManager *manager;
};
typedef struct interrupt_t Interrupt;
void* initializeInterrupts(uint32_t interruptIndex, bool watcher, int32_t *status) {
Interrupt* anInterrupt = new Interrupt();
// Expects the calling leaf class to allocate an interrupt index.
anInterrupt->anInterrupt = tInterrupt::create(interruptIndex, status);
anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status);
anInterrupt->manager = new tInterruptManager(1 << interruptIndex, watcher, status);
return anInterrupt;
}
void cleanInterrupts(void* interrupt_pointer, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
delete anInterrupt->anInterrupt;
delete anInterrupt->manager;
anInterrupt->anInterrupt = NULL;
anInterrupt->manager = NULL;
}
/**
* In synchronous mode, wait for the defined interrupt to occur.
* @param timeout Timeout in seconds
*/
void waitForInterrupt(void* interrupt_pointer, double timeout, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
anInterrupt->manager->watch((int32_t)(timeout * 1e3), status);
}
/**
* Enable interrupts to occur on this input.
* oInterrupts are disabled when the RequestInterrupt call is made. This gives time to do the
* setup of the other options before starting to field interrupts.
*/
void enableInterrupts(void* interrupt_pointer, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
anInterrupt->manager->enable(status);
}
/**
* Disable Interrupts without without deallocating structures.
*/
void disableInterrupts(void* interrupt_pointer, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
anInterrupt->manager->disable(status);
}
/**
* Return the timestamp for the interrupt that occurred most recently.
* This is in the same time domain as GetClock().
* @return Timestamp in seconds since boot.
*/
double readInterruptTimestamp(void* interrupt_pointer, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
uint32_t timestamp = anInterrupt->anInterrupt->readTimeStamp(status);
return timestamp * 1e-6;
}
void requestInterrupts(void* interrupt_pointer, uint8_t routing_module, uint32_t routing_pin,
bool routing_analog_trigger, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status);
anInterrupt->anInterrupt->writeConfig_Source_AnalogTrigger(routing_analog_trigger, status);
anInterrupt->anInterrupt->writeConfig_Source_Channel(routing_pin, status);
anInterrupt->anInterrupt->writeConfig_Source_Module(routing_module, status);
}
void attachInterruptHandler(void* interrupt_pointer, InterruptHandlerFunction handler,
void* param, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
anInterrupt->manager->registerHandler(handler, param, status);
}
void setInterruptUpSourceEdge(void* interrupt_pointer, bool risingEdge, bool fallingEdge, int32_t *status) {
Interrupt* anInterrupt = (Interrupt*) interrupt_pointer;
anInterrupt->anInterrupt->writeConfig_RisingEdge(risingEdge, status);
anInterrupt->anInterrupt->writeConfig_FallingEdge(fallingEdge, status);
}

View File

@@ -1,19 +0,0 @@
#ifndef __AICalibration_h__
#define __AICalibration_h__
#include <stdint.h>
#ifdef __cplusplus
extern "C"
{
#endif
uint32_t FRC_NetworkCommunication_nAICalibration_getLSBWeight(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status);
int32_t FRC_NetworkCommunication_nAICalibration_getOffset(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status);
#ifdef __cplusplus
}
#endif
#endif // __AICalibration_h__

View File

@@ -1,39 +0,0 @@
#ifndef __LoadOut_h__
#define __LoadOut_h__
#define kMaxModuleNumber 2
namespace nLoadOut
{
typedef enum {
kModuleType_Unknown = 0x00,
kModuleType_Analog = 0x01,
kModuleType_Digital = 0x02,
kModuleType_Solenoid = 0x03,
} tModuleType;
bool getModulePresence(tModuleType moduleType, uint8_t moduleNumber);
typedef enum {
kTargetClass_Unknown = 0x00,
kTargetClass_FRC1 = 0x10,
kTargetClass_FRC2 = 0x20,
kTargetClass_FRC2_Analog = kTargetClass_FRC2 | kModuleType_Analog,
kTargetClass_FRC2_Digital = kTargetClass_FRC2 | kModuleType_Digital,
kTargetClass_FRC2_Solenoid = kTargetClass_FRC2 | kModuleType_Solenoid,
kTargetClass_FamilyMask = 0xF0,
kTargetClass_ModuleMask = 0x0F,
} tTargetClass;
tTargetClass getTargetClass();
}
#ifdef __cplusplus
extern "C" {
#endif
uint32_t FRC_NetworkCommunication_nLoadOut_getModulePresence(uint32_t moduleType, uint8_t moduleNumber);
uint32_t FRC_NetworkCommunication_nLoadOut_getTargetClass();
#ifdef __cplusplus
}
#endif
#endif // __LoadOut_h__

View File

@@ -1,40 +0,0 @@
#include "HAL/Notifier.h"
#include "ChipObject.h"
static const uint32_t kTimerInterruptNumber = 28;
struct notifier_t {
tAlarm *alarm;
tInterruptManager *manager;
};
typedef struct notifier_t Notifier;
void* initializeNotifier(void (*ProcessQueue)(uint32_t, void*), int32_t *status) {
Notifier* notifier = new Notifier();
notifier->manager = new tInterruptManager(1 << kTimerInterruptNumber, false, status);
notifier->manager->registerHandler(ProcessQueue, NULL, status);
notifier->manager->enable(status);
notifier->alarm = tAlarm::create(status);
return notifier;
}
void cleanNotifier(void* notifier_pointer, int32_t *status) {
Notifier* notifier = (Notifier*) notifier_pointer;
notifier->alarm->writeEnable(false, status);
delete notifier->alarm;
notifier->alarm = NULL;
notifier->manager->disable(status);
delete notifier->manager;
notifier->manager = NULL;
}
void updateNotifierAlarm(void* notifier_pointer, uint32_t triggerTime, int32_t *status) {
Notifier* notifier = (Notifier*) notifier_pointer;
// write the first item in the queue into the trigger time
notifier->alarm->writeTriggerTime(triggerTime, status);
// Enable the alarm. The hardware disables itself after each alarm.
notifier->alarm->writeEnable(true, status);
}

View File

@@ -1,11 +0,0 @@
#ifndef HAL_PORT_H
#define HAL_PORT_H
struct port_t {
uint8_t pin;
uint8_t module;
};
typedef struct port_t Port;
#endif

Some files were not shown because too many files have changed in this diff Show More