WPILibC++  2018.4.1-20180728210220-1136-g75a6720
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
AnalogTrigger.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2016-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 #include <stdint.h>
11 
12 #include "hal/Types.h"
13 
14 // clang-format off
18 HAL_ENUM(HAL_AnalogTriggerType) {
19  HAL_Trigger_kInWindow = 0,
20  HAL_Trigger_kState = 1,
21  HAL_Trigger_kRisingPulse = 2,
22  HAL_Trigger_kFallingPulse = 3
23 };
24 // clang-format on
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
37 HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(
38  HAL_AnalogInputHandle portHandle, int32_t* index, int32_t* status);
39 
45 void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle,
46  int32_t* status);
47 
57 void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
58  int32_t lower, int32_t upper,
59  int32_t* status);
60 
70 void HAL_SetAnalogTriggerLimitsVoltage(
71  HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
72  int32_t* status);
73 
83 void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle,
84  HAL_Bool useAveragedValue, int32_t* status);
85 
97 void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle,
98  HAL_Bool useFilteredValue, int32_t* status);
99 
108 HAL_Bool HAL_GetAnalogTriggerInWindow(
109  HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
110 
121 HAL_Bool HAL_GetAnalogTriggerTriggerState(
122  HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
123 
131 HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle,
132  HAL_AnalogTriggerType type,
133  int32_t* status);
134 #ifdef __cplusplus
135 } // extern "C"
136 #endif