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:
Tyler Veness
2018-05-31 20:47:15 -07:00
committed by Peter Johnson
parent d9971a705a
commit 8c680a26f8
234 changed files with 9936 additions and 9309 deletions

View File

@@ -23,16 +23,98 @@ namespace frc {
*/
class DigitalOutput : public ErrorBase, public SendableBase {
public:
/**
* Create an instance of a digital output.
*
* Create a digital output given a channel.
*
* @param channel The digital channel 0-9 are on-board, 10-25 are on the MXP
* port
*/
explicit DigitalOutput(int channel);
~DigitalOutput() override;
/**
* Set the value of a digital output.
*
* Set the value of a digital output to either one (true) or zero (false).
*
* @param value 1 (true) for high, 0 (false) for disabled
*/
void Set(bool value);
/**
* Gets the value being output from the Digital Output.
*
* @return the state of the digital output.
*/
bool Get() const;
/**
* @return The GPIO channel number that this object represents.
*/
int GetChannel() const;
/**
* Output a single pulse on the digital output line.
*
* Send a single pulse on the digital output line where the pulse duration is
* specified in seconds. Maximum pulse length is 0.0016 seconds.
*
* @param length The pulse length in seconds
*/
void Pulse(double length);
/**
* Determine if the pulse is still going.
*
* Determine if a previously started pulse is still going.
*/
bool IsPulsing() const;
/**
* Change the PWM frequency of the PWM output on a Digital Output line.
*
* The valid range is from 0.6 Hz to 19 kHz. The frequency resolution is
* logarithmic.
*
* There is only one PWM frequency for all digital channels.
*
* @param rate The frequency to output all digital output PWM signals.
*/
void SetPWMRate(double rate);
/**
* Enable a PWM Output on this line.
*
* Allocate one of the 6 DO PWM generator resources from this module.
*
* Supply the initial duty-cycle to output so as to avoid a glitch when first
* starting.
*
* The resolution of the duty cycle is 8-bit for low frequencies (1kHz or
* less) but is reduced the higher the frequency of the PWM signal is.
*
* @param initialDutyCycle The duty-cycle to start generating. [0..1]
*/
void EnablePWM(double initialDutyCycle);
/**
* Change this line from a PWM output back to a static Digital Output line.
*
* Free up one of the 6 DO PWM generator resources that were in use.
*/
void DisablePWM();
/**
* Change the duty-cycle that is being generated on the line.
*
* The resolution of the duty cycle is 8-bit for low frequencies (1kHz or
* less) but is reduced the higher the frequency of the PWM signal is.
*
* @param dutyCycle The duty-cycle to change to. [0..1]
*/
void UpdateDutyCycle(double dutyCycle);
void InitSendable(SendableBuilder& builder) override;