X-CUBE-SPN1-20150128 example source code for one motor compiled under mbed. Tested OK on Nucleo F401. l6474.cpp is modified from original with defines in l6474_target_config.h to select the original behaviour (motor de-energised when halted), or new mode to continue powering with a (reduced) current in the coils (braking/position hold capability). On F401 avoid using mbed's InterruptIn on pins 10-15 (any port). Beware of other conflicts! L0 & F0 are included but untested.

Dependencies:   mbed

Committer:
gregeric
Date:
Tue Oct 13 10:46:01 2015 +0000
Revision:
6:19c1b4a04c24
Parent:
5:615cacd7d036
Ensure bridge is disabled before resetting the L6474.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gregeric 0:b9444a40a999 1 /**
gregeric 0:b9444a40a999 2 ******************************************************************************
gregeric 0:b9444a40a999 3 * @file Multi/Examples/MotionControl/IHM01A1_ExampleFor1Motor/Inc/stm32f0xx_it.h
gregeric 0:b9444a40a999 4 * @author IPC Rennes
gregeric 0:b9444a40a999 5 * @version V1.5.0
gregeric 0:b9444a40a999 6 * @date November 12, 2014
gregeric 0:b9444a40a999 7 * @brief This file contains the headers of the interrupt handlers.
gregeric 0:b9444a40a999 8 ******************************************************************************
gregeric 0:b9444a40a999 9 * @attention
gregeric 0:b9444a40a999 10 *
gregeric 0:b9444a40a999 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
gregeric 0:b9444a40a999 12 *
gregeric 0:b9444a40a999 13 * Redistribution and use in source and binary forms, with or without modification,
gregeric 0:b9444a40a999 14 * are permitted provided that the following conditions are met:
gregeric 0:b9444a40a999 15 * 1. Redistributions of source code must retain the above copyright notice,
gregeric 0:b9444a40a999 16 * this list of conditions and the following disclaimer.
gregeric 0:b9444a40a999 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
gregeric 0:b9444a40a999 18 * this list of conditions and the following disclaimer in the documentation
gregeric 0:b9444a40a999 19 * and/or other materials provided with the distribution.
gregeric 0:b9444a40a999 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
gregeric 0:b9444a40a999 21 * may be used to endorse or promote products derived from this software
gregeric 0:b9444a40a999 22 * without specific prior written permission.
gregeric 0:b9444a40a999 23 *
gregeric 0:b9444a40a999 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
gregeric 0:b9444a40a999 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
gregeric 0:b9444a40a999 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
gregeric 0:b9444a40a999 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
gregeric 0:b9444a40a999 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
gregeric 0:b9444a40a999 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
gregeric 0:b9444a40a999 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
gregeric 0:b9444a40a999 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
gregeric 0:b9444a40a999 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
gregeric 0:b9444a40a999 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
gregeric 0:b9444a40a999 34 *
gregeric 0:b9444a40a999 35 ******************************************************************************
gregeric 0:b9444a40a999 36 */
gregeric 0:b9444a40a999 37 #ifdef TARGET_STM32F0
gregeric 0:b9444a40a999 38 /* Define to prevent recursive inclusion -------------------------------------*/
gregeric 0:b9444a40a999 39 #ifndef __STM32F0xx_IT_H
gregeric 0:b9444a40a999 40 #define __STM32F0xx_IT_H
gregeric 0:b9444a40a999 41
gregeric 0:b9444a40a999 42 #ifdef __cplusplus
gregeric 0:b9444a40a999 43 extern "C" {
gregeric 0:b9444a40a999 44 #endif
gregeric 0:b9444a40a999 45
gregeric 0:b9444a40a999 46 /* Includes ------------------------------------------------------------------*/
gregeric 5:615cacd7d036 47 #include "ihm01a1.h"
gregeric 0:b9444a40a999 48
gregeric 0:b9444a40a999 49 /* Exported types ------------------------------------------------------------*/
gregeric 0:b9444a40a999 50 /* Exported constants --------------------------------------------------------*/
gregeric 0:b9444a40a999 51 /* Exported macro ------------------------------------------------------------*/
gregeric 0:b9444a40a999 52 /* Exported functions ------------------------------------------------------- */
gregeric 0:b9444a40a999 53
gregeric 0:b9444a40a999 54 void NMI_Handler(void);
gregeric 0:b9444a40a999 55 void HardFault_Handler(void);
gregeric 0:b9444a40a999 56 void SVC_Handler(void);
gregeric 0:b9444a40a999 57 void PendSV_Handler(void);
gregeric 0:b9444a40a999 58 void SysTick_Handler(void);
gregeric 0:b9444a40a999 59
gregeric 0:b9444a40a999 60 void EXTI4_15_IRQHandler(void);
gregeric 0:b9444a40a999 61 void TIM3_IRQHandler(void);
gregeric 0:b9444a40a999 62 void TIM14_IRQHandler(void);
gregeric 0:b9444a40a999 63 void TIM15_IRQHandler(void);
gregeric 0:b9444a40a999 64
gregeric 0:b9444a40a999 65 #ifdef __cplusplus
gregeric 0:b9444a40a999 66 }
gregeric 0:b9444a40a999 67 #endif
gregeric 0:b9444a40a999 68
gregeric 0:b9444a40a999 69 #endif /* __STM32F0xx_IT_H */
gregeric 0:b9444a40a999 70
gregeric 0:b9444a40a999 71 #endif
gregeric 0:b9444a40a999 72 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/