blob: 17ef9292e8ba37fda3c7380790eb5a241bb0c438 [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2016-2017. 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
14enum HAL_AnalogTriggerType : int32_t {
15 HAL_Trigger_kInWindow = 0,
16 HAL_Trigger_kState = 1,
17 HAL_Trigger_kRisingPulse = 2,
18 HAL_Trigger_kFallingPulse = 3
19};
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(
25 HAL_AnalogInputHandle portHandle, int32_t* index, int32_t* status);
26void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle,
27 int32_t* status);
28void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
29 int32_t lower, int32_t upper,
30 int32_t* status);
31void HAL_SetAnalogTriggerLimitsVoltage(
32 HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
33 int32_t* status);
34void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle,
35 HAL_Bool useAveragedValue, int32_t* status);
36void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle,
37 HAL_Bool useFilteredValue, int32_t* status);
38HAL_Bool HAL_GetAnalogTriggerInWindow(
39 HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
40HAL_Bool HAL_GetAnalogTriggerTriggerState(
41 HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
42HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle,
43 HAL_AnalogTriggerType type,
44 int32_t* status);
45#ifdef __cplusplus
46}
47#endif