Library used to control ST Nucleo Evaluation board IHM12A1, based on STSPIN240 low voltage dual brush DC motor control driver.
Dependencies: ST_INTERFACES
Dependents: motori prova_motore SchedamotoriIHM12A1 prova_motore_duck ... more
Fork of X-NUCLEO-IHM12A1 by
Brush DC Motor Control Library
Library to handle the X-NUCLEO-IHM12A1 Motor Control Expansion Board based on the STSPIN240 component.
It allows a complete management of the STSPIN240, a low voltage dual brush DC driver, by providing a complete APIs.
The key features of the library are :
- Configuration of the STSPIN240 (bridges input and enabling signals)
- Flag interrupt handling (overcurrent and thermal alarms reporting)
- Handling of up to two bidirectional Brush DC motors
- Nucleo and expansion board configuration (GPIOs, PWMs, IRQs…)
To use the STSPIN240 driver library, the user first has to call its initialization method which:
- Setups the required GPIOs to handle the bridges enable pins, the FLAG interrupt which reports overcurrent detection or thermal protection.
- Loads the driver parameters with initial values configured by the user or with their predefined values from “stspin240_250_target_config.h”, in order to program the PWMs frequency of the bridges inputs, the number of brush DC motors.
Once the initialization is done, the user can modify the driver parameters by calling specific functions to change the numbers of motors or the PWMs frequency.
The user can also write callback functions and attach them to:
- The flag interrupt handler depending on the actions he wants to perform when an overcurrent or a thermal alarm is reported.
- The Error handler which is called by the library when it reports an error.
Then, the user can drive the different brush DC motors by requesting to run in a specified direction and by changing the maximal speed. When a motor is requested to run, the corresponding bridge is automatically enabled.
A motion command can be stopped at any moment:
- Either by a hard stop which immediately stops the motor.
- Or by a hardHiz command which immediately stops the motor and disables the bridge which is used by the motor.
The library also provides functions to disable or enable the bridges independently from the run or stop commands.
Arduino Connector Compatibility Warning
Using the X-NUCLEO-IHM12A1 expansion board with the NUCLEO-F429ZI
requires adopting the following patch:
- to connect with a wire the
PB_3
Nucleo pin to thePWMB
expansion board pin.
Board configuration for HelloWorld_IHM12A1 example
Components/STSpin240_250/STSpin240_250_def.h@7:6efcc9b4d810, 2018-08-09 (annotated)
- Committer:
- Davidroid
- Date:
- Thu Aug 09 15:00:43 2018 +0000
- Revision:
- 7:6efcc9b4d810
- Parent:
- 4:07acd6934359
Update comment of STSpin240_250's class constructor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
davide.aliprandi@st.com | 3:b0128df93d26 | 1 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 2 | ****************************************************************************** |
davide.aliprandi@st.com | 3:b0128df93d26 | 3 | * @file STSpin240_250_def.h |
davide.aliprandi@st.com | 3:b0128df93d26 | 4 | * @author IPC Rennes |
davide.aliprandi@st.com | 3:b0128df93d26 | 5 | * @version V1.0.0 |
davide.aliprandi@st.com | 3:b0128df93d26 | 6 | * @date February 10, 2016 |
Davidroid | 4:07acd6934359 | 7 | * @brief Header for STSpin240 (low voltage dual brush DC motor driver) and |
Davidroid | 4:07acd6934359 | 8 | * STSpin250 driver (low voltage brush DC motor driver) |
davide.aliprandi@st.com | 3:b0128df93d26 | 9 | * @note (C) COPYRIGHT 2016 STMicroelectronics |
davide.aliprandi@st.com | 3:b0128df93d26 | 10 | ****************************************************************************** |
davide.aliprandi@st.com | 3:b0128df93d26 | 11 | * @attention |
davide.aliprandi@st.com | 3:b0128df93d26 | 12 | * |
davide.aliprandi@st.com | 3:b0128df93d26 | 13 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
davide.aliprandi@st.com | 3:b0128df93d26 | 14 | * |
davide.aliprandi@st.com | 3:b0128df93d26 | 15 | * Redistribution and use in source and binary forms, with or without modification, |
davide.aliprandi@st.com | 3:b0128df93d26 | 16 | * are permitted provided that the following conditions are met: |
davide.aliprandi@st.com | 3:b0128df93d26 | 17 | * 1. Redistributions of source code must retain the above copyright notice, |
davide.aliprandi@st.com | 3:b0128df93d26 | 18 | * this list of conditions and the following disclaimer. |
davide.aliprandi@st.com | 3:b0128df93d26 | 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
davide.aliprandi@st.com | 3:b0128df93d26 | 20 | * this list of conditions and the following disclaimer in the documentation |
davide.aliprandi@st.com | 3:b0128df93d26 | 21 | * and/or other materials provided with the distribution. |
davide.aliprandi@st.com | 3:b0128df93d26 | 22 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
davide.aliprandi@st.com | 3:b0128df93d26 | 23 | * may be used to endorse or promote products derived from this software |
davide.aliprandi@st.com | 3:b0128df93d26 | 24 | * without specific prior written permission. |
davide.aliprandi@st.com | 3:b0128df93d26 | 25 | * |
davide.aliprandi@st.com | 3:b0128df93d26 | 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
davide.aliprandi@st.com | 3:b0128df93d26 | 27 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
davide.aliprandi@st.com | 3:b0128df93d26 | 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
davide.aliprandi@st.com | 3:b0128df93d26 | 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
davide.aliprandi@st.com | 3:b0128df93d26 | 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
davide.aliprandi@st.com | 3:b0128df93d26 | 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
davide.aliprandi@st.com | 3:b0128df93d26 | 32 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
davide.aliprandi@st.com | 3:b0128df93d26 | 33 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
davide.aliprandi@st.com | 3:b0128df93d26 | 34 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
davide.aliprandi@st.com | 3:b0128df93d26 | 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
davide.aliprandi@st.com | 3:b0128df93d26 | 36 | * |
davide.aliprandi@st.com | 3:b0128df93d26 | 37 | ****************************************************************************** |
davide.aliprandi@st.com | 3:b0128df93d26 | 38 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 39 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 40 | /* Define to prevent recursive inclusion -------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 41 | #ifndef __STSPIN240_250_H |
davide.aliprandi@st.com | 3:b0128df93d26 | 42 | #define __STSPIN240_250_H |
davide.aliprandi@st.com | 3:b0128df93d26 | 43 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 44 | #ifdef __cplusplus |
davide.aliprandi@st.com | 3:b0128df93d26 | 45 | extern "C" { |
davide.aliprandi@st.com | 3:b0128df93d26 | 46 | #endif |
davide.aliprandi@st.com | 3:b0128df93d26 | 47 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 48 | /* Includes ------------------------------------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 49 | #include "STSpin240_250_config.h" |
davide.aliprandi@st.com | 3:b0128df93d26 | 50 | #include "motor_def.h" |
davide.aliprandi@st.com | 3:b0128df93d26 | 51 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 52 | /* Definitions ---------------------------------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 53 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 54 | /** @addtogroup Components |
davide.aliprandi@st.com | 3:b0128df93d26 | 55 | * @{ |
davide.aliprandi@st.com | 3:b0128df93d26 | 56 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 57 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 58 | /** @defgroup STSPIN240_250 STSPIN240_250 |
davide.aliprandi@st.com | 3:b0128df93d26 | 59 | * @{ |
davide.aliprandi@st.com | 3:b0128df93d26 | 60 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 61 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 62 | /** @defgroup STSPIN240_250_Exported_Defines STSPIN240_250 Exported Defines |
davide.aliprandi@st.com | 3:b0128df93d26 | 63 | * @{ |
davide.aliprandi@st.com | 3:b0128df93d26 | 64 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 65 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 66 | /// Current FW version |
davide.aliprandi@st.com | 3:b0128df93d26 | 67 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 68 | /// Current FW major version |
davide.aliprandi@st.com | 3:b0128df93d26 | 69 | #define STSPIN240_250_FW_MAJOR_VERSION (uint8_t)(1) |
davide.aliprandi@st.com | 3:b0128df93d26 | 70 | /// Current FW minor version |
davide.aliprandi@st.com | 3:b0128df93d26 | 71 | #define STSPIN240_250_FW_MINOR_VERSION (uint8_t)(0) |
davide.aliprandi@st.com | 3:b0128df93d26 | 72 | /// Current FW patch version |
davide.aliprandi@st.com | 3:b0128df93d26 | 73 | #define STSPIN240_250_FW_PATCH_VERSION (uint8_t)(0) |
davide.aliprandi@st.com | 3:b0128df93d26 | 74 | /// Current FW version |
davide.aliprandi@st.com | 3:b0128df93d26 | 75 | #define STSPIN240_250_FW_VERSION (uint32_t)((STSPIN240_250_FW_MAJOR_VERSION<<16)|\ |
davide.aliprandi@st.com | 3:b0128df93d26 | 76 | (STSPIN240_250_FW_MINOR_VERSION<<8)|\ |
davide.aliprandi@st.com | 3:b0128df93d26 | 77 | (STSPIN240_250_FW_PATCH_VERSION)) |
davide.aliprandi@st.com | 3:b0128df93d26 | 78 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 79 | ///Max number of Brush DC motors |
davide.aliprandi@st.com | 3:b0128df93d26 | 80 | #define STSPIN240_250_NB_MAX_MOTORS (2) |
davide.aliprandi@st.com | 3:b0128df93d26 | 81 | ///Number of Bridges |
davide.aliprandi@st.com | 3:b0128df93d26 | 82 | #define STSPIN240_250_NB_BRIDGES (2) |
davide.aliprandi@st.com | 3:b0128df93d26 | 83 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 84 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 85 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 86 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 87 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 88 | /* Types ---------------------------------------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 89 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 90 | /** @defgroup STSPIN240_250_Exported_Types STSPIN240_250 Exported Types |
davide.aliprandi@st.com | 3:b0128df93d26 | 91 | * @{ |
davide.aliprandi@st.com | 3:b0128df93d26 | 92 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 93 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 94 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 95 | /** @defgroup Device_Parameters Device Parameters |
davide.aliprandi@st.com | 3:b0128df93d26 | 96 | * @{ |
davide.aliprandi@st.com | 3:b0128df93d26 | 97 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 98 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 99 | /// Device Parameters Structure Type |
davide.aliprandi@st.com | 3:b0128df93d26 | 100 | typedef struct { |
davide.aliprandi@st.com | 3:b0128df93d26 | 101 | /// Pwm frequency of the bridge input |
davide.aliprandi@st.com | 3:b0128df93d26 | 102 | uint32_t bridgePwmFreq[STSPIN240_250_NB_BRIDGES]; |
davide.aliprandi@st.com | 3:b0128df93d26 | 103 | /// Pwm frequency of the ref pin |
davide.aliprandi@st.com | 3:b0128df93d26 | 104 | uint32_t refPwmFreq; |
davide.aliprandi@st.com | 3:b0128df93d26 | 105 | /// Pwm Duty Cycle of the ref pin |
davide.aliprandi@st.com | 3:b0128df93d26 | 106 | uint8_t refPwmDc; |
davide.aliprandi@st.com | 3:b0128df93d26 | 107 | /// Speed% (from 0 to 100) of the corresponding motor |
davide.aliprandi@st.com | 3:b0128df93d26 | 108 | uint16_t speed[STSPIN240_250_NB_MAX_MOTORS]; |
davide.aliprandi@st.com | 3:b0128df93d26 | 109 | /// FORWARD or BACKWARD direction of the motors |
davide.aliprandi@st.com | 3:b0128df93d26 | 110 | motorDir_t direction[STSPIN240_250_NB_MAX_MOTORS]; |
davide.aliprandi@st.com | 3:b0128df93d26 | 111 | /// Current State of the motors |
davide.aliprandi@st.com | 3:b0128df93d26 | 112 | motorState_t motionState[STSPIN240_250_NB_MAX_MOTORS]; |
davide.aliprandi@st.com | 3:b0128df93d26 | 113 | /// Current State of the bridges |
davide.aliprandi@st.com | 3:b0128df93d26 | 114 | bool bridgeEnabled[STSPIN240_250_NB_BRIDGES]; |
davide.aliprandi@st.com | 3:b0128df93d26 | 115 | /// Enabling of a dual bridge configuration |
davide.aliprandi@st.com | 3:b0128df93d26 | 116 | bool dualBridgeEnabled; |
davide.aliprandi@st.com | 3:b0128df93d26 | 117 | }deviceParams_t; |
davide.aliprandi@st.com | 3:b0128df93d26 | 118 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 119 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 120 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 121 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 122 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 123 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 124 | |
Davidroid | 4:07acd6934359 | 125 | /** @defgroup STSpin240_250_Initialization_Structure STSpin240_250 Initialization Structure |
davide.aliprandi@st.com | 3:b0128df93d26 | 126 | * @{ |
davide.aliprandi@st.com | 3:b0128df93d26 | 127 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 128 | /* ACTION --------------------------------------------------------------------* |
davide.aliprandi@st.com | 3:b0128df93d26 | 129 | * Declare here the component's initialization structure, if any, one * |
davide.aliprandi@st.com | 3:b0128df93d26 | 130 | * variable per line without initialization. * |
davide.aliprandi@st.com | 3:b0128df93d26 | 131 | * * |
davide.aliprandi@st.com | 3:b0128df93d26 | 132 | * Example: * |
davide.aliprandi@st.com | 3:b0128df93d26 | 133 | * typedef struct * |
davide.aliprandi@st.com | 3:b0128df93d26 | 134 | * { * |
davide.aliprandi@st.com | 3:b0128df93d26 | 135 | * int frequency; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 136 | * int update_mode; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 137 | * } COMPONENT_init_t; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 138 | *----------------------------------------------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 139 | typedef struct { |
davide.aliprandi@st.com | 3:b0128df93d26 | 140 | /* Frequency of the bridge PWMs in Hz up to 100000Hz */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 141 | uint32_t bridgePwmFreq[STSPIN240_250_NB_BRIDGES]; |
davide.aliprandi@st.com | 3:b0128df93d26 | 142 | /* Frequency of the PWM used for Ref pin in Hz up to 100000Hz */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 143 | uint32_t refPwmFreq; |
davide.aliprandi@st.com | 3:b0128df93d26 | 144 | /* Duty cycle of the PWM used for Ref pin in % (0..100) */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 145 | uint8_t refPwmDc; |
davide.aliprandi@st.com | 3:b0128df93d26 | 146 | /* Dual Bridge configuration (0 for mono, 1 for dual brush dc (STSPIN240 only) */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 147 | bool dualBridgeEnabled; |
Davidroid | 4:07acd6934359 | 148 | } STSpin240_250_init_t; |
davide.aliprandi@st.com | 3:b0128df93d26 | 149 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 150 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 151 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 152 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 153 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 154 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 155 | * @brief Powerstep01 driver data structure definition. |
davide.aliprandi@st.com | 3:b0128df93d26 | 156 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 157 | /* ACTION --------------------------------------------------------------------* |
davide.aliprandi@st.com | 3:b0128df93d26 | 158 | * Declare here the structure of component's data, if any, one variable per * |
davide.aliprandi@st.com | 3:b0128df93d26 | 159 | * line without initialization. * |
davide.aliprandi@st.com | 3:b0128df93d26 | 160 | * * |
davide.aliprandi@st.com | 3:b0128df93d26 | 161 | * Example: * |
davide.aliprandi@st.com | 3:b0128df93d26 | 162 | * typedef struct * |
davide.aliprandi@st.com | 3:b0128df93d26 | 163 | * { * |
davide.aliprandi@st.com | 3:b0128df93d26 | 164 | * int T0_out; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 165 | * int T1_out; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 166 | * float T0_degC; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 167 | * float T1_degC; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 168 | * } COMPONENT_Data_t; * |
davide.aliprandi@st.com | 3:b0128df93d26 | 169 | *----------------------------------------------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 170 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 171 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 172 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 173 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 174 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 175 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 176 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 177 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 178 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 179 | /* Functions -----------------------------------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 180 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 181 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 182 | /** @defgroup STSPIN240_250_Board_Linked_Functions STSPIN240_250 Board Linked Functions |
davide.aliprandi@st.com | 3:b0128df93d26 | 183 | * @{ |
davide.aliprandi@st.com | 3:b0128df93d26 | 184 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 185 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 186 | /* ACTION --------------------------------------------------------------------* |
davide.aliprandi@st.com | 3:b0128df93d26 | 187 | * Declare here extern platform-dependent APIs you might need (e.g.: I/O and * |
davide.aliprandi@st.com | 3:b0128df93d26 | 188 | * interrupt related functions), and implement them in a glue-logic file on * |
davide.aliprandi@st.com | 3:b0128df93d26 | 189 | * the target environment, for example within the "x_nucleo_board.c" file. * |
davide.aliprandi@st.com | 3:b0128df93d26 | 190 | * E.g.: * |
davide.aliprandi@st.com | 3:b0128df93d26 | 191 | * extern status_t COMPONENT_IO_Init (void *handle); * |
davide.aliprandi@st.com | 3:b0128df93d26 | 192 | * extern status_t COMPONENT_IO_Read (handle, buf, regadd, bytes); * |
davide.aliprandi@st.com | 3:b0128df93d26 | 193 | * extern status_t COMPONENT_IO_Write(handle, buf, regadd, bytes); * |
davide.aliprandi@st.com | 3:b0128df93d26 | 194 | * extern void COMPONENT_IO_ITConfig(void); * |
davide.aliprandi@st.com | 3:b0128df93d26 | 195 | *----------------------------------------------------------------------------*/ |
davide.aliprandi@st.com | 3:b0128df93d26 | 196 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 197 | ///Delay of the requested number of milliseconds |
Davidroid | 4:07acd6934359 | 198 | extern void STSpin240_250_Board_Delay(void *handle, uint32_t delay); |
davide.aliprandi@st.com | 3:b0128df93d26 | 199 | ///Disable the bridges |
Davidroid | 4:07acd6934359 | 200 | extern void STSpin240_250_Board_DisableBridge(void *handle); |
davide.aliprandi@st.com | 3:b0128df93d26 | 201 | ///Enable the specified bridge |
Davidroid | 4:07acd6934359 | 202 | extern void STSpin240_250_Board_EnableBridge(void *handle, uint8_t addDelay); |
davide.aliprandi@st.com | 3:b0128df93d26 | 203 | //Get the status of the flag and enable Pin |
Davidroid | 4:07acd6934359 | 204 | extern uint8_t STSpin240_250_Board_GetFaultPinState(void *handle); |
davide.aliprandi@st.com | 3:b0128df93d26 | 205 | //Get the status of the reset Pin |
Davidroid | 4:07acd6934359 | 206 | extern uint8_t STSpin240_250_Board_GetResetPinState(void *handle); |
davide.aliprandi@st.com | 3:b0128df93d26 | 207 | ///Set Briges Inputs PWM frequency and start it |
Davidroid | 4:07acd6934359 | 208 | extern void STSpin240_250_Board_PwmSetFreq(void *handle, uint8_t pwmId, uint32_t newFreq, uint8_t duty); |
davide.aliprandi@st.com | 3:b0128df93d26 | 209 | ///Deinitialise the PWM of the specified bridge input |
Davidroid | 4:07acd6934359 | 210 | extern void STSpin240_250_Board_PwmDeInit(void *handle, uint8_t pwmId); |
davide.aliprandi@st.com | 3:b0128df93d26 | 211 | ///init the PWM of the specified bridge input |
Davidroid | 4:07acd6934359 | 212 | extern void STSpin240_250_Board_PwmInit(void *handle, uint8_t pwmId, uint8_t onlyChannel); |
davide.aliprandi@st.com | 3:b0128df93d26 | 213 | ///Stop the PWM of the specified brigde input |
Davidroid | 4:07acd6934359 | 214 | extern void STSpin240_250_Board_PwmStop(void *handle, uint8_t pwmId); |
Davidroid | 4:07acd6934359 | 215 | ///Release the reset pin of the STSpin240 or STSpin250 |
Davidroid | 4:07acd6934359 | 216 | extern void STSpin240_250_Board_ReleaseReset(void *handle, uint8_t deviceId); |
Davidroid | 4:07acd6934359 | 217 | ///Reset the STSpin240 or STSpin250 |
Davidroid | 4:07acd6934359 | 218 | extern void STSpin240_250_Board_Reset(void *handle, uint8_t deviceId); |
davide.aliprandi@st.com | 3:b0128df93d26 | 219 | ///Set direction of the specified bridge |
Davidroid | 4:07acd6934359 | 220 | extern void STSpin240_250_Board_SetDirectionGpio(void *handle, uint8_t bridgeId, uint8_t gpioState); |
davide.aliprandi@st.com | 3:b0128df93d26 | 221 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 222 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 223 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 224 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 225 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 226 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 227 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 228 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 229 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 230 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 231 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 232 | /** |
davide.aliprandi@st.com | 3:b0128df93d26 | 233 | * @} |
davide.aliprandi@st.com | 3:b0128df93d26 | 234 | */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 235 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 236 | #ifdef __cplusplus |
davide.aliprandi@st.com | 3:b0128df93d26 | 237 | } |
davide.aliprandi@st.com | 3:b0128df93d26 | 238 | #endif |
davide.aliprandi@st.com | 3:b0128df93d26 | 239 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 240 | #endif /* #ifndef __STSPIN240_250_H */ |
davide.aliprandi@st.com | 3:b0128df93d26 | 241 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 242 | |
davide.aliprandi@st.com | 3:b0128df93d26 | 243 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |