WPILibC++  2020.3.2
DutyCycle.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2019 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 "hal/AnalogTrigger.h"
11 #include "hal/Types.h"
12 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
32 HAL_DutyCycleHandle HAL_InitializeDutyCycle(HAL_Handle digitalSourceHandle,
33  HAL_AnalogTriggerType triggerType,
34  int32_t* status);
35 
41 void HAL_FreeDutyCycle(HAL_DutyCycleHandle dutyCycleHandle);
42 
49 void HAL_SetDutyCycleSimDevice(HAL_DutyCycleHandle handle,
50  HAL_SimDeviceHandle device);
51 
58 int32_t HAL_GetDutyCycleFrequency(HAL_DutyCycleHandle dutyCycleHandle,
59  int32_t* status);
60 
69 double HAL_GetDutyCycleOutput(HAL_DutyCycleHandle dutyCycleHandle,
70  int32_t* status);
71 
81 int32_t HAL_GetDutyCycleOutputRaw(HAL_DutyCycleHandle dutyCycleHandle,
82  int32_t* status);
83 
94 int32_t HAL_GetDutyCycleOutputScaleFactor(HAL_DutyCycleHandle dutyCycleHandle,
95  int32_t* status);
96 
103 int32_t HAL_GetDutyCycleFPGAIndex(HAL_DutyCycleHandle dutyCycleHandle,
104  int32_t* status);
105 
106 #ifdef __cplusplus
107 } // extern "C"
108 #endif
109 
HAL_FreeDutyCycle
void HAL_FreeDutyCycle(HAL_DutyCycleHandle dutyCycleHandle)
Free a DutyCycle.
HAL_GetDutyCycleOutputScaleFactor
int32_t HAL_GetDutyCycleOutputScaleFactor(HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
Get the scale factor of the output.
HAL_GetDutyCycleFPGAIndex
int32_t HAL_GetDutyCycleFPGAIndex(HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
Get the FPGA index for the DutyCycle.
HAL_GetDutyCycleOutputRaw
int32_t HAL_GetDutyCycleOutputRaw(HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
Get the raw output ratio of the duty cycle signal.
HAL_InitializeDutyCycle
HAL_DutyCycleHandle HAL_InitializeDutyCycle(HAL_Handle digitalSourceHandle, HAL_AnalogTriggerType triggerType, int32_t *status)
Initialize a DutyCycle input.
HAL_SetDutyCycleSimDevice
void HAL_SetDutyCycleSimDevice(HAL_DutyCycleHandle handle, HAL_SimDeviceHandle device)
Indicates the duty cycle is used by a simulated device.
HAL_GetDutyCycleFrequency
int32_t HAL_GetDutyCycleFrequency(HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
Get the frequency of the duty cycle signal.
HAL_GetDutyCycleOutput
double HAL_GetDutyCycleOutput(HAL_DutyCycleHandle dutyCycleHandle, int32_t *status)
Get the output ratio of the duty cycle signal.