2016-07-03 15:22:22 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) FIRST 2016. 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 <stdint.h>
|
|
|
|
|
|
2016-07-07 21:43:55 -07:00
|
|
|
#include "HAL/AnalogTrigger.h"
|
2016-07-12 10:45:14 -07:00
|
|
|
#include "HAL/Types.h"
|
2016-07-03 15:22:22 -07:00
|
|
|
|
|
|
|
|
extern "C" {
|
2016-07-09 00:24:26 -07:00
|
|
|
HAL_FPGAEncoderHandle HAL_InitializeFPGAEncoder(
|
|
|
|
|
HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA,
|
|
|
|
|
HAL_Handle digitalSourceHandleB, HAL_AnalogTriggerType analogTriggerTypeB,
|
2016-07-12 10:45:14 -07:00
|
|
|
HAL_Bool reverseDirection, int32_t* index, int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_FreeFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_ResetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
int32_t HAL_GetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
int32_t* status); // Raw value
|
2016-08-12 13:45:28 -07:00
|
|
|
double HAL_GetFPGAEncoderPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_SetFPGAEncoderMaxPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
double maxPeriod, int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
HAL_Bool HAL_GetFPGAEncoderStopped(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-12 10:45:14 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
HAL_Bool HAL_GetFPGAEncoderDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-12 10:45:14 -07:00
|
|
|
int32_t* status);
|
2016-08-12 13:45:28 -07:00
|
|
|
void HAL_SetFPGAEncoderReverseDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
|
|
|
|
HAL_Bool reverseDirection,
|
|
|
|
|
int32_t* status);
|
|
|
|
|
void HAL_SetFPGAEncoderSamplesToAverage(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
|
|
|
|
int32_t samplesToAverage,
|
|
|
|
|
int32_t* status);
|
2016-07-12 10:45:14 -07:00
|
|
|
int32_t HAL_GetFPGAEncoderSamplesToAverage(
|
2016-08-12 13:45:28 -07:00
|
|
|
HAL_FPGAEncoderHandle fpgaEncoderHandle, int32_t* status);
|
|
|
|
|
void HAL_SetFPGAEncoderIndexSource(HAL_FPGAEncoderHandle fpgaEncoderHandle,
|
2016-07-09 00:24:26 -07:00
|
|
|
HAL_Handle digitalSourceHandle,
|
|
|
|
|
HAL_AnalogTriggerType analogTriggerType,
|
2016-07-12 10:45:14 -07:00
|
|
|
HAL_Bool activeHigh, HAL_Bool edgeSensitive,
|
2016-07-09 00:24:26 -07:00
|
|
|
int32_t* status);
|
2016-07-03 15:22:22 -07:00
|
|
|
}
|