12 #include "HAL/AnalogTrigger.h"
13 #include "HAL/Types.h"
15 enum HAL_Counter_Mode : int32_t {
16 HAL_Counter_kTwoPulse = 0,
17 HAL_Counter_kSemiperiod = 1,
18 HAL_Counter_kPulseLength = 2,
19 HAL_Counter_kExternalDirection = 3
25 HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index,
27 void HAL_FreeCounter(HAL_CounterHandle counterHandle, int32_t* status);
28 void HAL_SetCounterAverageSize(HAL_CounterHandle counterHandle, int32_t size,
30 void HAL_SetCounterUpSource(HAL_CounterHandle counterHandle,
31 HAL_Handle digitalSourceHandle,
32 HAL_AnalogTriggerType analogTriggerType,
34 void HAL_SetCounterUpSourceEdge(HAL_CounterHandle counterHandle,
35 HAL_Bool risingEdge, HAL_Bool fallingEdge,
37 void HAL_ClearCounterUpSource(HAL_CounterHandle counterHandle, int32_t* status);
38 void HAL_SetCounterDownSource(HAL_CounterHandle counterHandle,
39 HAL_Handle digitalSourceHandle,
40 HAL_AnalogTriggerType analogTriggerType,
42 void HAL_SetCounterDownSourceEdge(HAL_CounterHandle counterHandle,
43 HAL_Bool risingEdge, HAL_Bool fallingEdge,
45 void HAL_ClearCounterDownSource(HAL_CounterHandle counterHandle,
47 void HAL_SetCounterUpDownMode(HAL_CounterHandle counterHandle, int32_t* status);
48 void HAL_SetCounterExternalDirectionMode(HAL_CounterHandle counterHandle,
50 void HAL_SetCounterSemiPeriodMode(HAL_CounterHandle counterHandle,
51 HAL_Bool highSemiPeriod, int32_t* status);
52 void HAL_SetCounterPulseLengthMode(HAL_CounterHandle counterHandle,
53 double threshold, int32_t* status);
54 int32_t HAL_GetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
56 void HAL_SetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
57 int32_t samplesToAverage, int32_t* status);
58 void HAL_ResetCounter(HAL_CounterHandle counterHandle, int32_t* status);
59 int32_t HAL_GetCounter(HAL_CounterHandle counterHandle, int32_t* status);
60 double HAL_GetCounterPeriod(HAL_CounterHandle counterHandle, int32_t* status);
61 void HAL_SetCounterMaxPeriod(HAL_CounterHandle counterHandle,
double maxPeriod,
63 void HAL_SetCounterUpdateWhenEmpty(HAL_CounterHandle counterHandle,
64 HAL_Bool enabled, int32_t* status);
65 HAL_Bool HAL_GetCounterStopped(HAL_CounterHandle counterHandle,
67 HAL_Bool HAL_GetCounterDirection(HAL_CounterHandle counterHandle,
69 void HAL_SetCounterReverseDirection(HAL_CounterHandle counterHandle,
70 HAL_Bool reverseDirection, int32_t* status);