ST Expansion SW Team / X_NUCLEO_IHM14A1

Dependencies:   ST_INTERFACES

Dependents:   HelloWorld_IHM14A1

Fork of X_NUCLEO_IHM14A1 by Davide Aliprandi

Committer:
Davidroid
Date:
Fri Apr 27 17:02:08 2018 +0000
Revision:
1:bc265521eb00
Child:
2:4fd08b67958c
Populate

Who changed what in which revision?

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