Move CameraServer and WPILib headers into their own folder

The old headers were moved into folders because doing so avoids polluting
the system include directories.

Folder names were also normalized to lowercase.
This commit is contained in:
Tyler Veness
2018-07-20 00:03:45 -07:00
committed by Peter Johnson
parent 31ced30c1e
commit d89b7dd412
728 changed files with 1876 additions and 1851 deletions

View File

@@ -0,0 +1,69 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterAccelerometerAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,51 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterAnalogGyroAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,101 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterAnalogInAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,44 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterAnalogOutAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,68 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterAnalogTriggerAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,78 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "HAL_Value.h"
#include "NotifyListener.h"
#include "hal/HAL.h"
typedef void (*HAL_CAN_SendMessageCallback)(const char* name, void* param,
uint32_t messageID,
const uint8_t* data,
uint8_t dataSize, int32_t periodMs,
int32_t* status);
typedef void (*HAL_CAN_ReceiveMessageCallback)(
const char* name, void* param, uint32_t* messageID, uint32_t messageIDMask,
uint8_t* data, uint8_t* dataSize, uint32_t* timeStamp, int32_t* status);
typedef void (*HAL_CAN_OpenStreamSessionCallback)(
const char* name, void* param, uint32_t* sessionHandle, uint32_t messageID,
uint32_t messageIDMask, uint32_t maxMessages, int32_t* status);
typedef void (*HAL_CAN_CloseStreamSessionCallback)(const char* name,
void* param,
uint32_t sessionHandle);
typedef void (*HAL_CAN_ReadStreamSessionCallback)(
const char* name, void* param, uint32_t sessionHandle,
struct HAL_CANStreamMessage* messages, uint32_t messagesToRead,
uint32_t* messagesRead, int32_t* status);
typedef void (*HAL_CAN_GetCANStatusCallback)(
const char* name, void* param, float* percentBusUtilization,
uint32_t* busOffCount, uint32_t* txFullCount, uint32_t* receiveErrorCount,
uint32_t* transmitErrorCount, int32_t* status);
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetCanData(void);
int32_t HALSIM_RegisterCanSendMessageCallback(
HAL_CAN_SendMessageCallback callback, void* param);
void HALSIM_CancelCanSendMessageCallback(int32_t uid);
int32_t HALSIM_RegisterCanReceiveMessageCallback(
HAL_CAN_ReceiveMessageCallback callback, void* param);
void HALSIM_CancelCanReceiveMessageCallback(int32_t uid);
int32_t HALSIM_RegisterCanOpenStreamCallback(
HAL_CAN_OpenStreamSessionCallback callback, void* param);
void HALSIM_CancelCanOpenStreamCallback(int32_t uid);
int32_t HALSIM_RegisterCanCloseStreamCallback(
HAL_CAN_CloseStreamSessionCallback callback, void* param);
void HALSIM_CancelCanCloseStreamCallback(int32_t uid);
int32_t HALSIM_RegisterCanReadStreamCallback(
HAL_CAN_ReadStreamSessionCallback callback, void* param);
void HALSIM_CancelCanReadStreamCallback(int32_t uid);
int32_t HALSIM_RegisterCanGetCANStatusCallback(
HAL_CAN_GetCANStatusCallback callback, void* param);
void HALSIM_CancelCanGetCANStatusCallback(int32_t uid);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,65 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterDIOAllCallbacks(int32_t index, HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,51 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterDigitalPWMAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,95 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/DriverStation.h"
#include "hal/HAL.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);
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);
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);
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);
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);
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);
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);
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);
void HALSIM_SetDriverStationMatchTime(double matchTime);
void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
void HALSIM_SetJoystickButtons(int32_t joystickNum,
const HAL_JoystickButtons* buttons);
void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
const HAL_JoystickDescriptor* descriptor);
void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
int32_t* leftRumble, int32_t* rightRumble);
void HALSIM_SetMatchInfo(const HAL_MatchInfo* info);
void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_NotifyDriverStationNewData(void);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,99 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetEncoderData(int32_t index);
int16_t HALSIM_GetDigitalChannelA(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);
int32_t HALSIM_RegisterEncoderDistancePerPulseCallback(
int32_t index, HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
void HALSIM_CancelEncoderDistancePerPulseCallback(int32_t index, int32_t uid);
double HALSIM_GetEncoderDistancePerPulse(int32_t index);
void HALSIM_SetEncoderDistancePerPulse(int32_t index, double distancePerPulse);
void HALSIM_RegisterEncoderAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,71 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#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;
}
#endif

View File

@@ -0,0 +1,43 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.h"
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetI2CData(int32_t index);
int32_t HALSIM_RegisterI2CInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelI2CInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetI2CInitialized(int32_t index);
void HALSIM_SetI2CInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterI2CReadCallback(int32_t index,
HAL_BufferCallback callback,
void* param);
void HALSIM_CancelI2CReadCallback(int32_t index, int32_t uid);
int32_t HALSIM_RegisterI2CWriteCallback(int32_t index,
HAL_ConstBufferCallback callback,
void* param);
void HALSIM_CancelI2CWriteCallback(int32_t index, int32_t uid);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,18 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
extern "C" {
void HALSIM_WaitForProgramStart(void);
void HALSIM_SetProgramStarted(void);
void HALSIM_RestartTiming(void);
} // extern "C"
#endif

