Update to 2018_v4 image and new build system. (#598)

* Revert "Force OpenCV to 3.1.0 (#602)"

This reverts commit 50ed55e8e2.

* Removes Simulation

* Removes old build system

* Removes old gtest

* Adds new gmock and gtest

* Updates to new ni-libraries

* removes MyRobot (to be replaced)

* moves files to new location

* Adds new sim backend and new test executables

* updates .styleguide and .gitignore

* Changes cpp WPILibVersion to a function

MSVC throws an AV with the old version.

* Disables USBCamera on all systems except for linux

* 2018 NI Libraries

* New build system
This commit is contained in:
Thad House
2017-08-18 21:35:53 -07:00
committed by Peter Johnson
parent 50ed55e8e2
commit e1195e8b9d
1024 changed files with 64481 additions and 61340 deletions

View File

@@ -0,0 +1,60 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetAccelerometerData(int32_t index);
int32_t HALSIM_RegisterAccelerometerActiveCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAccelerometerActiveCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetAccelerometerActive(int32_t index);
void HALSIM_SetAccelerometerActive(int32_t index, HAL_Bool active);
int32_t HALSIM_RegisterAccelerometerRangeCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAccelerometerRangeCallback(int32_t index, int32_t uid);
HAL_AccelerometerRange HALSIM_GetAccelerometerRange(int32_t index);
void HALSIM_SetAccelerometerRange(int32_t index, HAL_AccelerometerRange range);
int32_t HALSIM_RegisterAccelerometerXCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAccelerometerXCallback(int32_t index, int32_t uid);
double HALSIM_GetAccelerometerX(int32_t index);
void HALSIM_SetAccelerometerX(int32_t index, double x);
int32_t HALSIM_RegisterAccelerometerYCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAccelerometerYCallback(int32_t index, int32_t uid);
double HALSIM_GetAccelerometerY(int32_t index);
void HALSIM_SetAccelerometerY(int32_t index, double y);
int32_t HALSIM_RegisterAccelerometerZCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAccelerometerZCallback(int32_t index, int32_t uid);
double HALSIM_GetAccelerometerZ(int32_t index);
void HALSIM_SetAccelerometerZ(int32_t index, double z);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,43 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetAnalogGyroData(int32_t index);
int32_t HALSIM_RegisterAnalogGyroAngleCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogGyroAngleCallback(int32_t index, int32_t uid);
double HALSIM_GetAnalogGyroAngle(int32_t index);
void HALSIM_SetAnalogGyroAngle(int32_t index, double angle);
int32_t HALSIM_RegisterAnalogGyroRateCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogGyroRateCallback(int32_t index, int32_t uid);
double HALSIM_GetAnalogGyroRate(int32_t index);
void HALSIM_SetAnalogGyroRate(int32_t index, double rate);
int32_t HALSIM_RegisterAnalogGyroInitializedCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogGyroInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetAnalogGyroInitialized(int32_t index);
void HALSIM_SetAnalogGyroInitialized(int32_t index, HAL_Bool initialized);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,93 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetAnalogInData(int32_t index);
int32_t HALSIM_RegisterAnalogInInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetAnalogInInitialized(int32_t index);
void HALSIM_SetAnalogInInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterAnalogInAverageBitsCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInAverageBitsCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetAnalogInAverageBits(int32_t index);
void HALSIM_SetAnalogInAverageBits(int32_t index, int32_t averageBits);
int32_t HALSIM_RegisterAnalogInOversampleBitsCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInOversampleBitsCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetAnalogInOversampleBits(int32_t index);
void HALSIM_SetAnalogInOversampleBits(int32_t index, int32_t oversampleBits);
int32_t HALSIM_RegisterAnalogInVoltageCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInVoltageCallback(int32_t index, int32_t uid);
double HALSIM_GetAnalogInVoltage(int32_t index);
void HALSIM_SetAnalogInVoltage(int32_t index, double voltage);
int32_t HALSIM_RegisterAnalogInAccumulatorInitializedCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInAccumulatorInitializedCallback(int32_t index,
int32_t uid);
HAL_Bool HALSIM_GetAnalogInAccumulatorInitialized(int32_t index);
void HALSIM_SetAnalogInAccumulatorInitialized(int32_t index,
HAL_Bool accumulatorInitialized);
int32_t HALSIM_RegisterAnalogInAccumulatorValueCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInAccumulatorValueCallback(int32_t index, int32_t uid);
int64_t HALSIM_GetAnalogInAccumulatorValue(int32_t index);
void HALSIM_SetAnalogInAccumulatorValue(int32_t index,
int64_t accumulatorValue);
int32_t HALSIM_RegisterAnalogInAccumulatorCountCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInAccumulatorCountCallback(int32_t index, int32_t uid);
int64_t HALSIM_GetAnalogInAccumulatorCount(int32_t index);
void HALSIM_SetAnalogInAccumulatorCount(int32_t index,
int64_t accumulatorCount);
int32_t HALSIM_RegisterAnalogInAccumulatorCenterCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInAccumulatorCenterCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetAnalogInAccumulatorCenter(int32_t index);
void HALSIM_SetAnalogInAccumulatorCenter(int32_t index,
int32_t accumulatorCenter);
int32_t HALSIM_RegisterAnalogInAccumulatorDeadbandCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogInAccumulatorDeadbandCallback(int32_t index,
int32_t uid);
int32_t HALSIM_GetAnalogInAccumulatorDeadband(int32_t index);
void HALSIM_SetAnalogInAccumulatorDeadband(int32_t index,
int32_t accumulatorDeadband);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,36 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetAnalogOutData(int32_t index);
int32_t HALSIM_RegisterAnalogOutVoltageCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogOutVoltageCallback(int32_t index, int32_t uid);
double HALSIM_GetAnalogOutVoltage(int32_t index);
void HALSIM_SetAnalogOutVoltage(int32_t index, double voltage);
int32_t HALSIM_RegisterAnalogOutInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogOutInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetAnalogOutInitialized(int32_t index);
void HALSIM_SetAnalogOutInitialized(int32_t index, HAL_Bool initialized);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,59 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
enum HALSIM_AnalogTriggerMode : int32_t {
HALSIM_AnalogTriggerUnassigned,
HALSIM_AnalogTriggerFiltered,
HALSIM_AnalogTriggerAveraged
};
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetAnalogTriggerData(int32_t index);
int32_t HALSIM_RegisterAnalogTriggerInitializedCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogTriggerInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetAnalogTriggerInitialized(int32_t index);
void HALSIM_SetAnalogTriggerInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterAnalogTriggerTriggerLowerBoundCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogTriggerTriggerLowerBoundCallback(int32_t index,
int32_t uid);
double HALSIM_GetAnalogTriggerTriggerLowerBound(int32_t index);
void HALSIM_SetAnalogTriggerTriggerLowerBound(int32_t index,
double triggerLowerBound);
int32_t HALSIM_RegisterAnalogTriggerTriggerUpperBoundCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogTriggerTriggerUpperBoundCallback(int32_t index,
int32_t uid);
double HALSIM_GetAnalogTriggerTriggerUpperBound(int32_t index);
void HALSIM_SetAnalogTriggerTriggerUpperBound(int32_t index,
double triggerUpperBound);
int32_t HALSIM_RegisterAnalogTriggerTriggerModeCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelAnalogTriggerTriggerModeCallback(int32_t index, int32_t uid);
HALSIM_AnalogTriggerMode HALSIM_GetAnalogTriggerTriggerMode(int32_t index);
void HALSIM_SetAnalogTriggerTriggerMode(int32_t index,
HALSIM_AnalogTriggerMode triggerMode);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,58 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetDIOData(int32_t index);
int32_t HALSIM_RegisterDIOInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDIOInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetDIOInitialized(int32_t index);
void HALSIM_SetDIOInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterDIOValueCallback(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
void HALSIM_CancelDIOValueCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetDIOValue(int32_t index);
void HALSIM_SetDIOValue(int32_t index, HAL_Bool value);
int32_t HALSIM_RegisterDIOPulseLengthCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDIOPulseLengthCallback(int32_t index, int32_t uid);
double HALSIM_GetDIOPulseLength(int32_t index);
void HALSIM_SetDIOPulseLength(int32_t index, double pulseLength);
int32_t HALSIM_RegisterDIOIsInputCallback(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
void HALSIM_CancelDIOIsInputCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetDIOIsInput(int32_t index);
void HALSIM_SetDIOIsInput(int32_t index, HAL_Bool isInput);
int32_t HALSIM_RegisterDIOFilterIndexCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDIOFilterIndexCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetDIOFilterIndex(int32_t index);
void HALSIM_SetDIOFilterIndex(int32_t index, int32_t filterIndex);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,43 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetDigitalPWMData(int32_t index);
int32_t HALSIM_RegisterDigitalPWMInitializedCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDigitalPWMInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetDigitalPWMInitialized(int32_t index);
void HALSIM_SetDigitalPWMInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterDigitalPWMDutyCycleCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDigitalPWMDutyCycleCallback(int32_t index, int32_t uid);
double HALSIM_GetDigitalPWMDutyCycle(int32_t index);
void HALSIM_SetDigitalPWMDutyCycle(int32_t index, double dutyCycle);
int32_t HALSIM_RegisterDigitalPWMPinCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDigitalPWMPinCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetDigitalPWMPin(int32_t index);
void HALSIM_SetDigitalPWMPin(int32_t index, int32_t pin);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,74 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetDriverStationData(void);
int32_t HALSIM_RegisterDriverStationEnabledCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDriverStationEnabledCallback(int32_t uid);
HAL_Bool HALSIM_GetDriverStationEnabled();
void HALSIM_SetDriverStationEnabled(HAL_Bool enabled);
int32_t HALSIM_RegisterDriverStationAutonomousCallback(
HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
void HALSIM_CancelDriverStationAutonomousCallback(int32_t uid);
HAL_Bool HALSIM_GetDriverStationAutonomous();
void HALSIM_SetDriverStationAutonomous(HAL_Bool autonomous);
int32_t HALSIM_RegisterDriverStationTestCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDriverStationTestCallback(int32_t uid);
HAL_Bool HALSIM_GetDriverStationTest();
void HALSIM_SetDriverStationTest(HAL_Bool test);
int32_t HALSIM_RegisterDriverStationEStopCallback(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelDriverStationEStopCallback(int32_t uid);
HAL_Bool HALSIM_GetDriverStationEStop();
void HALSIM_SetDriverStationEStop(HAL_Bool eStop);
int32_t HALSIM_RegisterDriverStationFmsAttachedCallback(
HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
void HALSIM_CancelDriverStationFmsAttachedCallback(int32_t uid);
HAL_Bool HALSIM_GetDriverStationFmsAttached();
void HALSIM_SetDriverStationFmsAttached(HAL_Bool fmsAttached);
int32_t HALSIM_RegisterDriverStationDsAttachedCallback(
HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
void HALSIM_CancelDriverStationDsAttachedCallback(int32_t uid);
HAL_Bool HALSIM_GetDriverStationDsAttached();
void HALSIM_SetDriverStationDsAttached(HAL_Bool dsAttached);
int32_t HALSIM_RegisterDriverStationAllianceStationIdCallback(
HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
void HALSIM_CancelDriverStationAllianceStationIdCallback(int32_t uid);
HAL_AllianceStationID HALSIM_GetDriverStationAllianceStationId();
void HALSIM_SetDriverStationAllianceStationId(
HAL_AllianceStationID allianceStationId);
int32_t HALSIM_RegisterDriverStationMatchTimeCallback(
HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
void HALSIM_CancelDriverStationMatchTimeCallback(int32_t uid);
double HALSIM_GetDriverStationMatchTime();
void HALSIM_SetDriverStationMatchTime(double matchTime);
void HALSIM_NotifyDriverStationNewData(void);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,83 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetEncoderData(int32_t index);
int32_t HALSIM_RegisterEncoderInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetEncoderInitialized(int32_t index);
void HALSIM_SetEncoderInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterEncoderCountCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderCountCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetEncoderCount(int32_t index);
void HALSIM_SetEncoderCount(int32_t index, int32_t count);
int32_t HALSIM_RegisterEncoderPeriodCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderPeriodCallback(int32_t index, int32_t uid);
double HALSIM_GetEncoderPeriod(int32_t index);
void HALSIM_SetEncoderPeriod(int32_t index, double period);
int32_t HALSIM_RegisterEncoderResetCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderResetCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetEncoderReset(int32_t index);
void HALSIM_SetEncoderReset(int32_t index, HAL_Bool reset);
int32_t HALSIM_RegisterEncoderMaxPeriodCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderMaxPeriodCallback(int32_t index, int32_t uid);
double HALSIM_GetEncoderMaxPeriod(int32_t index);
void HALSIM_SetEncoderMaxPeriod(int32_t index, double maxPeriod);
int32_t HALSIM_RegisterEncoderDirectionCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderDirectionCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetEncoderDirection(int32_t index);
void HALSIM_SetEncoderDirection(int32_t index, HAL_Bool direction);
int32_t HALSIM_RegisterEncoderReverseDirectionCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderReverseDirectionCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetEncoderReverseDirection(int32_t index);
void HALSIM_SetEncoderReverseDirection(int32_t index,
HAL_Bool reverseDirection);
int32_t HALSIM_RegisterEncoderSamplesToAverageCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderSamplesToAverageCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetEncoderSamplesToAverage(int32_t index);
void HALSIM_SetEncoderSamplesToAverage(int32_t index, int32_t samplesToAverage);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,67 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/Types.h"
/** HAL data types. */
enum HAL_Type {
HAL_UNASSIGNED = 0,
HAL_BOOLEAN = 0x01,
HAL_DOUBLE = 0x02,
HAL_ENUM = 0x16,
HAL_INT = 0x32,
HAL_LONG = 0x64,
};
/** HAL Entry Value. Note this is a typed union. */
struct HAL_Value {
union {
HAL_Bool v_boolean;
int32_t v_enum;
int32_t v_int;
int64_t v_long;
double v_double;
} data;
enum HAL_Type type;
};
inline HAL_Value MakeBoolean(HAL_Bool v) {
HAL_Value value;
value.type = HAL_BOOLEAN;
value.data.v_boolean = v;
return value;
}
inline HAL_Value MakeEnum(int v) {
HAL_Value value;
value.type = HAL_ENUM;
value.data.v_enum = v;
return value;
}
inline HAL_Value MakeInt(int v) {
HAL_Value value;
value.type = HAL_INT;
value.data.v_int = v;
return value;
}
inline HAL_Value MakeLong(int64_t v) {
HAL_Value value;
value.type = HAL_LONG;
value.data.v_long = v;
return value;
}
inline HAL_Value MakeDouble(double v) {
HAL_Value value;
value.type = HAL_DOUBLE;
value.data.v_double = v;
return value;
}

View File

@@ -0,0 +1,14 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
extern "C" {
void HALSIM_WaitForProgramStart(void);
void HALSIM_SetProgramStarted(void);
void HALSIM_RestartTiming(void);
}

View File

@@ -0,0 +1,26 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL_Value.h"
typedef void (*HAL_NotifyCallback)(const char* name, void* param,
const struct HAL_Value* value);
namespace hal {
struct NotifyListener {
NotifyListener() = default;
NotifyListener(void* param_, HAL_NotifyCallback callback_)
: callback(callback_), param(param_) {}
explicit operator bool() const { return callback != nullptr; }
HAL_NotifyCallback callback;
void* param;
};
} // namespace hal

View File

@@ -0,0 +1,68 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <memory>
#include <mutex>
#include <queue>
#include <vector>
#include "NotifyListener.h"
namespace hal {
// Vector which provides an integrated freelist for removal and reuse of
// individual elements.
class NotifyListenerVector {
struct private_init {};
public:
typedef typename std::vector<NotifyListener>::size_type size_type;
// Constructor for creating copies of the vector
NotifyListenerVector(const NotifyListenerVector*, const private_init&);
// Delete all default constructors so they cannot be used
NotifyListenerVector& operator=(const NotifyListenerVector&) = delete;
NotifyListenerVector() = delete;
NotifyListenerVector(const NotifyListenerVector&) = delete;
// Create a new vector with a single callback inside of it
NotifyListenerVector(void* param, HAL_NotifyCallback callback,
unsigned int* newUid);
size_type size() const { return m_vector.size(); }
NotifyListener& operator[](size_type i) { return m_vector[i]; }
const NotifyListener& operator[](size_type i) const { return m_vector[i]; }
// Add a new NotifyListener to a copy of the vector. If there are elements on
// the freelist,
// reuses the last one; otherwise adds to the end of the vector.
// Returns the resulting element index (+1).
std::shared_ptr<NotifyListenerVector> emplace_back(
void* param, HAL_NotifyCallback callback, unsigned int* newUid);
// Removes the identified element by replacing it with a default-constructed
// one. The element is added to the freelist for later reuse. Returns a copy
std::shared_ptr<NotifyListenerVector> erase(unsigned int uid);
private:
std::vector<NotifyListener> m_vector;
std::vector<unsigned int> m_free;
// Add a new NotifyListener to the vector. If there are elements on the
// freelist,
// reuses the last one; otherwise adds to the end of the vector.
// Returns the resulting element index (+1).
unsigned int emplace_back_impl(void* param, HAL_NotifyCallback callback);
// Removes the identified element by replacing it with a default-constructed
// one. The element is added to the freelist for later reuse.
void erase_impl(unsigned int uid);
};
} // namespace hal

View File

@@ -0,0 +1,79 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetPCMData(int32_t index);
int32_t HALSIM_RegisterPCMSolenoidInitializedCallback(
int32_t index, int32_t channel, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPCMSolenoidInitializedCallback(int32_t index, int32_t channel,
int32_t uid);
HAL_Bool HALSIM_GetPCMSolenoidInitialized(int32_t index, int32_t channel);
void HALSIM_SetPCMSolenoidInitialized(int32_t index, int32_t channel,
HAL_Bool solenoidInitialized);
int32_t HALSIM_RegisterPCMSolenoidOutputCallback(int32_t index, int32_t channel,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPCMSolenoidOutputCallback(int32_t index, int32_t channel,
int32_t uid);
HAL_Bool HALSIM_GetPCMSolenoidOutput(int32_t index, int32_t channel);
void HALSIM_SetPCMSolenoidOutput(int32_t index, int32_t channel,
HAL_Bool solenoidOutput);
int32_t HALSIM_RegisterPCMCompressorInitializedCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPCMCompressorInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetPCMCompressorInitialized(int32_t index);
void HALSIM_SetPCMCompressorInitialized(int32_t index,
HAL_Bool compressorInitialized);
int32_t HALSIM_RegisterPCMCompressorOnCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPCMCompressorOnCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetPCMCompressorOn(int32_t index);
void HALSIM_SetPCMCompressorOn(int32_t index, HAL_Bool compressorOn);
int32_t HALSIM_RegisterPCMClosedLoopEnabledCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPCMClosedLoopEnabledCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetPCMClosedLoopEnabled(int32_t index);
void HALSIM_SetPCMClosedLoopEnabled(int32_t index, HAL_Bool closedLoopEnabled);
int32_t HALSIM_RegisterPCMPressureSwitchCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPCMPressureSwitchCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetPCMPressureSwitch(int32_t index);
void HALSIM_SetPCMPressureSwitch(int32_t index, HAL_Bool pressureSwitch);
int32_t HALSIM_RegisterPCMCompressorCurrentCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPCMCompressorCurrentCallback(int32_t index, int32_t uid);
double HALSIM_GetPCMCompressorCurrent(int32_t index);
void HALSIM_SetPCMCompressorCurrent(int32_t index, double compressorCurrent);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,51 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetPDPData(int32_t index);
int32_t HALSIM_RegisterPDPInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPDPInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetPDPInitialized(int32_t index);
void HALSIM_SetPDPInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterPDPTemperatureCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPDPTemperatureCallback(int32_t index, int32_t uid);
double HALSIM_GetPDPTemperature(int32_t index);
void HALSIM_SetPDPTemperature(int32_t index, double temperature);
int32_t HALSIM_RegisterPDPVoltageCallback(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
void HALSIM_CancelPDPVoltageCallback(int32_t index, int32_t uid);
double HALSIM_GetPDPVoltage(int32_t index);
void HALSIM_SetPDPVoltage(int32_t index, double voltage);
int32_t HALSIM_RegisterPDPCurrentCallback(int32_t index, int32_t channel,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
void HALSIM_CancelPDPCurrentCallback(int32_t index, int32_t channel,
int32_t uid);
double HALSIM_GetPDPCurrent(int32_t index, int32_t channel);
void HALSIM_SetPDPCurrent(int32_t index, int32_t channel, double current);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,65 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetPWMData(int32_t index);
int32_t HALSIM_RegisterPWMInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPWMInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetPWMInitialized(int32_t index);
void HALSIM_SetPWMInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterPWMRawValueCallback(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
void HALSIM_CancelPWMRawValueCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetPWMRawValue(int32_t index);
void HALSIM_SetPWMRawValue(int32_t index, int32_t rawValue);
int32_t HALSIM_RegisterPWMSpeedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
void HALSIM_CancelPWMSpeedCallback(int32_t index, int32_t uid);
double HALSIM_GetPWMSpeed(int32_t index);
void HALSIM_SetPWMSpeed(int32_t index, double speed);
int32_t HALSIM_RegisterPWMPositionCallback(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
void HALSIM_CancelPWMPositionCallback(int32_t index, int32_t uid);
double HALSIM_GetPWMPosition(int32_t index);
void HALSIM_SetPWMPosition(int32_t index, double position);
int32_t HALSIM_RegisterPWMPeriodScaleCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPWMPeriodScaleCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetPWMPeriodScale(int32_t index);
void HALSIM_SetPWMPeriodScale(int32_t index, int32_t periodScale);
int32_t HALSIM_RegisterPWMZeroLatchCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelPWMZeroLatchCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetPWMZeroLatch(int32_t index);
void HALSIM_SetPWMZeroLatch(int32_t index, HAL_Bool zeroLatch);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,52 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetRelayData(int32_t index);
int32_t HALSIM_RegisterRelayInitializedForwardCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRelayInitializedForwardCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRelayInitializedForward(int32_t index);
void HALSIM_SetRelayInitializedForward(int32_t index,
HAL_Bool initializedForward);
int32_t HALSIM_RegisterRelayInitializedReverseCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRelayInitializedReverseCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRelayInitializedReverse(int32_t index);
void HALSIM_SetRelayInitializedReverse(int32_t index,
HAL_Bool initializedReverse);
int32_t HALSIM_RegisterRelayForwardCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRelayForwardCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRelayForward(int32_t index);
void HALSIM_SetRelayForward(int32_t index, HAL_Bool forward);
int32_t HALSIM_RegisterRelayReverseCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRelayReverseCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRelayReverse(int32_t index);
void HALSIM_SetRelayReverse(int32_t index, HAL_Bool reverse);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,138 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetRoboRioData(int32_t index);
int32_t HALSIM_RegisterRoboRioFPGAButtonCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioFPGAButtonCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRoboRioFPGAButton(int32_t index);
void HALSIM_SetRoboRioFPGAButton(int32_t index, HAL_Bool fPGAButton);
int32_t HALSIM_RegisterRoboRioVInVoltageCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioVInVoltageCallback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioVInVoltage(int32_t index);
void HALSIM_SetRoboRioVInVoltage(int32_t index, double vInVoltage);
int32_t HALSIM_RegisterRoboRioVInCurrentCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioVInCurrentCallback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioVInCurrent(int32_t index);
void HALSIM_SetRoboRioVInCurrent(int32_t index, double vInCurrent);
int32_t HALSIM_RegisterRoboRioUserVoltage6VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserVoltage6VCallback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioUserVoltage6V(int32_t index);
void HALSIM_SetRoboRioUserVoltage6V(int32_t index, double userVoltage6V);
int32_t HALSIM_RegisterRoboRioUserCurrent6VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserCurrent6VCallback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioUserCurrent6V(int32_t index);
void HALSIM_SetRoboRioUserCurrent6V(int32_t index, double userCurrent6V);
int32_t HALSIM_RegisterRoboRioUserActive6VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserActive6VCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRoboRioUserActive6V(int32_t index);
void HALSIM_SetRoboRioUserActive6V(int32_t index, HAL_Bool userActive6V);
int32_t HALSIM_RegisterRoboRioUserVoltage5VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserVoltage5VCallback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioUserVoltage5V(int32_t index);
void HALSIM_SetRoboRioUserVoltage5V(int32_t index, double userVoltage5V);
int32_t HALSIM_RegisterRoboRioUserCurrent5VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserCurrent5VCallback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioUserCurrent5V(int32_t index);
void HALSIM_SetRoboRioUserCurrent5V(int32_t index, double userCurrent5V);
int32_t HALSIM_RegisterRoboRioUserActive5VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserActive5VCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRoboRioUserActive5V(int32_t index);
void HALSIM_SetRoboRioUserActive5V(int32_t index, HAL_Bool userActive5V);
int32_t HALSIM_RegisterRoboRioUserVoltage3V3Callback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserVoltage3V3Callback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioUserVoltage3V3(int32_t index);
void HALSIM_SetRoboRioUserVoltage3V3(int32_t index, double userVoltage3V3);
int32_t HALSIM_RegisterRoboRioUserCurrent3V3Callback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserCurrent3V3Callback(int32_t index, int32_t uid);
double HALSIM_GetRoboRioUserCurrent3V3(int32_t index);
void HALSIM_SetRoboRioUserCurrent3V3(int32_t index, double userCurrent3V3);
int32_t HALSIM_RegisterRoboRioUserActive3V3Callback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserActive3V3Callback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetRoboRioUserActive3V3(int32_t index);
void HALSIM_SetRoboRioUserActive3V3(int32_t index, HAL_Bool userActive3V3);
int32_t HALSIM_RegisterRoboRioUserFaults6VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserFaults6VCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetRoboRioUserFaults6V(int32_t index);
void HALSIM_SetRoboRioUserFaults6V(int32_t index, int32_t userFaults6V);
int32_t HALSIM_RegisterRoboRioUserFaults5VCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserFaults5VCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetRoboRioUserFaults5V(int32_t index);
void HALSIM_SetRoboRioUserFaults5V(int32_t index, int32_t userFaults5V);
int32_t HALSIM_RegisterRoboRioUserFaults3V3Callback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelRoboRioUserFaults3V3Callback(int32_t index, int32_t uid);
int32_t HALSIM_GetRoboRioUserFaults3V3(int32_t index);
void HALSIM_SetRoboRioUserFaults3V3(int32_t index, int32_t userFaults3V3);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,58 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2017. 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 the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "HAL/HAL.h"
#include "NotifyListener.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetSPIAccelerometerData(int32_t index);
int32_t HALSIM_RegisterSPIAccelerometerActiveCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelSPIAccelerometerActiveCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetSPIAccelerometerActive(int32_t index);
void HALSIM_SetSPIAccelerometerActive(int32_t index, HAL_Bool active);
int32_t HALSIM_RegisterSPIAccelerometerRangeCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelSPIAccelerometerRangeCallback(int32_t index, int32_t uid);
int32_t HALSIM_GetSPIAccelerometerRange(int32_t index);
void HALSIM_SetSPIAccelerometerRange(int32_t index, int32_t range);
int32_t HALSIM_RegisterSPIAccelerometerXCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelSPIAccelerometerXCallback(int32_t index, int32_t uid);
double HALSIM_GetSPIAccelerometerX(int32_t index);
void HALSIM_SetSPIAccelerometerX(int32_t index, double x);
int32_t HALSIM_RegisterSPIAccelerometerYCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelSPIAccelerometerYCallback(int32_t index, int32_t uid);
double HALSIM_GetSPIAccelerometerY(int32_t index);
void HALSIM_SetSPIAccelerometerY(int32_t index, double y);
int32_t HALSIM_RegisterSPIAccelerometerZCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelSPIAccelerometerZCallback(int32_t index, int32_t uid);
double HALSIM_GetSPIAccelerometerZ(int32_t index);
void HALSIM_SetSPIAccelerometerZ(int32_t index, double z);
#ifdef __cplusplus
}
#endif