WPILibC++  2018.4.1-20180729040223-1137-g011f0ff
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
DIO.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 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
25 HAL_DigitalHandle HAL_InitializeDIOPort(HAL_PortHandle portHandle,
26  HAL_Bool input, int32_t* status);
27 
34 HAL_Bool HAL_CheckDIOChannel(int32_t channel);
35 
36 void HAL_FreeDIOPort(HAL_DigitalHandle dioPortHandle);
37 
43 HAL_DigitalPWMHandle HAL_AllocateDigitalPWM(int32_t* status);
44 
50 void HAL_FreeDigitalPWM(HAL_DigitalPWMHandle pwmGenerator, int32_t* status);
51 
61 void HAL_SetDigitalPWMRate(double rate, int32_t* status);
62 
69 void HAL_SetDigitalPWMDutyCycle(HAL_DigitalPWMHandle pwmGenerator,
70  double dutyCycle, int32_t* status);
71 
78 void HAL_SetDigitalPWMOutputChannel(HAL_DigitalPWMHandle pwmGenerator,
79  int32_t channel, int32_t* status);
80 
88 void HAL_SetDIO(HAL_DigitalHandle dioPortHandle, HAL_Bool value,
89  int32_t* status);
90 
97 void HAL_SetDIODirection(HAL_DigitalHandle dioPortHandle, HAL_Bool input,
98  int32_t* status);
99 
106 HAL_Bool HAL_GetDIO(HAL_DigitalHandle dioPortHandle, int32_t* status);
107 
114 HAL_Bool HAL_GetDIODirection(HAL_DigitalHandle dioPortHandle, int32_t* status);
115 
125 void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLength,
126  int32_t* status);
127 
133 HAL_Bool HAL_IsPulsing(HAL_DigitalHandle dioPortHandle, int32_t* status);
134 
140 HAL_Bool HAL_IsAnyPulsing(int32_t* status);
141 
151 void HAL_SetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t filterIndex,
152  int32_t* status);
153 
163 int32_t HAL_GetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t* status);
164 
176 void HAL_SetFilterPeriod(int32_t filterIndex, int64_t value, int32_t* status);
177 
190 int64_t HAL_GetFilterPeriod(int32_t filterIndex, int32_t* status);
191 #ifdef __cplusplus
192 } // extern "C"
193 #endif