WPILibC++  2018.4.1-20180821013237-1172-g8d8f120
 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 
20 // clang-format off
24 HAL_ENUM(HAL_AnalogTriggerType) {
25  HAL_Trigger_kInWindow = 0,
26  HAL_Trigger_kState = 1,
27  HAL_Trigger_kRisingPulse = 2,
28  HAL_Trigger_kFallingPulse = 3
29 };
30 // clang-format on
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
43 HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(
44  HAL_AnalogInputHandle portHandle, int32_t* index, int32_t* status);
45 
51 void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle,
52  int32_t* status);
53 
63 void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
64  int32_t lower, int32_t upper,
65  int32_t* status);
66 
77  HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
78  int32_t* status);
79 
89 void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle,
90  HAL_Bool useAveragedValue, int32_t* status);
91 
103 void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle,
104  HAL_Bool useFilteredValue, int32_t* status);
105 
115  HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
116 
128  HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
129 
137 HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle,
138  HAL_AnalogTriggerType type,
139  int32_t* status);
140 #ifdef __cplusplus
141 } // extern "C"
142 #endif
143 
HAL_Bool HAL_GetAnalogTriggerInWindow(HAL_AnalogTriggerHandle analogTriggerHandle, int32_t *status)
Returns the InWindow output of the analog trigger.
HAL_Bool HAL_GetAnalogTriggerTriggerState(HAL_AnalogTriggerHandle analogTriggerHandle, int32_t *status)
Returns the TriggerState output of the analog trigger.
void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle, int32_t lower, int32_t upper, int32_t *status)
Sets the raw ADC upper and lower limits of the analog trigger.
void HAL_SetAnalogTriggerLimitsVoltage(HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper, int32_t *status)
Sets the upper and lower limits of the analog trigger.
HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(HAL_AnalogInputHandle portHandle, int32_t *index, int32_t *status)
Initializes an analog trigger.
HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle, HAL_AnalogTriggerType type, int32_t *status)
Gets the state of the analog trigger output.
void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle, HAL_Bool useAveragedValue, int32_t *status)
Configures the analog trigger to use the averaged vs.
void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle, HAL_Bool useFilteredValue, int32_t *status)
Configures the analog trigger to use a filtered value.
HAL_ENUM(HAL_AnalogTriggerType)
The type of analog trigger to trigger on.
Definition: AnalogTrigger.h:24
void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle, int32_t *status)
Frees an analog trigger.