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.
Dependents: HelloWorld_IHM04A1
Fork of X_NUCLEO_IHM04A1 by
BDCMotor Class Reference
An abstract class for BDCMotor components. More...
#include <BDCMotor_class.h>
Inherits Component.
Inherited by L6206.
Public Types | |
| enum | direction_t |
Rotation modes. More... | |
Public Member Functions | |
| virtual void | DisableBridge (unsigned int)=0 |
| Disabling the specified bridge. | |
| virtual void | EnableBridge (unsigned int)=0 |
| Enabling the specified bridge. | |
| virtual unsigned int | GetBridgeInputPwmFreq (unsigned int)=0 |
| Getting the PWM frequency of the specified bridge;. | |
| virtual unsigned int | GetBridgeStatus (unsigned int)=0 |
| Getting the bridge status. | |
| virtual motorState_t | GetDeviceState (unsigned int)=0 |
| Getting the device State. | |
| virtual unsigned int | GetSpeed (unsigned int)=0 |
| Getting the current speed in % of the specified motor. | |
| virtual void | HardHiZ (unsigned int)=0 |
| Stopping the motor and disabling the power bridge immediately. | |
| virtual void | HardStop (unsigned int)=0 |
| Stopping the motor immediately. | |
| virtual void | Run (unsigned int, direction_t)=0 |
| Running the motor. | |
| virtual void | SetBridgeInputPwmFreq (unsigned int, unsigned int)=0 |
| Setting the PWM frequency of the specified bridge. | |
| virtual void | SetDualFullBridgeConfig (unsigned int)=0 |
| Setting the dual bridge configuration mode. | |
| virtual bool | SetSpeed (unsigned int, unsigned int)=0 |
| Setting the speed in %. | |
| virtual int | Init (void *init)=0 |
| Initializing the component. | |
| virtual int | ReadID (uint8_t *id)=0 |
| Getting the ID of the component. | |
Detailed Description
An abstract class for BDCMotor components.
Definition at line 55 of file BDCMotor_class.h.
Member Enumeration Documentation
| enum direction_t |
Rotation modes.
Definition at line 61 of file BDCMotor_class.h.
Member Function Documentation
| virtual void DisableBridge | ( | unsigned | int ) | [pure virtual] |
Disabling the specified bridge.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B.
- Return values:
-
None.
Implemented in L6206.
| virtual void EnableBridge | ( | unsigned | int ) | [pure virtual] |
Enabling the specified bridge.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B
- Return values:
-
None.
Implemented in L6206.
| virtual unsigned int GetBridgeInputPwmFreq | ( | 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.
Implemented in L6206.
| virtual unsigned int GetBridgeStatus | ( | unsigned | int ) | [pure virtual] |
Getting the bridge status.
- Parameters:
-
bridgeId from 0 for bridge A to 1 for bridge B.
- Return values:
-
The status.
Implemented in L6206.
| virtual motorState_t GetDeviceState | ( | 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
Implemented in L6206.
| virtual unsigned int GetSpeed | ( | 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 %.
Implemented in L6206.
| virtual void HardHiZ | ( | 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.
Implemented in L6206.
| virtual void HardStop | ( | unsigned | int ) | [pure virtual] |
Stopping the motor immediately.
- Parameters:
-
motorId from 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
- Return values:
-
None.
Implemented in L6206.
| 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 L6206.
| virtual int ReadID | ( | 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 L6206.
| 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.
Implemented in L6206.
| virtual void SetBridgeInputPwmFreq | ( | 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.
Implemented in L6206.
| virtual void SetDualFullBridgeConfig | ( | unsigned | int ) | [pure virtual] |
Setting the dual bridge configuration mode.
- Parameters:
-
configuration. The bridge configuration.
- Return values:
-
None.
Implemented in L6206.
| virtual bool SetSpeed | ( | 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.
Implemented in L6206.
Generated on Sat Jul 16 2022 00:03:02 by
1.7.2
