Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BDCMotor Class Reference
An abstract class for BDCMotor components. More...
#include <BDCMotor.h>
Inherits Component.
Public Types | |
| enum | direction_t |
Rotation modes. More... | |
Public Member Functions | |
| virtual void | disable_bridge (unsigned int)=0 |
| Disabling the specified bridge. | |
| virtual void | enable_bridge (unsigned int)=0 |
| Enabling the specified bridge. | |
| virtual unsigned int | get_bridge_input_pwm_freq (unsigned int)=0 |
| Getting the PWM frequency of the specified bridge;. | |
| virtual unsigned int | get_bridge_status (unsigned int)=0 |
| Getting the bridge status. | |
| virtual unsigned int | get_device_state (unsigned int)=0 |
| Getting the device State. | |
| virtual unsigned int | get_speed (unsigned int)=0 |
| Getting the current speed in % of the specified motor. | |
| virtual void | hard_hiz (unsigned int)=0 |
| Stopping the motor and disabling the power bridge immediately. | |
| virtual void | hard_stop (unsigned int)=0 |
| Stopping the motor immediately. | |
| virtual void | run (unsigned int, direction_t)=0 |
| Running the motor. | |
| virtual void | set_bridge_input_pwm_freq (unsigned int, unsigned int)=0 |
| Setting the PWM frequency of the specified bridge. | |
| virtual void | set_dual_full_bridge_config (unsigned int)=0 |
| Setting the dual bridge configuration mode. | |
| virtual bool | set_speed (unsigned int, unsigned int)=0 |
| Setting the speed in %. | |
| virtual | ~BDCMotor () |
| Destructor. | |
| virtual int | init (void *init)=0 |
| Initializing the component. | |
| virtual int | read_id (uint8_t *id)=0 |
| Getting the ID of the component. | |
Detailed Description
An abstract class for BDCMotor components.
Definition at line 56 of file BDCMotor.h.
Member Enumeration Documentation
| enum direction_t |
Rotation modes.
Definition at line 62 of file BDCMotor.h.
Constructor & Destructor Documentation
| virtual ~BDCMotor | ( | ) | [virtual] |
Destructor.
Definition at line 157 of file BDCMotor.h.
Member Function Documentation
| virtual void disable_bridge | ( | unsigned | int ) | [pure virtual] |
Disabling the specified bridge.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B.
- Return values:
-
None.
| virtual void enable_bridge | ( | unsigned | int ) | [pure virtual] |
Enabling the specified bridge.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B
- Return values:
-
None.
| virtual unsigned int get_bridge_input_pwm_freq | ( | unsigned | int ) | [pure virtual] |
Getting the PWM frequency of the specified bridge;.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B.
- Return values:
-
The frequency in Hz of the specified bridge input PWM.
| virtual unsigned int get_bridge_status | ( | unsigned | int ) | [pure virtual] |
Getting the bridge status.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B.
- Return values:
-
The status.
| virtual unsigned int get_device_state | ( | unsigned | int ) | [pure virtual] |
Getting the device State.
- Parameters:
-
motorId from 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
- Return values:
-
The device state
| virtual unsigned int get_speed | ( | unsigned | int ) | [pure virtual] |
Getting the current speed in % of the specified motor.
- Parameters:
-
motorId from 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
- Return values:
-
The current speed in %.
| virtual void hard_hiz | ( | unsigned | int ) | [pure virtual] |
Stopping the motor and disabling the power bridge immediately.
- Parameters:
-
motorId from 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
- Return values:
-
None.
| virtual void hard_stop | ( | unsigned | int ) | [pure virtual] |
Stopping the motor immediately.
- Parameters:
-
motorId from 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
- Return values:
-
None.
| virtual int init | ( | void * | init ) | [pure virtual, inherited] |
Initializing the component.
- Parameters:
-
[in] init pointer to device specific initalization structure.
- Return values:
-
0 in case of success, an error code otherwise.
Implemented in VL53L1X.
| virtual int read_id | ( | uint8_t * | id ) | [pure virtual, inherited] |
Getting the ID of the component.
- Parameters:
-
[out] id pointer to an allocated variable to store the ID into.
- Return values:
-
0 in case of success, an error code otherwise.
Implemented in VL53L1X.
| virtual void run | ( | unsigned | int, |
| direction_t | |||
| ) | [pure virtual] |
Running the motor.
- Parameters:
-
motorId from 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1). direction The direction of rotation.
- Return values:
-
None.
| virtual void set_bridge_input_pwm_freq | ( | unsigned | int, |
| unsigned | int | ||
| ) | [pure virtual] |
Setting the PWM frequency of the specified bridge.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B. frequency of the PWM in Hz
- Return values:
-
None.
| virtual void set_dual_full_bridge_config | ( | unsigned | int ) | [pure virtual] |
Setting the dual bridge configuration mode.
- Parameters:
-
configuration. The bridge configuration.
- Return values:
-
None.
| virtual bool set_speed | ( | unsigned | int, |
| unsigned | int | ||
| ) | [pure virtual] |
Setting the speed in %.
- Parameters:
-
motorId from 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1). speed The new speed in %.
- Return values:
-
true in case of success, "false" otherwise.
Generated on Tue Jul 12 2022 20:07:15 by
1.7.2