12 #include "hal/AnalogTrigger.h"
13 #include "hal/Types.h"
19 HAL_ENUM(HAL_Counter_Mode) {
20 HAL_Counter_kTwoPulse = 0,
21 HAL_Counter_kSemiperiod = 1,
22 HAL_Counter_kPulseLength = 2,
23 HAL_Counter_kExternalDirection = 3
38 HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index,
46 void HAL_FreeCounter(HAL_CounterHandle counterHandle, int32_t* status);
54 void HAL_SetCounterAverageSize(HAL_CounterHandle counterHandle, int32_t size,
66 void HAL_SetCounterUpSource(HAL_CounterHandle counterHandle,
67 HAL_Handle digitalSourceHandle,
68 HAL_AnalogTriggerType analogTriggerType,
80 void HAL_SetCounterUpSourceEdge(HAL_CounterHandle counterHandle,
81 HAL_Bool risingEdge, HAL_Bool fallingEdge,
89 void HAL_ClearCounterUpSource(HAL_CounterHandle counterHandle, int32_t* status);
100 void HAL_SetCounterDownSource(HAL_CounterHandle counterHandle,
101 HAL_Handle digitalSourceHandle,
102 HAL_AnalogTriggerType analogTriggerType,
113 void HAL_SetCounterDownSourceEdge(HAL_CounterHandle counterHandle,
114 HAL_Bool risingEdge, HAL_Bool fallingEdge,
122 void HAL_ClearCounterDownSource(HAL_CounterHandle counterHandle,
132 void HAL_SetCounterUpDownMode(HAL_CounterHandle counterHandle, int32_t* status);
142 void HAL_SetCounterExternalDirectionMode(HAL_CounterHandle counterHandle,
154 void HAL_SetCounterSemiPeriodMode(HAL_CounterHandle counterHandle,
155 HAL_Bool highSemiPeriod, int32_t* status);
167 void HAL_SetCounterPulseLengthMode(HAL_CounterHandle counterHandle,
168 double threshold, int32_t* status);
178 int32_t HAL_GetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
189 void HAL_SetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
190 int32_t samplesToAverage, int32_t* status);
200 void HAL_ResetCounter(HAL_CounterHandle counterHandle, int32_t* status);
211 int32_t HAL_GetCounter(HAL_CounterHandle counterHandle, int32_t* status);
222 double HAL_GetCounterPeriod(HAL_CounterHandle counterHandle, int32_t* status);
235 void HAL_SetCounterMaxPeriod(HAL_CounterHandle counterHandle,
double maxPeriod,
261 void HAL_SetCounterUpdateWhenEmpty(HAL_CounterHandle counterHandle,
262 HAL_Bool enabled, int32_t* status);
275 HAL_Bool HAL_GetCounterStopped(HAL_CounterHandle counterHandle,
284 HAL_Bool HAL_GetCounterDirection(HAL_CounterHandle counterHandle,
296 void HAL_SetCounterReverseDirection(HAL_CounterHandle counterHandle,
297 HAL_Bool reverseDirection, int32_t* status);