View File

@@ -0,0 +1,71 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include <memory>
#include "mockdata/NotifyListenerVector.h"
template <typename VectorType, typename CallbackType>
std::shared_ptr<VectorType> RegisterCallbackImpl(
std::shared_ptr<VectorType> currentVector, const char* name,
CallbackType callback, void* param, int32_t* newUid) {
std::shared_ptr<VectorType> newCallbacks;
if (currentVector == nullptr) {
newCallbacks = std::make_shared<VectorType>(
param, callback, reinterpret_cast<unsigned int*>(newUid));
} else {
newCallbacks = currentVector->emplace_back(
param, callback, reinterpret_cast<unsigned int*>(newUid));
}
return newCallbacks;
}
template <typename VectorType, typename CallbackType>
std::shared_ptr<VectorType> CancelCallbackImpl(
std::shared_ptr<VectorType> currentVector, int32_t uid) {
// Create a copy of the callbacks to erase from
auto newCallbacks = currentVector->erase(uid);
return newCallbacks;
}
std::shared_ptr<hal::NotifyListenerVector> RegisterCallback(
std::shared_ptr<hal::NotifyListenerVector> currentVector, const char* name,
HAL_NotifyCallback callback, void* param, int32_t* newUid);
std::shared_ptr<hal::NotifyListenerVector> CancelCallback(
std::shared_ptr<hal::NotifyListenerVector> currentVector, int32_t uid);
void InvokeCallback(std::shared_ptr<hal::NotifyListenerVector> currentVector,
const char* name, const HAL_Value* value);
std::shared_ptr<hal::BufferListenerVector> RegisterCallback(
std::shared_ptr<hal::BufferListenerVector> currentVector, const char* name,
HAL_BufferCallback callback, void* param, int32_t* newUid);
std::shared_ptr<hal::BufferListenerVector> CancelCallback(
std::shared_ptr<hal::BufferListenerVector> currentVector, int32_t uid);
void InvokeCallback(std::shared_ptr<hal::BufferListenerVector> currentVector,
const char* name, uint8_t* buffer, int32_t count);
std::shared_ptr<hal::ConstBufferListenerVector> RegisterCallback(
std::shared_ptr<hal::ConstBufferListenerVector> currentVector,
const char* name, HAL_ConstBufferCallback callback, void* param,
int32_t* newUid);
std::shared_ptr<hal::ConstBufferListenerVector> CancelCallback(
std::shared_ptr<hal::ConstBufferListenerVector> currentVector, int32_t uid);
void InvokeCallback(
std::shared_ptr<hal::ConstBufferListenerVector> currentVector,
const char* name, const uint8_t* buffer, int32_t count);
#endif

View File

@@ -0,0 +1,40 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "HAL_Value.h"
typedef void (*HAL_NotifyCallback)(const char* name, void* param,
const struct HAL_Value* value);
typedef void (*HAL_BufferCallback)(const char* name, void* param,
unsigned char* buffer, unsigned int count);
typedef void (*HAL_ConstBufferCallback)(const char* name, void* param,
const unsigned char* buffer,
unsigned int count);
namespace hal {
template <typename CallbackFunction>
struct HalCallbackListener {
HalCallbackListener() = default;
HalCallbackListener(void* param_, CallbackFunction callback_)
: callback(callback_), param(param_) {}
explicit operator bool() const { return callback != nullptr; }
CallbackFunction callback;
void* param;
};
} // namespace hal
#endif

View File

