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