Expansion SW library to control a bipolar stepper motor using X-NUCLEO-IHM05A1 expansion board based on L6208.

Dependencies:   ST_INTERFACES

Dependents:   HelloWorld_IHM05A1 TAU_ROTATING_PLATFORM_IHM05A1 Amaldi_13_Exercise_IHM05A1 Amaldi_13_Exercise_IHM05A1motore ... more

Fork of X-NUCLEO-IHM05A1 by ST Expansion SW Team

Motor Control Library

Library to handle the X-NUCLEO-IHM05A1 Motor Control Expansion Board based on the L6208 component.

It features the:

  • Read and write of device parameters
  • Configuration of GPIOs and IRQs (for enabling, direction, current decay and microstepping)
  • Control of position, speed, acceleration and deceleration
  • Command locking until the device completes movement
  • Handling of overcurrent and thermal alarms (flag interrupt handling)

The API allows to easily:

  • perform various positioning, moves and stops
  • get/set or monitor the motor positions
  • set home position and mark another position
  • get/set minimum and maximum speed
  • get current speed
  • get/set acceleration and deceleration
  • get/set the step mode (up to 1/16)

Board configuration

/media/uploads/nucleosam/mbed-x-nucleo-ihm05a1.png

Platform compatibility

Compatible platforms have been tested with the configurations provided by the HelloWorld_IHM05A1 example.

Committer:
nucleosam
Date:
Fri Apr 08 15:30:36 2016 +0000
Revision:
0:52a66fac0f64
Initial version with empty files in l6208 folder.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nucleosam 0:52a66fac0f64 1 /**
nucleosam 0:52a66fac0f64 2 ******************************************************************************
nucleosam 0:52a66fac0f64 3 * @file Component_class.h
nucleosam 0:52a66fac0f64 4 * @author AST
nucleosam 0:52a66fac0f64 5 * @version V1.0.0
nucleosam 0:52a66fac0f64 6 * @date April 13th, 2015
nucleosam 0:52a66fac0f64 7 * @brief This file contains the abstract class describing the interface of a
nucleosam 0:52a66fac0f64 8 * generic component.
nucleosam 0:52a66fac0f64 9 ******************************************************************************
nucleosam 0:52a66fac0f64 10 * @attention
nucleosam 0:52a66fac0f64 11 *
nucleosam 0:52a66fac0f64 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
nucleosam 0:52a66fac0f64 13 *
nucleosam 0:52a66fac0f64 14 * Redistribution and use in source and binary forms, with or without modification,
nucleosam 0:52a66fac0f64 15 * are permitted provided that the following conditions are met:
nucleosam 0:52a66fac0f64 16 * 1. Redistributions of source code must retain the above copyright notice,
nucleosam 0:52a66fac0f64 17 * this list of conditions and the following disclaimer.
nucleosam 0:52a66fac0f64 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
nucleosam 0:52a66fac0f64 19 * this list of conditions and the following disclaimer in the documentation
nucleosam 0:52a66fac0f64 20 * and/or other materials provided with the distribution.
nucleosam 0:52a66fac0f64 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
nucleosam 0:52a66fac0f64 22 * may be used to endorse or promote products derived from this software
nucleosam 0:52a66fac0f64 23 * without specific prior written permission.
nucleosam 0:52a66fac0f64 24 *
nucleosam 0:52a66fac0f64 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
nucleosam 0:52a66fac0f64 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
nucleosam 0:52a66fac0f64 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
nucleosam 0:52a66fac0f64 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
nucleosam 0:52a66fac0f64 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
nucleosam 0:52a66fac0f64 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
nucleosam 0:52a66fac0f64 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
nucleosam 0:52a66fac0f64 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
nucleosam 0:52a66fac0f64 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
nucleosam 0:52a66fac0f64 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
nucleosam 0:52a66fac0f64 35 *
nucleosam 0:52a66fac0f64 36 ******************************************************************************
nucleosam 0:52a66fac0f64 37 */
nucleosam 0:52a66fac0f64 38
nucleosam 0:52a66fac0f64 39
nucleosam 0:52a66fac0f64 40 /* Define to prevent recursive inclusion -------------------------------------*/
nucleosam 0:52a66fac0f64 41
nucleosam 0:52a66fac0f64 42 #ifndef __COMPONENT_CLASS_H
nucleosam 0:52a66fac0f64 43 #define __COMPONENT_CLASS_H
nucleosam 0:52a66fac0f64 44
nucleosam 0:52a66fac0f64 45
nucleosam 0:52a66fac0f64 46 /* Includes ------------------------------------------------------------------*/
nucleosam 0:52a66fac0f64 47
nucleosam 0:52a66fac0f64 48 #include <stdint.h>
nucleosam 0:52a66fac0f64 49
nucleosam 0:52a66fac0f64 50
nucleosam 0:52a66fac0f64 51 /* Classes ------------------------------------------------------------------*/
nucleosam 0:52a66fac0f64 52
nucleosam 0:52a66fac0f64 53 /** An abstract class for Generic components.
nucleosam 0:52a66fac0f64 54 */
nucleosam 0:52a66fac0f64 55 class Component
nucleosam 0:52a66fac0f64 56 {
nucleosam 0:52a66fac0f64 57 public:
nucleosam 0:52a66fac0f64 58 /**
nucleosam 0:52a66fac0f64 59 * @brief Initializing the component.
nucleosam 0:52a66fac0f64 60 * @param[in] init pointer to device specific initalization structure.
nucleosam 0:52a66fac0f64 61 * @retval "0" in case of success, an error code otherwise.
nucleosam 0:52a66fac0f64 62 */
nucleosam 0:52a66fac0f64 63 virtual int Init(void *init) = 0;
nucleosam 0:52a66fac0f64 64
nucleosam 0:52a66fac0f64 65 /**
nucleosam 0:52a66fac0f64 66 * @brief Getting the ID of the component.
nucleosam 0:52a66fac0f64 67 * @param[out] id pointer to an allocated variable to store the ID into.
nucleosam 0:52a66fac0f64 68 * @retval "0" in case of success, an error code otherwise.
nucleosam 0:52a66fac0f64 69 */
nucleosam 0:52a66fac0f64 70 virtual int ReadID(uint8_t *id) = 0;
nucleosam 0:52a66fac0f64 71
nucleosam 0:52a66fac0f64 72 /**
nucleosam 0:52a66fac0f64 73 * @brief Getting the version of the firmware.
nucleosam 0:52a66fac0f64 74 * @param None.
nucleosam 0:52a66fac0f64 75 * @retval The version of the firmware.
nucleosam 0:52a66fac0f64 76 */
nucleosam 0:52a66fac0f64 77 virtual unsigned int GetFwVersion(void) = 0;
nucleosam 0:52a66fac0f64 78
nucleosam 0:52a66fac0f64 79 };
nucleosam 0:52a66fac0f64 80
nucleosam 0:52a66fac0f64 81 #endif /* __COMPONENT_CLASS_H */
nucleosam 0:52a66fac0f64 82
nucleosam 0:52a66fac0f64 83 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/