ST Expansion SW Team / X_NUCLEO_IHM14A1

Dependencies:   ST_INTERFACES

Dependents:   HelloWorld_IHM14A1

Fork of X_NUCLEO_IHM14A1 by Davide Aliprandi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers STSPIN820_config.h Source File

STSPIN820_config.h

Go to the documentation of this file.
00001 /**
00002  *******************************************************************************
00003  * @file    STSPIN820_config.h
00004  * @author  STM
00005  * @version V1.0.1
00006  * @date    August 7th, 2017
00007  * @brief   Predefines values for the STSPIN820 registers and for the devices
00008  *          parameters.
00009  * @note    (C) COPYRIGHT 2017 STMicroelectronics
00010  *******************************************************************************
00011  * @attention
00012  *
00013  * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
00014  *
00015  * Redistribution and use in source and binary forms, with or without modification,
00016  * are permitted provided that the following conditions are met:
00017  *   1. Redistributions of source code must retain the above copyright notice,
00018  *      this list of conditions and the following disclaimer.
00019  *   2. Redistributions in binary form must reproduce the above copyright notice,
00020  *      this list of conditions and the following disclaimer in the documentation
00021  *      and/or other materials provided with the distribution.
00022  *   3. Neither the name of STMicroelectronics nor the names of its contributors
00023  *      may be used to endorse or promote products derived from this software
00024  *      without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00027  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00029  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00030  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00031  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00032  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00033  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00034  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00035  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036  *
00037  *******************************************************************************
00038  */
00039 
00040 
00041 /* Define to prevent recursive inclusion -------------------------------------*/
00042 
00043 #ifndef __STSPIN820_TARGET_CONFIG_H
00044 #define __STSPIN820_TARGET_CONFIG_H
00045 
00046 #ifdef __cplusplus
00047  extern "C" {
00048 #endif 
00049 
00050 /** @addtogroup BSP
00051   * @{
00052   */   
00053    
00054 /** @addtogroup STSPIN820
00055   * @{
00056   */   
00057 
00058 /** @addtogroup STSPIN820_Exported_Constants
00059   * @{
00060   */   
00061    
00062 /** @defgroup Predefined_STSPIN820_Registers_Values Predefined STSPIN820 Registers Values
00063   * @{
00064   */   
00065    
00066 /// The maximum number of devices
00067 #define MAX_NUMBER_OF_DEVICES                                  (2)
00068 
00069 /************************ Speed Profile  *******************************/
00070 
00071 /// Acceleration rate in pulse/s2 (must be greater than 0)
00072 #define STSPIN820_CONF_PARAM_ACC                               (480)
00073    
00074 /// Deceleration rate in pulse/s2 (must be greater than 0)
00075 #define STSPIN820_CONF_PARAM_DEC                               (480)
00076    
00077 /// Running speed in pulse/s (8 pulse/s < Maximum speed <= 10 000 pulse/s )
00078 #define STSPIN820_CONF_PARAM_RUNNING_SPEED                     (1600)
00079    
00080 /// Minimum speed in pulse/s (8 pulse/s <= Minimum speed < 10 000 pulse/s)
00081 #define STSPIN820_CONF_PARAM_MIN_SPEED                         (400)
00082 
00083 /************************ Torque  *******************************/
00084 
00085 /// Acceleration torque in % (from 0 to 100)
00086 #define STSPIN820_CONF_PARAM_ACC_TORQUE                        (25)
00087 
00088 /// Deceleration torque in % (from 0 to 100)
00089 #define STSPIN820_CONF_PARAM_DEC_TORQUE                        (20)
00090 
00091 /// Running torque in % (from 0 to 100)
00092 #define STSPIN820_CONF_PARAM_RUNNING_TORQUE                    (15)
00093 
00094 /// Holding torque in % (from 0 to 100)
00095 #define STSPIN820_CONF_PARAM_HOLDING_TORQUE                    (30)
00096 
00097 /// Torque boost speed enable
00098 #define STSPIN820_CONF_PARAM_TORQUE_BOOST_EN                   (TRUE)
00099 
00100 /// Torque boost speed threshold in fullstep/s
00101 #define STSPIN820_CONF_PARAM_TORQUE_BOOST_TH                   (200)
00102     
00103 /******************************* Others ***************************************/
00104 
00105 /// Step mode selection settings
00106 #define STSPIN820_CONF_PARAM_STEP_MODE                         (STEP_MODE_1_32)
00107    
00108 /// Automatic HIZ STOP
00109 #define STSPIN820_CONF_PARAM_AUTO_HIZ_STOP                     (HOLD_MODE)
00110 
00111 /// REF PWM frequency (Hz)
00112 #define STSPIN820_CONF_PARAM_REF_PWM_FREQUENCY                 (100000)
00113 
00114 /// MCU wait time after power bridges are enabled (ms)
00115 #define BRIDGE_TURN_ON_DELAY_ms                                (10)
00116 
00117 /**
00118   * @}
00119   */
00120 
00121 /**
00122   * @}
00123   */
00124 
00125 /**
00126   * @}
00127   */
00128 
00129 /**
00130   * @}
00131   */
00132 
00133 #ifdef __cplusplus
00134   }
00135 #endif
00136 
00137 #endif /* __STSPIN820_TARGET_CONFIG_H */