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.
Fork of X_NUCLEO_IHM04A1 by
L6206 Private Constants
Data Structures | |
| class | L6206 |
| Class representing a L6206 component. More... | |
Functions | |
| virtual | ~L6206 (void) |
| Destructor. | |
| virtual int | Init (void *init=NULL) |
| Initializing the component. | |
| virtual int | ReadID (uint8_t *id=NULL) |
| Getting the ID of the component. | |
| virtual void | AttachErrorHandler (void(*callback)(uint16_t error)) |
| Attaches a user callback to the error Handler. | |
| virtual void | AttachFlagInterrupt (void(*callback)(void)) |
| Attaches a user callback to the flag Interrupt The call back will be then called each time the status flag pin will be pulled down due to the occurrence of a programmed alarms ( OCD, thermal alert) | |
| virtual unsigned int | GetSpeed (unsigned int motorId) |
| Returns the current speed of the specified motor. | |
| virtual motorState_t | GetDeviceState (unsigned int motorId) |
| Returns the device state. | |
| virtual uint8_t | GetFwVersion (void) |
| Returns the FW version of the library. | |
| virtual uint16_t | GetMaxSpeed (unsigned int motorId) |
| Returns the max speed of the specified motor. | |
| virtual void | HardStop (unsigned int motorId) |
| Stops the motor without disabling the bridge. | |
| virtual void | Run (unsigned int motorId, direction_t direction) |
| Runs the motor. | |
| virtual bool | SetSpeed (unsigned int motorId, unsigned int newMaxSpeed) |
| Changes the max speed of the specified device. | |
| virtual void | DisableBridge (unsigned int bridgeId) |
| Disable the specified bridge. | |
| virtual void | EnableBridge (unsigned int bridgeId) |
| Enable the specified bridge. | |
| virtual unsigned int | GetBridgeStatus (unsigned int bridgeId) |
| Get the status of the bridge enabling of the corresponding bridge. | |
| virtual void | HardHiZ (unsigned int motorId) |
| Immediatly stops the motor and disable the power bridge. | |
| virtual void | ErrorHandler (uint16_t error) |
| Error handler which calls the user callback (if defined) | |
| virtual void | SetDualFullBridgeConfig (unsigned int newConfig) |
| Set dual full bridge parallelling configuration. | |
| virtual unsigned int | GetBridgeInputPwmFreq (unsigned int bridgeId) |
| Get the PWM frequency of the specified bridge. | |
| virtual void | SetBridgeInputPwmFreq (unsigned int bridgeId, unsigned int newFreq) |
| Changes the PWM frequency of the bridge input. | |
| virtual bool | SetNbDevices (uint8_t nbDevices) |
| Sets the number of devices to be used. | |
| virtual void | EnableFlagIRQ (uint8_t bridgeId) |
| Enabling the FLAG interrupt handling. | |
| virtual void | DisableFlagIRQ (uint8_t bridgeId) |
| Disabling the FLAG interrupt handling. | |
| void | L6206_OutVal (uint8_t bridgeId, uint8_t val) |
| Utility function to set or unset EN pin for Bridge A or Bridge B. | |
| void | L6206_Board_Delay (uint32_t delay) |
| Making the CPU wait. | |
| void | L6206_Board_DisableBridge (uint8_t bridgeId) |
| Disable the specified bridge. | |
| void | L6206_Board_EnableBridge (uint8_t bridgeId, uint8_t addDelay) |
| Enable the specified bridge. | |
| uint32_t | L6206_Board_GetFlagPinState (uint8_t bridgeId) |
| Returns the FLAG pin state. | |
| void | L6206_Board_GpioInit (void) |
| Initiliases the GPIOs used by the L6206s. | |
| void | L6206_Board_PwmSetFreq (uint8_t bridgeInput, uint32_t newFreq, uint8_t duty) |
| Sets the frequency of PWM used for bridges inputs. | |
| void | L6206_Board_PwmDeInit (uint8_t bridgeInput) |
| Reset the PWM for the specified brigde input. | |
| void | L6206_Board_PwmInit (uint8_t bridgeInput) |
| Set the PWM frequency the for the specified bridge input. | |
| void | L6206_Board_PwmStop (uint8_t bridgeInput) |
| Stops the PWM uses for the specified brige input. | |
Variables | |
| bool | pwm_1A_activated |
| PWM timer variables. | |
Function Documentation
| virtual void AttachErrorHandler | ( | void(*)(uint16_t error) | callback ) | [virtual, inherited] |
Attaches a user callback to the error Handler.
The call back will be then called each time the library detects an error
- Parameters:
-
[in] callback Name of the callback to attach to the error Hanlder
- Return values:
-
None
Definition at line 202 of file l6206_class.h.
| virtual void AttachFlagInterrupt | ( | void(*)(void) | callback ) | [virtual, inherited] |
Attaches a user callback to the flag Interrupt The call back will be then called each time the status flag pin will be pulled down due to the occurrence of a programmed alarms ( OCD, thermal alert)
- Parameters:
-
[in] callback Name of the callback to attach to the Flag Interrupt
- Return values:
-
None
Definition at line 217 of file l6206_class.h.
| virtual void DisableBridge | ( | unsigned int | bridgeId ) | [virtual, inherited] |
Disable the specified bridge.
- Parameters:
-
[in] bridgeId (from 0 for bridge A to 1 for bridge B)
- Return values:
-
None
- Note:
- When input of different brigdes are parallelized together, the disabling of one bridge leads to the disabling of the second one
Definition at line 302 of file l6206_class.h.
| virtual void DisableFlagIRQ | ( | uint8_t | bridgeId ) | [virtual, inherited] |
Disabling the FLAG interrupt handling.
- Parameters:
-
[in] bridgeId 0 for bridge A, 1 for bridge B
- Return values:
-
None.
Definition at line 453 of file l6206_class.h.
| virtual void EnableBridge | ( | unsigned int | bridgeId ) | [virtual, inherited] |
Enable the specified bridge.
- Parameters:
-
[in] bridgeId (from 0 for bridge A to 1 for bridge B)
- Return values:
-
None
- Note:
- When input of different brigdes are parallelized together, the enabling of one bridge leads to the enabling of the second one
Definition at line 315 of file l6206_class.h.
| virtual void EnableFlagIRQ | ( | uint8_t | bridgeId ) | [virtual, inherited] |
Enabling the FLAG interrupt handling.
- Parameters:
-
[in] bridgeId 0 for bridge A, 1 for bridge B
- Return values:
-
None.
Definition at line 434 of file l6206_class.h.
| virtual void ErrorHandler | ( | uint16_t | error ) | [virtual, inherited] |
Error handler which calls the user callback (if defined)
- Parameters:
-
[in] error Number of the error
- Return values:
-
None
Definition at line 347 of file l6206_class.h.
| virtual unsigned int GetBridgeInputPwmFreq | ( | unsigned int | bridgeId ) | [virtual, inherited] |
Get the PWM frequency of the specified bridge.
- Parameters:
-
[in] bridgeId 0 for bridge A, 1 for bridge B
- Return values:
-
Freq in Hz
Definition at line 368 of file l6206_class.h.
| virtual unsigned int GetBridgeStatus | ( | unsigned int | bridgeId ) | [virtual, inherited] |
Get the status of the bridge enabling of the corresponding bridge.
- Parameters:
-
[in] bridgeId from 0 for bridge A to 1 for bridge B
- Return values:
-
State of the Enable&Flag pin of the corresponding bridge (1 set, 0 for reset)
Definition at line 325 of file l6206_class.h.
| virtual motorState_t GetDeviceState | ( | unsigned int | motorId ) | [virtual, inherited] |
Returns the device state.
- Parameters:
-
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
- Return values:
-
State (STEADY or INACTIVE)
Definition at line 237 of file l6206_class.h.
| virtual uint8_t GetFwVersion | ( | void | ) | [virtual, inherited] |
Returns the FW version of the library.
- Return values:
-
L6206_FW_VERSION
Definition at line 246 of file l6206_class.h.
| virtual uint16_t GetMaxSpeed | ( | unsigned int | motorId ) | [virtual, inherited] |
Returns the max speed of the specified motor.
- Parameters:
-
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
- Return values:
-
maxSpeed in % from 0 to 100
Definition at line 256 of file l6206_class.h.
| virtual unsigned int GetSpeed | ( | unsigned int | motorId ) | [virtual, inherited] |
Returns the current speed of the specified motor.
- Parameters:
-
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
- Return values:
-
current speed in % from 0 to 100
Definition at line 227 of file l6206_class.h.
| virtual void HardHiZ | ( | unsigned int | motorId ) | [virtual, inherited] |
Immediatly stops the motor and disable the power bridge.
- Parameters:
-
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
- Return values:
-
None
- Note:
- if two motors uses the same power bridge, the power bridge will be disable only if the two motors are stopped
Definition at line 337 of file l6206_class.h.
| virtual void HardStop | ( | unsigned int | motorId ) | [virtual, inherited] |
Stops the motor without disabling the bridge.
- Parameters:
-
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
- Return values:
-
none
Definition at line 266 of file l6206_class.h.
| virtual int Init | ( | void * | init = NULL ) |
[virtual, inherited] |
Initializing the component.
- Parameters:
-
init Pointer to device specific initalization structure.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 180 of file l6206_class.h.
| void L6206_Board_Delay | ( | uint32_t | delay ) | [protected, inherited] |
Making the CPU wait.
- Parameters:
-
None.
- Return values:
-
None.
Definition at line 549 of file l6206_class.h.
| void L6206_Board_DisableBridge | ( | uint8_t | bridgeId ) | [protected, inherited] |
Disable the specified bridge.
- Parameters:
-
[in] bridgeId (from 0 for bridge A to 1 for bridge B)
- Return values:
-
None
- Note:
- When input of different brigdes are parallelized together, the disabling of one bridge leads to the disabling of the second one
Definition at line 562 of file l6206_class.h.
| void L6206_Board_EnableBridge | ( | uint8_t | bridgeId, |
| uint8_t | addDelay | ||
| ) | [protected, inherited] |
Enable the specified bridge.
- Parameters:
-
[in] bridgeId (from 0 for bridge A to 1 for bridge B)
- Return values:
-
None
- Note:
- When input of different brigdes are parallelized together, the enabling of one bridge leads to the enabling of the second one
Definition at line 580 of file l6206_class.h.
| uint32_t L6206_Board_GetFlagPinState | ( | uint8_t | bridgeId ) | [protected, inherited] |
Returns the FLAG pin state.
- Parameters:
-
[in] bridgeId (from 0 for bridge A to 1 for bridge B)
- Return values:
-
The FLAG pin value.
Definition at line 597 of file l6206_class.h.
| void L6206_Board_GpioInit | ( | void | ) | [protected, inherited] |
Initiliases the GPIOs used by the L6206s.
- Return values:
-
None
Definition at line 615 of file l6206_class.h.
| void L6206_Board_PwmDeInit | ( | uint8_t | bridgeInput ) | [protected, inherited] |
Reset the PWM for the specified brigde input.
- Parameters:
-
[in] bridgeInput 0 for input 1A, 1 for input 2A, 2 for input 1B, 3 for input 2B
- Return values:
-
None
Definition at line 687 of file l6206_class.h.
| void L6206_Board_PwmInit | ( | uint8_t | bridgeInput ) | [protected, inherited] |
Set the PWM frequency the for the specified bridge input.
- Parameters:
-
[in] bridgeInput 0 for input 1A, 1 for input 2A, 2 for input 1B, 3 for input 2B
- Return values:
-
None
Definition at line 716 of file l6206_class.h.
| void L6206_Board_PwmSetFreq | ( | uint8_t | bridgeInput, |
| uint32_t | newFreq, | ||
| uint8_t | duty | ||
| ) | [protected, inherited] |
Sets the frequency of PWM used for bridges inputs.
- Parameters:
-
[in] bridgeInput 0 for input 1A, 1 for input 2A, 2 for input 1B, 3 for input 2B [in] newFreq in Hz [in] duty Duty cycle
- Return values:
-
None
- Note:
- The frequency is directly the current speed of the device
Definition at line 642 of file l6206_class.h.
| void L6206_Board_PwmStop | ( | uint8_t | bridgeInput ) | [protected, inherited] |
Stops the PWM uses for the specified brige input.
- Parameters:
-
[in] bridgeInput 0 for input 1A, 1 for input 2A, 2 for input 1B, 3 for input 2B
- Return values:
-
None
Definition at line 726 of file l6206_class.h.
| void L6206_OutVal | ( | uint8_t | bridgeId, |
| uint8_t | val | ||
| ) | [protected, inherited] |
Utility function to set or unset EN pin for Bridge A or Bridge B.
- Parameters:
-
[out] none [in] bridgeId 0 for bridge A, 1 for bridge B
- Return values:
-
none
Definition at line 528 of file l6206_class.h.
| virtual int ReadID | ( | uint8_t * | id = NULL ) |
[virtual, inherited] |
Getting the ID of the component.
- Parameters:
-
id Pointer to an allocated variable to store the ID into.
- Return values:
-
0 in case of success, an error code otherwise.
Definition at line 190 of file l6206_class.h.
| virtual void Run | ( | unsigned int | motorId, |
| direction_t | direction | ||
| ) | [virtual, inherited] |
Runs the motor.
- Parameters:
-
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS [in] direction FORWARD or BACKWARD
- Return values:
-
None
- Note:
- For unidirectionnal motor, direction parameter has no effect
Definition at line 278 of file l6206_class.h.
| virtual void SetBridgeInputPwmFreq | ( | unsigned int | bridgeId, |
| unsigned int | newFreq | ||
| ) | [virtual, inherited] |
Changes the PWM frequency of the bridge input.
- Parameters:
-
[in] bridgeId 0 for bridge A, 1 for bridge B [in] newFreq in Hz
- Return values:
-
None
Definition at line 379 of file l6206_class.h.
| virtual void SetDualFullBridgeConfig | ( | unsigned int | newConfig ) | [virtual, inherited] |
Set dual full bridge parallelling configuration.
- Parameters:
-
[in] newConfig bridge configuration to apply from dualFullBridgeConfig_t enum
- Return values:
-
None
Definition at line 358 of file l6206_class.h.
| virtual bool SetNbDevices | ( | uint8_t | nbDevices ) | [virtual, inherited] |
Sets the number of devices to be used.
- Parameters:
-
[in] nbDevices (from 1 to MAX_NUMBER_OF_DEVICES)
- Return values:
-
TRUE if successfull, FALSE if failure, attempt to set a number of devices greater than MAX_NUMBER_OF_DEVICES
Definition at line 390 of file l6206_class.h.
| virtual bool SetSpeed | ( | unsigned int | motorId, |
| unsigned int | newMaxSpeed | ||
| ) | [virtual, inherited] |
Changes the max speed of the specified device.
- Parameters:
-
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS [in] newMaxSpeed in % from 0 to 100
- Return values:
-
true if the command is successfully executed, else false
Definition at line 289 of file l6206_class.h.
| virtual ~L6206 | ( | void | ) | [virtual, inherited] |
Destructor.
Definition at line 149 of file l6206_class.h.
Variable Documentation
bool pwm_1A_activated [protected, inherited] |
PWM timer variables.
Definition at line 823 of file l6206_class.h.
Generated on Fri Jul 15 2022 09:11:13 by
1.7.2
