WPILibC++ 2024.3.2
AnalogInput.h File Reference
#include <stdint.h>
#include "hal/Types.h"

Go to the source code of this file.

Functions

HAL_AnalogInputHandle HAL_InitializeAnalogInputPort (HAL_PortHandle portHandle, const char *allocationLocation, int32_t *status)
 Initializes the analog input port using the given port object. More...
 
void HAL_FreeAnalogInputPort (HAL_AnalogInputHandle analogPortHandle)
 Frees an analog input port. More...
 
HAL_Bool HAL_CheckAnalogModule (int32_t module)
 Checks that the analog module number is valid. More...
 
HAL_Bool HAL_CheckAnalogInputChannel (int32_t channel)
 Checks that the analog output channel number is valid. More...
 
void HAL_SetAnalogInputSimDevice (HAL_AnalogInputHandle handle, HAL_SimDeviceHandle device)
 Indicates the analog input is used by a simulated device. More...
 
void HAL_SetAnalogSampleRate (double samplesPerSecond, int32_t *status)
 Sets the sample rate. More...
 
double HAL_GetAnalogSampleRate (int32_t *status)
 Gets the current sample rate. More...
 
void HAL_SetAnalogAverageBits (HAL_AnalogInputHandle analogPortHandle, int32_t bits, int32_t *status)
 Sets the number of averaging bits. More...
 
int32_t HAL_GetAnalogAverageBits (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets the number of averaging bits. More...
 
void HAL_SetAnalogOversampleBits (HAL_AnalogInputHandle analogPortHandle, int32_t bits, int32_t *status)
 Sets the number of oversample bits. More...
 
int32_t HAL_GetAnalogOversampleBits (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets the number of oversample bits. More...
 
int32_t HAL_GetAnalogValue (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets a sample straight from the channel on this module. More...
 
int32_t HAL_GetAnalogAverageValue (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets a sample from the output of the oversample and average engine for the channel. More...
 
int32_t HAL_GetAnalogVoltsToValue (HAL_AnalogInputHandle analogPortHandle, double voltage, int32_t *status)
 Converts a voltage to a raw value for a specified channel. More...
 
double HAL_GetAnalogVoltage (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets a scaled sample straight from the channel on this module. More...
 
double HAL_GetAnalogAverageVoltage (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets a scaled sample from the output of the oversample and average engine for the channel. More...
 
int32_t HAL_GetAnalogLSBWeight (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets the factory scaling least significant bit weight constant. More...
 
int32_t HAL_GetAnalogOffset (HAL_AnalogInputHandle analogPortHandle, int32_t *status)
 Gets the factory scaling offset constant. More...
 
double HAL_GetAnalogValueToVolts (HAL_AnalogInputHandle analogPortHandle, int32_t rawValue, int32_t *status)
 Get the analog voltage from a raw value. More...