Library used to control ST Nucleo Evaluation board IHM04A1, based on L6206 motor control driver.
Dependencies:
ST_INTERFACES
Dependents:
HelloWorld_IHM04A1
RoboCane_Motore
arm_dcmotor_can
arm_linear_can_2
... more
Fork of
X_NUCLEO_IHM04A1
by ST Expansion SW Team
« Back to documentation index
L6206 Private functions
Function Documentation
void L6206_attach_flag_interrupt
(
void(*)(void)
callback )
[protected, 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:
Definition at line 117 of file L6206.cpp .
void L6206_AttachErrorHandler
(
void(*)(uint16_t error)
callback )
[protected, 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:
Definition at line 103 of file L6206.cpp .
void L6206_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:
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 130 of file L6206.cpp .
void L6206_EnableBridge
(
uint8_t
bridgeId )
[protected, inherited]
Enable the specified bridge.
Parameters:
[in] bridgeId (from 0 for bridge A to 1 for bridge B)
Return values:
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 158 of file L6206.cpp .
void L6206_ErrorHandler
(
uint16_t
error )
[protected, inherited]
Error handler which calls the user callback (if defined)
Parameters:
[in] error Number of the error
Return values:
Definition at line 669 of file L6206.cpp .
void L6206_FlagInterruptHandler
(
void
)
[protected, inherited]
Handlers of the flag interrupt which calls the user callback (if defined)
Return values:
Definition at line 688 of file L6206.cpp .
motorState_t L6206_get_device_state
(
uint8_t
motorId )
[protected, 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 249 of file L6206.cpp .
uint8_t L6206_GetBridgeIdUsedByMotorId
(
uint8_t
motorId )
[protected, inherited]
Get the bridges Id used by a given motor.
Parameters:
motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
Return values:
bridgeId 0 for bridge A , 1 for bridge B
Definition at line 715 of file L6206.cpp .
uint32_t L6206_GetBridgeInputPwmFreq
(
uint8_t
bridgeId )
[protected, inherited]
Get the PWM frequency of the specified bridge.
Parameters:
[in] bridgeId 0 for bridge A, 1 for bridge B
Return values:
Definition at line 215 of file L6206.cpp .
uint8_t L6206_GetBridgeInputUsedByMotorId
(
uint8_t
motorId )
[protected, inherited]
Get the PWM input used by a given motor.
Parameters:
motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
Return values:
PWM input 0 for 1A, 1 for 2A, 2 for 1B, 3 for 3B
Definition at line 868 of file L6206.cpp .
uint16_t L6206_GetBridgeStatus
(
uint8_t
bridgeId )
[protected, 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 298 of file L6206.cpp .
uint16_t L6206_GetCurrentSpeed
(
uint8_t
motorId )
[protected, 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 225 of file L6206.cpp .
uint8_t L6206_GetFwVersion
(
void
)
[protected, inherited]
Returns the FW version of the library.
Return values:
Definition at line 268 of file L6206.cpp .
uint16_t L6206_GetMaxSpeed
(
uint8_t
motorId )
[protected, 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 278 of file L6206.cpp .
uint8_t L6206_GetMotorIdUsingbridgeInput
(
uint8_t
bridgeInput )
[protected, inherited]
Get the motor Id which is using the specified bridge input.
Parameters:
bridgeInput 0 for bridgeInput 1A, 1 for 2A, 2 for 1B, 3 for 3B
Return values:
bridgeId 0 for bridge A , 1 for bridge B
Definition at line 764 of file L6206.cpp .
uint8_t L6206_GetSecondBridgeInputUsedByMotorId
(
uint8_t
motorId )
[protected, inherited]
Get the second PWM input used by a given bidirectionnal motor.
Parameters:
motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
Return values:
PWM input 0 for 1A, 1 for 2A, 2 for 1B, 3 for 3B
Definition at line 1091 of file L6206.cpp .
void L6206_HardHiz
(
uint8_t
motorId )
[protected, inherited]
Immediatly stops the motor and disable the power bridge.
Parameters:
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
Return values:
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 313 of file L6206.cpp .
void L6206_HardStop
(
uint8_t
motorId )
[protected, inherited]
Stops the motor without disabling the bridge.
Parameters:
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
Return values:
Definition at line 388 of file L6206.cpp .
status_t L6206_Init
(
void *
init )
[protected, inherited]
Start the L6206 library.
Parameters:
[in] init pointer to the initialization data
Return values:
Definition at line 186 of file L6206.cpp .
bool L6206_IsBidirectionnalMotor
(
uint8_t
motorId )
[protected, inherited]
Test if motor is bidirectionnal.
Parameters:
motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
Return values:
True if motor is bidirectionnal, else false
Definition at line 1213 of file L6206.cpp .
status_t L6206_ReadId
(
uint8_t *
id )
[protected, inherited]
Read id.
Return values:
Id of the l6206 Driver Instance
Definition at line 422 of file L6206.cpp .
void L6206_Run
(
uint8_t
motorId ,
motorDir_t
direction
)
[protected, inherited]
Runs the motor.
Parameters:
[in] motorId from 0 to MAX_NUMBER_OF_BRUSH_DC_MOTORS
[in] direction FORWARD or BACKWARD
Return values:
Note: For unidirectionnal motor, direction parameter has no effect
Definition at line 437 of file L6206.cpp .
void L6206_SetBridgeInputPwmFreq
(
uint8_t
bridgeId ,
uint32_t
newFreq
)
[protected, 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:
Definition at line 603 of file L6206.cpp .
void L6206_SetDeviceParamsToGivenValues
(
L6206_init_t *
initDevicePrm )
[protected, inherited]
Set the parameters of the device to values of initDevicePrm structure Set GPIO according to these values.
Parameters:
initDevicePrm structure containing values to initialize the device parameters
Return values:
Definition at line 1291 of file L6206.cpp .
void L6206_SetDeviceParamsToPredefinedValues
(
void
)
[protected, inherited]
Sets the parameters of the device to predefined values from l6206_target_config.h.
Return values:
Definition at line 1258 of file L6206.cpp .
void L6206_SetDualFullBridgeConfig
(
uint8_t
newConfig )
[protected, inherited]
Set dual full bridge parallelling configuration.
Parameters:
[in] newConfig bridge configuration to apply from dualFullBridgeConfig_t enum
Return values:
Definition at line 494 of file L6206.cpp .
bool L6206_SetMaxSpeed
(
uint8_t
motorId ,
uint16_t
newMaxSpeed
)
[protected, 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 562 of file L6206.cpp .
bool L6206_SetNbDevices
(
uint8_t
nbDevices )
[protected, 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 651 of file L6206.cpp .