Brian Silverman | f7f267a | 2017-02-04 16:16:08 -0800 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) FIRST 2016-2017. All Rights Reserved. */ |
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */ |
| 4 | /* must be accompanied by the FIRST BSD license file in the root directory of */ |
| 5 | /* the project. */ |
| 6 | /*----------------------------------------------------------------------------*/ |
| 7 | |
| 8 | #pragma once |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | #include "HAL/AnalogTrigger.h" |
| 13 | #include "HAL/Types.h" |
| 14 | |
| 15 | extern "C" { |
| 16 | HAL_FPGAEncoderHandle HAL_InitializeFPGAEncoder( |
| 17 | HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA, |
| 18 | HAL_Handle digitalSourceHandleB, HAL_AnalogTriggerType analogTriggerTypeB, |
| 19 | HAL_Bool reverseDirection, int32_t* index, int32_t* status); |
| 20 | void HAL_FreeFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 21 | int32_t* status); |
| 22 | void HAL_ResetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 23 | int32_t* status); |
| 24 | int32_t HAL_GetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 25 | int32_t* status); // Raw value |
| 26 | double HAL_GetFPGAEncoderPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 27 | int32_t* status); |
| 28 | void HAL_SetFPGAEncoderMaxPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 29 | double maxPeriod, int32_t* status); |
| 30 | HAL_Bool HAL_GetFPGAEncoderStopped(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 31 | int32_t* status); |
| 32 | HAL_Bool HAL_GetFPGAEncoderDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 33 | int32_t* status); |
| 34 | void HAL_SetFPGAEncoderReverseDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 35 | HAL_Bool reverseDirection, |
| 36 | int32_t* status); |
| 37 | void HAL_SetFPGAEncoderSamplesToAverage(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 38 | int32_t samplesToAverage, |
| 39 | int32_t* status); |
| 40 | int32_t HAL_GetFPGAEncoderSamplesToAverage( |
| 41 | HAL_FPGAEncoderHandle fpgaEncoderHandle, int32_t* status); |
| 42 | void HAL_SetFPGAEncoderIndexSource(HAL_FPGAEncoderHandle fpgaEncoderHandle, |
| 43 | HAL_Handle digitalSourceHandle, |
| 44 | HAL_AnalogTriggerType analogTriggerType, |
| 45 | HAL_Bool activeHigh, HAL_Bool edgeSensitive, |
| 46 | int32_t* status); |
| 47 | } |