blob: 279fa814e575790768f592254e68979293305f0e [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
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
15extern "C" {
16HAL_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);
20void HAL_FreeFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
21 int32_t* status);
22void HAL_ResetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
23 int32_t* status);
24int32_t HAL_GetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
25 int32_t* status); // Raw value
26double HAL_GetFPGAEncoderPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
27 int32_t* status);
28void HAL_SetFPGAEncoderMaxPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
29 double maxPeriod, int32_t* status);
30HAL_Bool HAL_GetFPGAEncoderStopped(HAL_FPGAEncoderHandle fpgaEncoderHandle,
31 int32_t* status);
32HAL_Bool HAL_GetFPGAEncoderDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
33 int32_t* status);
34void HAL_SetFPGAEncoderReverseDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
35 HAL_Bool reverseDirection,
36 int32_t* status);
37void HAL_SetFPGAEncoderSamplesToAverage(HAL_FPGAEncoderHandle fpgaEncoderHandle,
38 int32_t samplesToAverage,
39 int32_t* status);
40int32_t HAL_GetFPGAEncoderSamplesToAverage(
41 HAL_FPGAEncoderHandle fpgaEncoderHandle, int32_t* status);
42void 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}