WPILibC++  2020.3.2
PWMData.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_ResetPWMData(int32_t index);
18 int32_t HALSIM_RegisterPWMInitializedCallback(int32_t index,
19  HAL_NotifyCallback callback,
20  void* param,
21  HAL_Bool initialNotify);
22 void HALSIM_CancelPWMInitializedCallback(int32_t index, int32_t uid);
23 HAL_Bool HALSIM_GetPWMInitialized(int32_t index);
24 void HALSIM_SetPWMInitialized(int32_t index, HAL_Bool initialized);
25 
26 int32_t HALSIM_RegisterPWMRawValueCallback(int32_t index,
27  HAL_NotifyCallback callback,
28  void* param, HAL_Bool initialNotify);
29 void HALSIM_CancelPWMRawValueCallback(int32_t index, int32_t uid);
30 int32_t HALSIM_GetPWMRawValue(int32_t index);
31 void HALSIM_SetPWMRawValue(int32_t index, int32_t rawValue);
32 
33 int32_t HALSIM_RegisterPWMSpeedCallback(int32_t index,
34  HAL_NotifyCallback callback,
35  void* param, HAL_Bool initialNotify);
36 void HALSIM_CancelPWMSpeedCallback(int32_t index, int32_t uid);
37 double HALSIM_GetPWMSpeed(int32_t index);
38 void HALSIM_SetPWMSpeed(int32_t index, double speed);
39 
40 int32_t HALSIM_RegisterPWMPositionCallback(int32_t index,
41  HAL_NotifyCallback callback,
42  void* param, HAL_Bool initialNotify);
43 void HALSIM_CancelPWMPositionCallback(int32_t index, int32_t uid);
44 double HALSIM_GetPWMPosition(int32_t index);
45 void HALSIM_SetPWMPosition(int32_t index, double position);
46 
47 int32_t HALSIM_RegisterPWMPeriodScaleCallback(int32_t index,
48  HAL_NotifyCallback callback,
49  void* param,
50  HAL_Bool initialNotify);
51 void HALSIM_CancelPWMPeriodScaleCallback(int32_t index, int32_t uid);
52 int32_t HALSIM_GetPWMPeriodScale(int32_t index);
53 void HALSIM_SetPWMPeriodScale(int32_t index, int32_t periodScale);
54 
55 int32_t HALSIM_RegisterPWMZeroLatchCallback(int32_t index,
56  HAL_NotifyCallback callback,
57  void* param,
58  HAL_Bool initialNotify);
59 void HALSIM_CancelPWMZeroLatchCallback(int32_t index, int32_t uid);
60 HAL_Bool HALSIM_GetPWMZeroLatch(int32_t index);
61 void HALSIM_SetPWMZeroLatch(int32_t index, HAL_Bool zeroLatch);
62 
63 void HALSIM_RegisterPWMAllCallbacks(int32_t index, HAL_NotifyCallback callback,
64  void* param, HAL_Bool initialNotify);
65 
66 #ifdef __cplusplus
67 } // extern "C"
68 #endif