blob: 37454d0e9ad792e22bb7c1b66d9a8009d26a21d5 [file] [log] [blame]
Brian Silverman41cdd3e2019-01-19 19:48:58 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) 2017-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#include "hal/Counter.h"
9
10#include "CounterInternal.h"
11#include "HALInitializer.h"
12#include "PortsInternal.h"
13#include "hal/Errors.h"
14#include "hal/handles/HandlesInternal.h"
15#include "hal/handles/LimitedHandleResource.h"
16
17namespace hal {
18
19LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
20 HAL_HandleEnum::Counter>* counterHandles;
21} // namespace hal
22
23namespace hal {
24namespace init {
25void InitializeCounter() {
26 static LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
27 HAL_HandleEnum::Counter>
28 cH;
29 counterHandles = &cH;
30}
31} // namespace init
32} // namespace hal
33
34extern "C" {
35HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index,
36 int32_t* status) {
37 hal::init::CheckInit();
38 return 0;
39}
40void HAL_FreeCounter(HAL_CounterHandle counterHandle, int32_t* status) {}
41void HAL_SetCounterAverageSize(HAL_CounterHandle counterHandle, int32_t size,
42 int32_t* status) {}
43void HAL_SetCounterUpSource(HAL_CounterHandle counterHandle,
44 HAL_Handle digitalSourceHandle,
45 HAL_AnalogTriggerType analogTriggerType,
46 int32_t* status) {}
47void HAL_SetCounterUpSourceEdge(HAL_CounterHandle counterHandle,
48 HAL_Bool risingEdge, HAL_Bool fallingEdge,
49 int32_t* status) {}
50void HAL_ClearCounterUpSource(HAL_CounterHandle counterHandle,
51 int32_t* status) {}
52void HAL_SetCounterDownSource(HAL_CounterHandle counterHandle,
53 HAL_Handle digitalSourceHandle,
54 HAL_AnalogTriggerType analogTriggerType,
55 int32_t* status) {}
56void HAL_SetCounterDownSourceEdge(HAL_CounterHandle counterHandle,
57 HAL_Bool risingEdge, HAL_Bool fallingEdge,
58 int32_t* status) {}
59void HAL_ClearCounterDownSource(HAL_CounterHandle counterHandle,
60 int32_t* status) {}
61void HAL_SetCounterUpDownMode(HAL_CounterHandle counterHandle,
62 int32_t* status) {}
63void HAL_SetCounterExternalDirectionMode(HAL_CounterHandle counterHandle,
64 int32_t* status) {}
65void HAL_SetCounterSemiPeriodMode(HAL_CounterHandle counterHandle,
66 HAL_Bool highSemiPeriod, int32_t* status) {}
67void HAL_SetCounterPulseLengthMode(HAL_CounterHandle counterHandle,
68 double threshold, int32_t* status) {}
69int32_t HAL_GetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
70 int32_t* status) {
71 return 0;
72}
73void HAL_SetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
74 int32_t samplesToAverage, int32_t* status) {
75}
76void HAL_ResetCounter(HAL_CounterHandle counterHandle, int32_t* status) {}
77int32_t HAL_GetCounter(HAL_CounterHandle counterHandle, int32_t* status) {
78 return 0;
79}
80double HAL_GetCounterPeriod(HAL_CounterHandle counterHandle, int32_t* status) {
81 return 0.0;
82}
83void HAL_SetCounterMaxPeriod(HAL_CounterHandle counterHandle, double maxPeriod,
84 int32_t* status) {}
85void HAL_SetCounterUpdateWhenEmpty(HAL_CounterHandle counterHandle,
86 HAL_Bool enabled, int32_t* status) {}
87HAL_Bool HAL_GetCounterStopped(HAL_CounterHandle counterHandle,
88 int32_t* status) {
89 return false;
90}
91HAL_Bool HAL_GetCounterDirection(HAL_CounterHandle counterHandle,
92 int32_t* status) {
93 return false;
94}
95void HAL_SetCounterReverseDirection(HAL_CounterHandle counterHandle,
96 HAL_Bool reverseDirection,
97 int32_t* status) {}
98} // extern "C"