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.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: Stepper_Matlab_Control SunTracker_BLE Stepper_Matlab_Control MemsMotorControl ... more
Fork of X_NUCLEO_IHM01A1 by
Motor Control Library
Introduction
Library to handle the X-NUCLEO-IHM01A1 Motor Control Expansion Board based on the the L6474 component.
Daisy-Chain Configuration
This board can be stacked up to three times so that the L6474 components will be connected in daisy-chain configuration. For this purpose, some resistors must be correctly connected on the boards as depicted here below:
Platform compatibility
- NUCLEO boards have been tested with the default configuration provided by the HelloWorld_IHM01A1 example.
- LPCXpresso11U68 board has been tested with the following patch:
- to connect with a wire from the LPCX’s
D4pin to the IHM01A1’sD9pin; - to initialize the pwm PinName variable with
D4rather thanD9.
- to connect with a wire from the LPCX’s
- FRDM-K64F board has been tested with the following patch:
- to connect with a wire from the FRDM’s
D4pin to the IHM01A1’sD8pin; - to initialize the standby_reset PinName variable with
D4rather thanD8.
- to connect with a wire from the FRDM’s
Example Applications
- HelloWorld_IHM01A1
- HelloWorld_IHM01A1_2Motors
- MotorControl_IHM01A1
- MemsMotorControl
- MemsMotorControl_IHM01A1_IKS01A2
Diff: Components/l6474/l6474_class.h
- Revision:
- 22:ed3a6990a6eb
- Parent:
- 21:83138e702683
- Child:
- 23:58264db10a17
--- a/Components/l6474/l6474_class.h Tue Jan 19 15:57:24 2016 +0000
+++ b/Components/l6474/l6474_class.h Tue Feb 09 10:53:31 2016 +0000
@@ -693,13 +693,13 @@
* source files but not pointed by the component's virtual table (3). *
* *
* Example: *
- * DrvStatusTypeDef COMPONENT_GetValue(float* pfData); //(1) *
- * DrvStatusTypeDef COMPONENT_EnableFeature(void); //(2) *
- * DrvStatusTypeDef COMPONENT_ComputeAverage(void); //(3) *
+ * Status_t COMPONENT_GetValue(float *f); //(1) *
+ * Status_t COMPONENT_EnableFeature(void); //(2) *
+ * Status_t COMPONENT_ComputeAverage(void); //(3) *
*------------------------------------------------------------------------*/
void L6474_AttachErrorHandler(void (*callback)(uint16_t error));
- DrvStatusTypeDef L6474_Init(void *init);
- DrvStatusTypeDef L6474_ReadID(uint8_t *id);
+ Status_t L6474_Init(void *init);
+ Status_t L6474_ReadID(uint8_t *id);
uint16_t L6474_GetAcceleration(void);
uint16_t L6474_GetCurrentSpeed(void);
uint16_t L6474_GetDeceleration(void);
@@ -739,7 +739,7 @@
void L6474_ErrorHandler(uint16_t error);
void L6474_SendCommand(uint8_t param);
void L6474_SetRegisterToPredefinedValues(void);
- void L6474_SetRegisterToInitializationValues(L6474_InitTypeDef *init);
+ void L6474_SetRegisterToInitializationValues(L6474_Init_t *init);
void L6474_WriteBytes(uint8_t *pByteToTransmit, uint8_t *pReceivedByte);
void L6474_SetDeviceParamsToPredefinedValues(void);
void L6474_StartMovement(void);
@@ -758,7 +758,7 @@
* @param[in] NumBytesToRead number of bytes to read.
* @retval COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
*/
- DrvStatusTypeDef Read(uint8_t* pBuffer, uint16_t NumBytesToRead)
+ Status_t Read(uint8_t* pBuffer, uint16_t NumBytesToRead)
{
if (dev_spi.spi_read(pBuffer, ssel, NumBytesToRead) != 0)
return COMPONENT_ERROR;
@@ -771,7 +771,7 @@
* @param[in] NumBytesToWrite number of bytes to write.
* @retval COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
*/
- DrvStatusTypeDef Write(uint8_t* pBuffer, uint16_t NumBytesToWrite)
+ Status_t Write(uint8_t* pBuffer, uint16_t NumBytesToWrite)
{
if (dev_spi.spi_write(pBuffer, ssel, NumBytesToWrite) != 0)
return COMPONENT_ERROR;
@@ -785,7 +785,7 @@
* @param[in] NumBytes number of bytes to read and write.
* @retval COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
*/
- DrvStatusTypeDef ReadWrite(uint8_t* pBufferToRead, uint8_t* pBufferToWrite, uint16_t NumBytes)
+ Status_t ReadWrite(uint8_t* pBufferToRead, uint8_t* pBufferToWrite, uint16_t NumBytes)
{
if (dev_spi.spi_read_write(pBufferToRead, pBufferToWrite, ssel, NumBytes) != 0)
return COMPONENT_ERROR;

X-NUCLEO-IHM01A1 Stepper Motor Driver