mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51: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
@@ -166,14 +166,6 @@ HAL_Bool HAL_GetPWMEliminateDeadband(HAL_DigitalHandle pwmPortHandle,
|
||||
return port->eliminateDeadband;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a PWM channel to the desired value. The values range from 0 to 255 and
|
||||
* the period is controlled
|
||||
* by the PWM Period and MinHigh registers.
|
||||
*
|
||||
* @param channel The PWM channel to set.
|
||||
* @param value The PWM value to set.
|
||||
*/
|
||||
void HAL_SetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t value,
|
||||
int32_t* status) {
|
||||
auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
|
||||
@@ -185,15 +177,6 @@ void HAL_SetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t value,
|
||||
SimPWMData[port->channel].SetRawValue(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a PWM channel to the desired scaled value. The values range from -1 to 1
|
||||
* and
|
||||
* the period is controlled
|
||||
* by the PWM Period and MinHigh registers.
|
||||
*
|
||||
* @param channel The PWM channel to set.
|
||||
* @param value The scaled PWM value to set.
|
||||
*/
|
||||
void HAL_SetPWMSpeed(HAL_DigitalHandle pwmPortHandle, double speed,
|
||||
int32_t* status) {
|
||||
auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
|
||||
@@ -215,15 +198,6 @@ void HAL_SetPWMSpeed(HAL_DigitalHandle pwmPortHandle, double speed,
|
||||
SimPWMData[port->channel].SetSpeed(speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a PWM channel to the desired position value. The values range from 0 to 1
|
||||
* and
|
||||
* the period is controlled
|
||||
* by the PWM Period and MinHigh registers.
|
||||
*
|
||||
* @param channel The PWM channel to set.
|
||||
* @param value The scaled PWM value to set.
|
||||
*/
|
||||
void HAL_SetPWMPosition(HAL_DigitalHandle pwmPortHandle, double pos,
|
||||
int32_t* status) {
|
||||
auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
|
||||
@@ -256,12 +230,6 @@ void HAL_SetPWMDisabled(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
|
||||
SimPWMData[port->channel].SetSpeed(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a value from a PWM channel. The values range from 0 to 255.
|
||||
*
|
||||
* @param channel The PWM channel to read from.
|
||||
* @return The raw PWM value.
|
||||
*/
|
||||
int32_t HAL_GetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
|
||||
auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
|
||||
if (port == nullptr) {
|
||||
@@ -272,12 +240,6 @@ int32_t HAL_GetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
|
||||
return SimPWMData[port->channel].GetRawValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a scaled value from a PWM channel. The values range from -1 to 1.
|
||||
*
|
||||
* @param channel The PWM channel to read from.
|
||||
* @return The scaled PWM value.
|
||||
*/
|
||||
double HAL_GetPWMSpeed(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
|
||||
auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
|
||||
if (port == nullptr) {
|
||||
@@ -295,12 +257,6 @@ double HAL_GetPWMSpeed(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
|
||||
return speed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a position value from a PWM channel. The values range from 0 to 1.
|
||||
*
|
||||
* @param channel The PWM channel to read from.
|
||||
* @return The scaled PWM value.
|
||||
*/
|
||||
double HAL_GetPWMPosition(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
|
||||
auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
|
||||
if (port == nullptr) {
|
||||
@@ -329,12 +285,6 @@ void HAL_LatchPWMZero(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
|
||||
SimPWMData[port->channel].SetZeroLatch(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set how how often the PWM signal is squelched, thus scaling the period.
|
||||
*
|
||||
* @param channel The PWM channel to configure.
|
||||
* @param squelchMask The 2-bit mask of outputs to squelch.
|
||||
*/
|
||||
void HAL_SetPWMPeriodScale(HAL_DigitalHandle pwmPortHandle, int32_t squelchMask,
|
||||
int32_t* status) {
|
||||
auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
|
||||
@@ -346,17 +296,7 @@ void HAL_SetPWMPeriodScale(HAL_DigitalHandle pwmPortHandle, int32_t squelchMask,
|
||||
SimPWMData[port->channel].SetPeriodScale(squelchMask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the loop timing of the PWM system
|
||||
*
|
||||
* @return The loop time
|
||||
*/
|
||||
int32_t HAL_GetPWMLoopTiming(int32_t* status) { return kExpectedLoopTiming; }
|
||||
|
||||
/**
|
||||
* Get the pwm starting cycle time
|
||||
*
|
||||
* @return The pwm cycle start time.
|
||||
*/
|
||||
uint64_t HAL_GetPWMCycleStartTime(int32_t* status) { return 0; }
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user