ST Expansion SW Team / X_NUCLEO_IHM14A1

Dependencies:   ST_INTERFACES

Dependents:   HelloWorld_IHM14A1

Fork of X_NUCLEO_IHM14A1 by Davide Aliprandi

Committer:
Davidroid
Date:
Thu Sep 27 14:05:44 2018 +0000
Revision:
2:4fd08b67958c
Parent:
1:bc265521eb00
Library to handle the X-NUCLEO-IHM14A1 Motor Control Expansion Board based on the STSPIN820 component.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Davidroid 2:4fd08b67958c 1 /**
Davidroid 2:4fd08b67958c 2 *******************************************************************************
Davidroid 2:4fd08b67958c 3 * @file STSPIN820_config.h
Davidroid 2:4fd08b67958c 4 * @author STM
Davidroid 2:4fd08b67958c 5 * @version V1.0.1
Davidroid 2:4fd08b67958c 6 * @date August 7th, 2017
Davidroid 2:4fd08b67958c 7 * @brief Predefines values for the STSPIN820 registers and for the devices
Davidroid 2:4fd08b67958c 8 * parameters.
Davidroid 2:4fd08b67958c 9 * @note (C) COPYRIGHT 2017 STMicroelectronics
Davidroid 2:4fd08b67958c 10 *******************************************************************************
Davidroid 2:4fd08b67958c 11 * @attention
Davidroid 2:4fd08b67958c 12 *
Davidroid 2:4fd08b67958c 13 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
Davidroid 2:4fd08b67958c 14 *
Davidroid 2:4fd08b67958c 15 * Redistribution and use in source and binary forms, with or without modification,
Davidroid 2:4fd08b67958c 16 * are permitted provided that the following conditions are met:
Davidroid 2:4fd08b67958c 17 * 1. Redistributions of source code must retain the above copyright notice,
Davidroid 2:4fd08b67958c 18 * this list of conditions and the following disclaimer.
Davidroid 2:4fd08b67958c 19 * 2. Redistributions in binary form must reproduce the above copyright notice,
Davidroid 2:4fd08b67958c 20 * this list of conditions and the following disclaimer in the documentation
Davidroid 2:4fd08b67958c 21 * and/or other materials provided with the distribution.
Davidroid 2:4fd08b67958c 22 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Davidroid 2:4fd08b67958c 23 * may be used to endorse or promote products derived from this software
Davidroid 2:4fd08b67958c 24 * without specific prior written permission.
Davidroid 2:4fd08b67958c 25 *
Davidroid 2:4fd08b67958c 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Davidroid 2:4fd08b67958c 27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Davidroid 2:4fd08b67958c 28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Davidroid 2:4fd08b67958c 29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Davidroid 2:4fd08b67958c 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Davidroid 2:4fd08b67958c 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Davidroid 2:4fd08b67958c 32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Davidroid 2:4fd08b67958c 33 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Davidroid 2:4fd08b67958c 34 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Davidroid 2:4fd08b67958c 35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Davidroid 2:4fd08b67958c 36 *
Davidroid 2:4fd08b67958c 37 *******************************************************************************
Davidroid 2:4fd08b67958c 38 */
Davidroid 1:bc265521eb00 39
Davidroid 1:bc265521eb00 40
Davidroid 1:bc265521eb00 41 /* Define to prevent recursive inclusion -------------------------------------*/
Davidroid 1:bc265521eb00 42
Davidroid 1:bc265521eb00 43 #ifndef __STSPIN820_TARGET_CONFIG_H
Davidroid 1:bc265521eb00 44 #define __STSPIN820_TARGET_CONFIG_H
Davidroid 1:bc265521eb00 45
Davidroid 1:bc265521eb00 46 #ifdef __cplusplus
Davidroid 1:bc265521eb00 47 extern "C" {
Davidroid 1:bc265521eb00 48 #endif
Davidroid 1:bc265521eb00 49
Davidroid 1:bc265521eb00 50 /** @addtogroup BSP
Davidroid 1:bc265521eb00 51 * @{
Davidroid 1:bc265521eb00 52 */
Davidroid 1:bc265521eb00 53
Davidroid 1:bc265521eb00 54 /** @addtogroup STSPIN820
Davidroid 1:bc265521eb00 55 * @{
Davidroid 1:bc265521eb00 56 */
Davidroid 1:bc265521eb00 57
Davidroid 1:bc265521eb00 58 /** @addtogroup STSPIN820_Exported_Constants
Davidroid 1:bc265521eb00 59 * @{
Davidroid 1:bc265521eb00 60 */
Davidroid 1:bc265521eb00 61
Davidroid 1:bc265521eb00 62 /** @defgroup Predefined_STSPIN820_Registers_Values Predefined STSPIN820 Registers Values
Davidroid 1:bc265521eb00 63 * @{
Davidroid 1:bc265521eb00 64 */
Davidroid 1:bc265521eb00 65
Davidroid 1:bc265521eb00 66 /// The maximum number of devices
Davidroid 1:bc265521eb00 67 #define MAX_NUMBER_OF_DEVICES (2)
Davidroid 1:bc265521eb00 68
Davidroid 1:bc265521eb00 69 /************************ Speed Profile *******************************/
Davidroid 1:bc265521eb00 70
Davidroid 1:bc265521eb00 71 /// Acceleration rate in pulse/s2 (must be greater than 0)
Davidroid 1:bc265521eb00 72 #define STSPIN820_CONF_PARAM_ACC (480)
Davidroid 1:bc265521eb00 73
Davidroid 1:bc265521eb00 74 /// Deceleration rate in pulse/s2 (must be greater than 0)
Davidroid 1:bc265521eb00 75 #define STSPIN820_CONF_PARAM_DEC (480)
Davidroid 1:bc265521eb00 76
Davidroid 1:bc265521eb00 77 /// Running speed in pulse/s (8 pulse/s < Maximum speed <= 10 000 pulse/s )
Davidroid 1:bc265521eb00 78 #define STSPIN820_CONF_PARAM_RUNNING_SPEED (1600)
Davidroid 1:bc265521eb00 79
Davidroid 1:bc265521eb00 80 /// Minimum speed in pulse/s (8 pulse/s <= Minimum speed < 10 000 pulse/s)
Davidroid 1:bc265521eb00 81 #define STSPIN820_CONF_PARAM_MIN_SPEED (400)
Davidroid 1:bc265521eb00 82
Davidroid 1:bc265521eb00 83 /************************ Torque *******************************/
Davidroid 1:bc265521eb00 84
Davidroid 1:bc265521eb00 85 /// Acceleration torque in % (from 0 to 100)
Davidroid 1:bc265521eb00 86 #define STSPIN820_CONF_PARAM_ACC_TORQUE (25)
Davidroid 1:bc265521eb00 87
Davidroid 1:bc265521eb00 88 /// Deceleration torque in % (from 0 to 100)
Davidroid 1:bc265521eb00 89 #define STSPIN820_CONF_PARAM_DEC_TORQUE (20)
Davidroid 1:bc265521eb00 90
Davidroid 1:bc265521eb00 91 /// Running torque in % (from 0 to 100)
Davidroid 1:bc265521eb00 92 #define STSPIN820_CONF_PARAM_RUNNING_TORQUE (15)
Davidroid 1:bc265521eb00 93
Davidroid 1:bc265521eb00 94 /// Holding torque in % (from 0 to 100)
Davidroid 1:bc265521eb00 95 #define STSPIN820_CONF_PARAM_HOLDING_TORQUE (30)
Davidroid 1:bc265521eb00 96
Davidroid 1:bc265521eb00 97 /// Torque boost speed enable
Davidroid 1:bc265521eb00 98 #define STSPIN820_CONF_PARAM_TORQUE_BOOST_EN (TRUE)
Davidroid 1:bc265521eb00 99
Davidroid 1:bc265521eb00 100 /// Torque boost speed threshold in fullstep/s
Davidroid 1:bc265521eb00 101 #define STSPIN820_CONF_PARAM_TORQUE_BOOST_TH (200)
Davidroid 1:bc265521eb00 102
Davidroid 1:bc265521eb00 103 /******************************* Others ***************************************/
Davidroid 1:bc265521eb00 104
Davidroid 1:bc265521eb00 105 /// Step mode selection settings
Davidroid 1:bc265521eb00 106 #define STSPIN820_CONF_PARAM_STEP_MODE (STEP_MODE_1_32)
Davidroid 1:bc265521eb00 107
Davidroid 1:bc265521eb00 108 /// Automatic HIZ STOP
Davidroid 1:bc265521eb00 109 #define STSPIN820_CONF_PARAM_AUTO_HIZ_STOP (HOLD_MODE)
Davidroid 1:bc265521eb00 110
Davidroid 1:bc265521eb00 111 /// REF PWM frequency (Hz)
Davidroid 1:bc265521eb00 112 #define STSPIN820_CONF_PARAM_REF_PWM_FREQUENCY (100000)
Davidroid 1:bc265521eb00 113
Davidroid 2:4fd08b67958c 114 /// MCU wait time after power bridges are enabled (ms)
Davidroid 2:4fd08b67958c 115 #define BRIDGE_TURN_ON_DELAY_ms (10)
Davidroid 2:4fd08b67958c 116
Davidroid 1:bc265521eb00 117 /**
Davidroid 1:bc265521eb00 118 * @}
Davidroid 1:bc265521eb00 119 */
Davidroid 1:bc265521eb00 120
Davidroid 1:bc265521eb00 121 /**
Davidroid 1:bc265521eb00 122 * @}
Davidroid 1:bc265521eb00 123 */
Davidroid 1:bc265521eb00 124
Davidroid 1:bc265521eb00 125 /**
Davidroid 1:bc265521eb00 126 * @}
Davidroid 1:bc265521eb00 127 */
Davidroid 1:bc265521eb00 128
Davidroid 1:bc265521eb00 129 /**
Davidroid 1:bc265521eb00 130 * @}
Davidroid 1:bc265521eb00 131 */
Davidroid 1:bc265521eb00 132
Davidroid 1:bc265521eb00 133 #ifdef __cplusplus
Davidroid 1:bc265521eb00 134 }
Davidroid 1:bc265521eb00 135 #endif
Davidroid 1:bc265521eb00 136
Davidroid 1:bc265521eb00 137 #endif /* __STSPIN820_TARGET_CONFIG_H */