@@ -0,0 +1,142 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include <memory>
#include <wpi/SmallVector.h>
#include "NotifyListener.h"
namespace hal {
// Vector which provides an integrated freelist for removal and reuse of
// individual elements.
template <typename ListenerType>
class HalCallbackListenerVectorImpl {
struct private_init {};
public:
typedef typename wpi::SmallVectorImpl<
HalCallbackListener<ListenerType>>::size_type size_type;
// Constructor for creating copies of the vector
HalCallbackListenerVectorImpl(const HalCallbackListenerVectorImpl* copyFrom,
const private_init&);
// Delete all default constructors so they cannot be used
HalCallbackListenerVectorImpl& operator=(
const HalCallbackListenerVectorImpl&) = delete;
HalCallbackListenerVectorImpl() = delete;
HalCallbackListenerVectorImpl(const HalCallbackListenerVectorImpl&) = delete;
// Create a new vector with a single callback inside of it
HalCallbackListenerVectorImpl(void* param, ListenerType callback,
unsigned int* newUid) {
*newUid = emplace_back_impl(param, callback);
}
size_type size() const { return m_vector.size(); }
HalCallbackListener<ListenerType>& operator[](size_type i) {
return m_vector[i];
}
const HalCallbackListener<ListenerType>& 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<HalCallbackListenerVectorImpl<ListenerType>> emplace_back(
void* param, ListenerType 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<HalCallbackListenerVectorImpl<ListenerType>> erase(
unsigned int uid);
private:
wpi::SmallVector<HalCallbackListener<ListenerType>, 4> m_vector;
wpi::SmallVector<unsigned int, 4> 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, ListenerType 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);
};
template <typename ListenerType>
HalCallbackListenerVectorImpl<ListenerType>::HalCallbackListenerVectorImpl(
const HalCallbackListenerVectorImpl<ListenerType>* copyFrom,
const private_init&)
: m_vector(copyFrom->m_vector), m_free(copyFrom->m_free) {}
template <typename ListenerType>
std::shared_ptr<HalCallbackListenerVectorImpl<ListenerType>>
HalCallbackListenerVectorImpl<ListenerType>::emplace_back(
void* param, ListenerType callback, unsigned int* newUid) {
auto newVector =
std::make_shared<HalCallbackListenerVectorImpl<ListenerType>>(
this, private_init());
newVector->m_vector = m_vector;
newVector->m_free = m_free;
*newUid = newVector->emplace_back_impl(param, callback);
return newVector;
}
template <typename ListenerType>
std::shared_ptr<HalCallbackListenerVectorImpl<ListenerType>>
HalCallbackListenerVectorImpl<ListenerType>::erase(unsigned int uid) {
auto newVector =
std::make_shared<HalCallbackListenerVectorImpl<ListenerType>>(
this, private_init());
newVector->m_vector = m_vector;
newVector->m_free = m_free;
newVector->erase_impl(uid);
return newVector;
}
template <typename ListenerType>
unsigned int HalCallbackListenerVectorImpl<ListenerType>::emplace_back_impl(
void* param, ListenerType callback) {
unsigned int uid;
if (m_free.empty()) {
uid = m_vector.size();
m_vector.emplace_back(param, callback);
} else {
uid = m_free.back();
m_free.pop_back();
m_vector[uid] = HalCallbackListener<ListenerType>(param, callback);
}
return uid + 1;
}
template <typename ListenerType>
void HalCallbackListenerVectorImpl<ListenerType>::erase_impl(unsigned int uid) {
--uid;
if (uid >= m_vector.size() || !m_vector[uid]) return;
m_free.push_back(uid);
m_vector[uid] = HalCallbackListener<ListenerType>();
}
typedef HalCallbackListenerVectorImpl<HAL_NotifyCallback> NotifyListenerVector;
typedef HalCallbackListenerVectorImpl<HAL_BufferCallback> BufferListenerVector;
typedef HalCallbackListenerVectorImpl<HAL_ConstBufferCallback>
ConstBufferListenerVector;
} // namespace hal
#endif

View File

@@ -0,0 +1,93 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterPCMAllNonSolenoidCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_RegisterPCMAllSolenoidCallbacks(int32_t index, int32_t channel,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,60 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterPDPAllNonCurrentCallbacks(int32_t index, int32_t channel,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,72 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterPWMAllCallbacks(int32_t index, HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,60 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterRelayAllCallbacks(int32_t index,
HAL_NotifyCallback callback, void* param,
HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,146 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterRoboRioAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param, HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,67 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.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);
void HALSIM_RegisterSPIAccelerometerAllCallbcaks(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@@ -0,0 +1,53 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. 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
#ifndef __FRC_ROBORIO__
#include "NotifyListener.h"
#include "hal/HAL.h"
typedef void (*HAL_SpiReadAutoReceiveBufferCallback)(const char* name,
void* param,
unsigned char* buffer,
int32_t numToRead,
int32_t* outputCount);
#ifdef __cplusplus
extern "C" {
#endif
void HALSIM_ResetSPIData(int32_t index);
int32_t HALSIM_RegisterSPIInitializedCallback(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify);
void HALSIM_CancelSPIInitializedCallback(int32_t index, int32_t uid);
HAL_Bool HALSIM_GetSPIInitialized(int32_t index);
void HALSIM_SetSPIInitialized(int32_t index, HAL_Bool initialized);
int32_t HALSIM_RegisterSPIReadCallback(int32_t index,
HAL_BufferCallback callback,
void* param);
void HALSIM_CancelSPIReadCallback(int32_t index, int32_t uid);
int32_t HALSIM_RegisterSPIWriteCallback(int32_t index,
HAL_ConstBufferCallback callback,
void* param);
void HALSIM_CancelSPIWriteCallback(int32_t index, int32_t uid);
int32_t HALSIM_RegisterSPIReadAutoReceivedDataCallback(
int32_t index, HAL_SpiReadAutoReceiveBufferCallback callback, void* param);
void HALSIM_CancelSPIReadAutoReceivedDataCallback(int32_t index, int32_t uid);
#ifdef __cplusplus
} // extern "C"
#endif
#endif