Initial release. Mbed library for VL53L1CB

Embed: (wiki syntax)

« Back to documentation index

BDCMotor Class Reference

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

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:
bridgeIdfrom 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:
bridgeIdfrom 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:
bridgeIdfrom 0 for bridge A to 1 for bridge B.
Return values:
Thefrequency in Hz of the specified bridge input PWM.
virtual unsigned int get_bridge_status ( unsigned  int ) [pure virtual]

Getting the bridge status.

Parameters:
bridgeIdfrom 0 for bridge A to 1 for bridge B.
Return values:
Thestatus.
virtual unsigned int get_device_state ( unsigned  int ) [pure virtual]

Getting the device State.

Parameters:
motorIdfrom 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
Return values:
Thedevice state
virtual unsigned int get_speed ( unsigned  int ) [pure virtual]

Getting the current speed in % of the specified motor.

Parameters:
motorIdfrom 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
Return values:
Thecurrent speed in %.
virtual void hard_hiz ( unsigned  int ) [pure virtual]

Stopping the motor and disabling the power bridge immediately.

Parameters:
motorIdfrom 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:
motorIdfrom 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]initpointer to device specific initalization structure.
Return values:
0in 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]idpointer to an allocated variable to store the ID into.
Return values:
0in case of success, an error code otherwise.

Implemented in VL53L1X.

virtual void run ( unsigned  int,
direction_t   
) [pure virtual]

Running the motor.

Parameters:
motorIdfrom 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
directionThe 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:
bridgeIdfrom 0 for bridge A to 1 for bridge B.
frequencyof 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:
motorIdfrom 0 to (MAX_NUMBER_OF_BRUSH_DC_MOTORS - 1).
speedThe new speed in %.
Return values:
truein case of success, "false" otherwise.