WPILibC++  2020.3.2
EncoderData.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2017-2019 FIRST. 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 "NotifyListener.h"
11 #include "hal/Types.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 void HALSIM_ResetEncoderData(int32_t index);
18 int32_t HALSIM_GetEncoderDigitalChannelA(int32_t index);
19 int32_t HALSIM_GetEncoderDigitalChannelB(int32_t index);
20 int32_t HALSIM_RegisterEncoderInitializedCallback(int32_t index,
21  HAL_NotifyCallback callback,
22  void* param,
23  HAL_Bool initialNotify);
24 void HALSIM_CancelEncoderInitializedCallback(int32_t index, int32_t uid);
25 HAL_Bool HALSIM_GetEncoderInitialized(int32_t index);
26 void HALSIM_SetEncoderInitialized(int32_t index, HAL_Bool initialized);
27 
28 HAL_SimDeviceHandle HALSIM_GetEncoderSimDevice(int32_t index);
29 
30 int32_t HALSIM_RegisterEncoderCountCallback(int32_t index,
31  HAL_NotifyCallback callback,
32  void* param,
33  HAL_Bool initialNotify);
34 void HALSIM_CancelEncoderCountCallback(int32_t index, int32_t uid);
35 int32_t HALSIM_GetEncoderCount(int32_t index);
36 void HALSIM_SetEncoderCount(int32_t index, int32_t count);
37 
38 int32_t HALSIM_RegisterEncoderPeriodCallback(int32_t index,
39  HAL_NotifyCallback callback,
40  void* param,
41  HAL_Bool initialNotify);
42 void HALSIM_CancelEncoderPeriodCallback(int32_t index, int32_t uid);
43 double HALSIM_GetEncoderPeriod(int32_t index);
44 void HALSIM_SetEncoderPeriod(int32_t index, double period);
45 
46 int32_t HALSIM_RegisterEncoderResetCallback(int32_t index,
47  HAL_NotifyCallback callback,
48  void* param,
49  HAL_Bool initialNotify);
50 void HALSIM_CancelEncoderResetCallback(int32_t index, int32_t uid);
51 HAL_Bool HALSIM_GetEncoderReset(int32_t index);
52 void HALSIM_SetEncoderReset(int32_t index, HAL_Bool reset);
53 
54 int32_t HALSIM_RegisterEncoderMaxPeriodCallback(int32_t index,
55  HAL_NotifyCallback callback,
56  void* param,
57  HAL_Bool initialNotify);
58 void HALSIM_CancelEncoderMaxPeriodCallback(int32_t index, int32_t uid);
59 double HALSIM_GetEncoderMaxPeriod(int32_t index);
60 void HALSIM_SetEncoderMaxPeriod(int32_t index, double maxPeriod);
61 
62 int32_t HALSIM_RegisterEncoderDirectionCallback(int32_t index,
63  HAL_NotifyCallback callback,
64  void* param,
65  HAL_Bool initialNotify);
66 void HALSIM_CancelEncoderDirectionCallback(int32_t index, int32_t uid);
67 HAL_Bool HALSIM_GetEncoderDirection(int32_t index);
68 void HALSIM_SetEncoderDirection(int32_t index, HAL_Bool direction);
69 
70 int32_t HALSIM_RegisterEncoderReverseDirectionCallback(
71  int32_t index, HAL_NotifyCallback callback, void* param,
72  HAL_Bool initialNotify);
73 void HALSIM_CancelEncoderReverseDirectionCallback(int32_t index, int32_t uid);
74 HAL_Bool HALSIM_GetEncoderReverseDirection(int32_t index);
75 void HALSIM_SetEncoderReverseDirection(int32_t index,
76  HAL_Bool reverseDirection);
77 
78 int32_t HALSIM_RegisterEncoderSamplesToAverageCallback(
79  int32_t index, HAL_NotifyCallback callback, void* param,
80  HAL_Bool initialNotify);
81 void HALSIM_CancelEncoderSamplesToAverageCallback(int32_t index, int32_t uid);
82 int32_t HALSIM_GetEncoderSamplesToAverage(int32_t index);
83 void HALSIM_SetEncoderSamplesToAverage(int32_t index, int32_t samplesToAverage);
84 
85 int32_t HALSIM_RegisterEncoderDistancePerPulseCallback(
86  int32_t index, HAL_NotifyCallback callback, void* param,
87  HAL_Bool initialNotify);
88 void HALSIM_CancelEncoderDistancePerPulseCallback(int32_t index, int32_t uid);
89 double HALSIM_GetEncoderDistancePerPulse(int32_t index);
90 void HALSIM_SetEncoderDistancePerPulse(int32_t index, double distancePerPulse);
91 
92 void HALSIM_RegisterEncoderAllCallbacks(int32_t index,
93  HAL_NotifyCallback callback,
94  void* param, HAL_Bool initialNotify);
95 
96 #ifdef __cplusplus
97 } // extern "C"
98 #endif