mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 01:11:10 +03:00
docs: header files for sensors starting with [a] reviewed.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
de49bb0e42
commit
9db2d57de3
@ -52,16 +52,16 @@ namespace upm {
|
||||
* @web http://www.adafruit.com/products/1438
|
||||
* @con i2c
|
||||
*
|
||||
* @brief API for the ADAFRUITMS1438 motor shield
|
||||
* @brief API for the AdafruitMS1438 Motor Shield
|
||||
*
|
||||
* This class implements support for the stepper and DC motors that
|
||||
* can be connected to this Motor Shield.
|
||||
* NOTE: The two servo connections are not actually controlled by
|
||||
* the pca9685 controller (or this class), rather they are connected
|
||||
* directly to digital PWM pins 9 and 10 on the arduino breakout.
|
||||
* Note: the two servo connections are not controlled by the PCA9685
|
||||
* controller (or this class). They are connected directly to digital
|
||||
* PWM pins 9 and 10 on the Arduino breakout board.
|
||||
*
|
||||
* @image html adafruitms1438.jpg
|
||||
* An example using a DC motor conected to M3
|
||||
* An example using a DC motor connected to M3
|
||||
* @snippet adafruitms1438.cxx Interesting
|
||||
* An example using a stepper motor connected to M1 & M2
|
||||
* @snippet adafruitms1438-stepper.cxx Interesting
|
||||
@ -89,7 +89,7 @@ namespace upm {
|
||||
} DCMOTORS_T;
|
||||
|
||||
/**
|
||||
* Enum to specify a Stepper motor
|
||||
* Enum to specify a stepper motor
|
||||
*/
|
||||
typedef enum {
|
||||
STEPMOTOR_M12 = 0,
|
||||
@ -99,62 +99,62 @@ namespace upm {
|
||||
/**
|
||||
* AdafruitMS1438 constructor
|
||||
*
|
||||
* @param bus i2c bus to use
|
||||
* @param address the address for this sensor
|
||||
* @param bus I2C bus to use
|
||||
* @param address Address for this sensor
|
||||
*/
|
||||
AdafruitMS1438(int bus, uint8_t address = ADAFRUITMS1438_DEFAULT_I2C_ADDR);
|
||||
|
||||
/**
|
||||
* AdafruitMS1438 Destructor
|
||||
* AdafruitMS1438 destructor
|
||||
*/
|
||||
~AdafruitMS1438();
|
||||
|
||||
/**
|
||||
* Return the number of milliseconds elapsed since initClock(...)
|
||||
* Returns the number of milliseconds elapsed since initClock(...)
|
||||
* was last called.
|
||||
*
|
||||
* @return elapsed milliseconds
|
||||
* @return Elapsed milliseconds
|
||||
*/
|
||||
uint32_t getMillis(STEPMOTORS_T motor);
|
||||
|
||||
/**
|
||||
* Reset the Clock
|
||||
* Resets the clock
|
||||
*
|
||||
*/
|
||||
void initClock(STEPMOTORS_T motor);
|
||||
|
||||
/**
|
||||
* Set the PWM period. Note this applies to all PWM channels.
|
||||
* Sets the PWM period. Note: this applies to all PWM channels.
|
||||
*
|
||||
* @param hz set the PWM period
|
||||
* @param hz Sets the PWM period
|
||||
*/
|
||||
void setPWMPeriod(float hz);
|
||||
|
||||
/**
|
||||
* enable PWM output for a motor
|
||||
* Enables PWM output for a motor
|
||||
*
|
||||
* @param motor the DC motor to enable
|
||||
* @param motor DC motor to enable
|
||||
*/
|
||||
void enableMotor(DCMOTORS_T motor);
|
||||
|
||||
/**
|
||||
* disable PWM output for a motor
|
||||
* Disables PWM output for a motor
|
||||
*
|
||||
* @param motor the DC motor to disable
|
||||
* @param motor DC motor to disable
|
||||
*/
|
||||
void disableMotor(DCMOTORS_T motor);
|
||||
|
||||
/**
|
||||
* enable output for a stepper motor
|
||||
* Enables output for a stepper motor
|
||||
*
|
||||
* @param motor the stepper motor to enable
|
||||
* @param motor Stepper motor to enable
|
||||
*/
|
||||
void enableStepper(STEPMOTORS_T motor);
|
||||
|
||||
/**
|
||||
* disable output for a stepper motor
|
||||
* Disable output for a stepper motor
|
||||
*
|
||||
* @param motor the stepper motor to disable
|
||||
* @param motor Stepper motor to disable
|
||||
*/
|
||||
void disableStepper(STEPMOTORS_T motor);
|
||||
|
||||
@ -168,57 +168,57 @@ namespace upm {
|
||||
void setMotorSpeed(DCMOTORS_T motor, int speed);
|
||||
|
||||
/**
|
||||
* set the speed of a stepper in revolution per minute (RPM)
|
||||
* Sets the speed of a stepper in revolutions per minute (RPM)
|
||||
*
|
||||
* @param motor the DC motor to configure
|
||||
* @param speed speed to set the motor to
|
||||
* @param motor DC motor to configure
|
||||
* @param speed Speed to set the motor to
|
||||
*/
|
||||
void setStepperSpeed(STEPMOTORS_T motor, int speed);
|
||||
|
||||
/**
|
||||
* set the direction of a DC motor, clockwise or counter clockwise
|
||||
* Sets the direction of a DC motor, clockwise or counterclockwise
|
||||
*
|
||||
* @param motor the DC motor to configure
|
||||
* @param dir direction to set the motor to
|
||||
* @param motor DC motor to configure
|
||||
* @param dir Direction to set the motor in
|
||||
*/
|
||||
void setMotorDirection(DCMOTORS_T motor, DIRECTION_T dir);
|
||||
|
||||
/**
|
||||
* set the direction of a stepper motor, clockwise or counter clockwise
|
||||
* Sets the direction of a stepper motor, clockwise or counterclockwise
|
||||
*
|
||||
* @param motor the stepper motor to configure
|
||||
* @param dir direction to set the motor to
|
||||
* @param motor Stepper motor to configure
|
||||
* @param dir Direction to set the motor in
|
||||
*/
|
||||
void setStepperDirection(STEPMOTORS_T motor, DIRECTION_T dir);
|
||||
|
||||
/**
|
||||
* set a stepper motor configuration
|
||||
* Sets a stepper motor configuration
|
||||
*
|
||||
* @param motor the stepper motor to configure
|
||||
* @param stepsPerRev the number of step to complete a full revolution
|
||||
* @param motor Stepper motor to configure
|
||||
* @param stepsPerRev Number of steps to complete a full revolution
|
||||
*/
|
||||
void stepConfig(STEPMOTORS_T motor, unsigned int stepsPerRev);
|
||||
|
||||
/**
|
||||
* step a stepper motor a specified number of steps
|
||||
* Steps a stepper motor a specified number of steps
|
||||
*
|
||||
* @param motor the stepper motor to step
|
||||
* @param steps number of steps to move the stepper motor
|
||||
* @param motor Stepper motor to step
|
||||
* @param steps Number of steps to move the stepper motor
|
||||
*/
|
||||
void stepperSteps(STEPMOTORS_T motor, unsigned int steps);
|
||||
|
||||
private:
|
||||
// SWIG will generate warning for these 'nested structs', however
|
||||
// those can be ignored as these structs are never exposed.
|
||||
// SWIG will generate a warning for these 'nested structs'; however,
|
||||
// it can be ignored as these structs are never exposed.
|
||||
|
||||
// struct to hold mappings of the dc motors
|
||||
// struct to hold mappings of DC motors
|
||||
typedef struct {
|
||||
int pwm;
|
||||
int in1;
|
||||
int in2;
|
||||
} DC_PINMAP_T;
|
||||
|
||||
// struct to hold mappings of the stepper motors
|
||||
// struct to hold mappings of stepper motors
|
||||
typedef struct {
|
||||
int pwmA;
|
||||
int in1A;
|
||||
@ -228,7 +228,7 @@ namespace upm {
|
||||
int in2B;
|
||||
} STEPPER_PINMAP_T;
|
||||
|
||||
// struct to hold some information about each stepper
|
||||
// struct to hold information about each stepper
|
||||
typedef struct {
|
||||
int stepsPerRev; // steps per revolution
|
||||
int currentStep; // current step number
|
||||
|
Reference in New Issue
Block a user