Motor Driver for XRCU.
More...
#include <Motors.h>
|
| | Mtr (const uint32_t pwm_ch, const uint32_t pwm_pin, const uint32_t dir_pin) |
| | Constructor for Mtr objects.
|
| |
|
void | begin () |
| | Activates the motor.
|
| |
|
void | end () |
| | Deactivates the motor and release the occupied resources.
|
| |
| bool | get_reverse_flag () |
| | Gets whether the motor spinning direction is reversed when driving to the motor.
|
| |
| void | set_reverse_flag (bool reverse) |
| | Sets whether the motor spinning direction is reversed when driving to the motor.
|
| |
| int16_t | set_spd (int16_t spd) |
| | Sets the motor to spin at a new speed, and return its motor speed after setting.
|
| |
| int16_t | operator= (const int16_t spd) |
| | Sets the motor to spin at a new speed, and return its motor speed after setting.
|
| |
| int16_t | operator+= (const int16_t spd_inc) |
| | Increases this motor speed by spd_inc.
|
| |
| int16_t | operator-= (const int16_t spd_dec) |
| | Decreases this motor speed by spd_dec.
|
| |
| int16_t | operator++ () |
| | Increases this motor speed by 1.
|
| |
| int16_t | operator-- () |
| | Decreases this motor speed by 1.
|
| |
| int16_t | get_spd () |
| | Gets the motor speed.
|
| |
| | operator int16_t () |
| | Gets the motor speed.
|
| |
|
|
| Supported_actuator () |
| | Creates an object of a supported actuator.
|
| |
|
| Supported_module () |
| | Creates an object of a supported module.
|
| |
Motor Driver for XRCU.
- Author
- YH Choi @ JM9
◆ Mtr()
| Mtr::Mtr |
( |
const uint32_t | pwm_ch, |
|
|
const uint32_t | pwm_pin, |
|
|
const uint32_t | dir_pin ) |
Constructor for Mtr objects.
- Parameters
-
| pwm_ch | the pwm channel |
| pwm_pin | the pwm pin (digital output w/ PWM feature) |
| dir_pin | the direction pin (digital output w/o PWM feature) |
◆ get_reverse_flag()
| bool Mtr::get_reverse_flag |
( |
| ) |
|
Gets whether the motor spinning direction is reversed when driving to the motor.
- Returns
- true if the motor spinning direction is reversed, false otherwise
◆ get_spd()
Gets the motor speed.
- Returns
- the motor speed
◆ operator int16_t()
| Mtr::operator int16_t |
( |
| ) |
|
Gets the motor speed.
- Returns
- the motor speed
◆ operator++()
| int16_t Mtr::operator++ |
( |
| ) |
|
Increases this motor speed by 1.
- Returns
- the final motor speed
◆ operator+=()
| int16_t Mtr::operator+= |
( |
const int16_t | spd_inc | ) |
|
Increases this motor speed by spd_inc.
- Parameters
-
| spd_inc | the motor speed to be added to current motor speed |
- Returns
- the final motor speed
◆ operator--()
| int16_t Mtr::operator-- |
( |
| ) |
|
Decreases this motor speed by 1.
- Returns
- the final motor speed
◆ operator-=()
| int16_t Mtr::operator-= |
( |
const int16_t | spd_dec | ) |
|
Decreases this motor speed by spd_dec.
- Parameters
-
| spd_dec | the motor speed to be subtracted from current motor speed |
- Returns
- the final motor speed
◆ operator=()
| int16_t Mtr::operator= |
( |
const int16_t | spd | ) |
|
Sets the motor to spin at a new speed, and return its motor speed after setting.
- Parameters
-
- Returns
- the actual motor speed set to the motor
◆ set_reverse_flag()
| void Mtr::set_reverse_flag |
( |
bool | reverse | ) |
|
Sets whether the motor spinning direction is reversed when driving to the motor.
- Parameters
-
| reverse | true if the motor spinning direction is reversed, false otherwise |
◆ set_spd()
| int16_t Mtr::set_spd |
( |
int16_t | spd | ) |
|
Sets the motor to spin at a new speed, and return its motor speed after setting.
- Parameters
-
- Returns
- the actual motor speed set to the motor
The documentation for this class was generated from the following files:
- Motors/src/Motors.h
- Motors/src/Motors.cpp