mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Moved C++ comments from source files to headers (#1111)
Also sorted functions in C++ sources to match order in related headers.
This commit is contained in:
committed by
Peter Johnson
parent
d9971a705a
commit
8c680a26f8
@@ -20,12 +20,6 @@ void InitializeAnalogAccumulator() {}
|
||||
|
||||
extern "C" {
|
||||
|
||||
/**
|
||||
* Is the channel attached to an accumulator.
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
* @return The analog channel is attached to an accumulator.
|
||||
*/
|
||||
HAL_Bool HAL_IsAccumulatorChannel(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t* status) {
|
||||
auto port = analogInputHandles->Get(analogPortHandle);
|
||||
@@ -39,11 +33,6 @@ HAL_Bool HAL_IsAccumulatorChannel(HAL_AnalogInputHandle analogPortHandle,
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the accumulator.
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
*/
|
||||
void HAL_InitAccumulator(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t* status) {
|
||||
if (!HAL_IsAccumulatorChannel(analogPortHandle, status)) {
|
||||
@@ -54,11 +43,6 @@ void HAL_InitAccumulator(HAL_AnalogInputHandle analogPortHandle,
|
||||
HAL_ResetAccumulator(analogPortHandle, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the accumulator to the initial value.
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
*/
|
||||
void HAL_ResetAccumulator(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t* status) {
|
||||
auto port = analogInputHandles->Get(analogPortHandle);
|
||||
@@ -73,21 +57,6 @@ void HAL_ResetAccumulator(HAL_AnalogInputHandle analogPortHandle,
|
||||
port->accumulator->strobeReset(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the center value of the accumulator.
|
||||
*
|
||||
* The center value is subtracted from each A/D value before it is added to the
|
||||
* accumulator. This is used for the center value of devices like gyros and
|
||||
* accelerometers to make integration work and to take the device offset into
|
||||
* account when integrating.
|
||||
*
|
||||
* This center value is based on the output of the oversampled and averaged
|
||||
* source from channel 1. Because of this, any non-zero oversample bits will
|
||||
* affect the size of the value for this field.
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
* @param center The center value of the accumulator.
|
||||
*/
|
||||
void HAL_SetAccumulatorCenter(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t center, int32_t* status) {
|
||||
auto port = analogInputHandles->Get(analogPortHandle);
|
||||
@@ -102,12 +71,6 @@ void HAL_SetAccumulatorCenter(HAL_AnalogInputHandle analogPortHandle,
|
||||
port->accumulator->writeCenter(center, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the accumulator's deadband.
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
* @param deadband The deadband of the accumulator.
|
||||
*/
|
||||
void HAL_SetAccumulatorDeadband(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t deadband, int32_t* status) {
|
||||
auto port = analogInputHandles->Get(analogPortHandle);
|
||||
@@ -122,15 +85,6 @@ void HAL_SetAccumulatorDeadband(HAL_AnalogInputHandle analogPortHandle,
|
||||
port->accumulator->writeDeadband(deadband, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the accumulated value.
|
||||
*
|
||||
* Read the value that has been accumulating on channel 1.
|
||||
* The accumulator is attached after the oversample and average engine.
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
* @return The 64-bit value accumulated since the last Reset().
|
||||
*/
|
||||
int64_t HAL_GetAccumulatorValue(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t* status) {
|
||||
auto port = analogInputHandles->Get(analogPortHandle);
|
||||
@@ -146,15 +100,6 @@ int64_t HAL_GetAccumulatorValue(HAL_AnalogInputHandle analogPortHandle,
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the number of accumulated values.
|
||||
*
|
||||
* Read the count of the accumulated values since the accumulator was last
|
||||
* Reset().
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
* @return The number of times samples from the channel were accumulated.
|
||||
*/
|
||||
int64_t HAL_GetAccumulatorCount(HAL_AnalogInputHandle analogPortHandle,
|
||||
int32_t* status) {
|
||||
auto port = analogInputHandles->Get(analogPortHandle);
|
||||
@@ -169,16 +114,6 @@ int64_t HAL_GetAccumulatorCount(HAL_AnalogInputHandle analogPortHandle,
|
||||
return port->accumulator->readOutput_Count(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the accumulated value and the number of accumulated values atomically.
|
||||
*
|
||||
* This function reads the value and count from the FPGA atomically.
|
||||
* This can be used for averaging.
|
||||
*
|
||||
* @param analogPortHandle Handle to the analog port.
|
||||
* @param value Pointer to the 64-bit accumulated output.
|
||||
* @param count Pointer to the number of accumulation cycles.
|
||||
*/
|
||||
void HAL_GetAccumulatorOutput(HAL_AnalogInputHandle analogPortHandle,
|
||||
int64_t* value, int64_t* count, int32_t* status) {
|
||||
auto port = analogInputHandles->Get(analogPortHandle);
|
||||
|
||||
Reference in New Issue
Block a user