X-CUBE-SPN7 for X-NUCLEO-IHM07M1: C:/Users/giuseppe scuderi-sl/Desktop/MOTOR CONTROL/Peppe/trunk/Firmware/X-CUBE-SPN7-MC-6STEP/Projects/Multi/Examples/MotorControl/Inc/stm32F030_nucleo_ihm07m1.h Source File

X-NUCLEO-IHM07M1 X-CUBE-SPN7

stm32F030_nucleo_ihm07m1.h
Go to the documentation of this file.
1 
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F030_NUCLEO_IHM07M1_H
40 #define __STM32F030_NUCLEO_IHM07M1_H
41 
42  #include "stm32f0xx_hal.h"
43  #include "main_F030.h"
44  #include "X-NUCLEO-IHM07M1.h"
45  #include "X-NUCLEO-IHM07M1.h"
46 
47  #define HF_TIMx htim1
48  #define LF_TIMx htim6
49  #define HALL_ENCODER_TIMx htim2
50  #define ADCx hadc
51  #define REFx htim3
52  #define UART huart2
53 
54  #define GPIO_PORT_1 GPIOC
55  #define GPIO_CH1 GPIO_PIN_10
56  #define GPIO_PORT_2 GPIOC
57  #define GPIO_CH2 GPIO_PIN_11
58  #define GPIO_PORT_3 GPIOC
59  #define GPIO_CH3 GPIO_PIN_12
60  #define GPIO_SET GPIO_PIN_SET
61  #define GPIO_RESET GPIO_PIN_RESET
62 
63  #define ADC_CH_1 ADC_CHANNEL_11 /*CURRENT*/
64  #define ADC_CH_2 ADC_CHANNEL_9 /*SPEED*/
65  #define ADC_CH_3 ADC_CHANNEL_1 /*VBUS*/
66  #define ADC_CH_4 ADC_CHANNEL_12 /*TEMP*/
67  #define ADC_Bemf_CH1 ADC_CHANNEL_13 /*BEMF1*/
68  #define ADC_Bemf_CH2 ADC_CHANNEL_8 /*BEMF2*/
69  #define ADC_Bemf_CH3 ADC_CHANNEL_7 /*BEMF3*/
70 
71  #define ADC_CH_1_ST ADC_SAMPLETIME_1CYCLE_5 /*CURRENT sampling time */
72  #define ADC_CH_2_ST ADC_SAMPLETIME_1CYCLE_5 /*SPEED sampling time*/
73  #define ADC_CH_3_ST ADC_SAMPLETIME_1CYCLE_5 /*VBUS sampling time*/
74  #define ADC_CH_4_ST ADC_SAMPLETIME_1CYCLE_5 /*TEMP sampling time*/
75  #define ADC_Bemf_CH1_ST ADC_SAMPLETIME_1CYCLE_5 /*BEMF1 sampling time*/
76  #define ADC_Bemf_CH2_ST ADC_SAMPLETIME_1CYCLE_5 /*BEMF2 sampling time*/
77  #define ADC_Bemf_CH3_ST ADC_SAMPLETIME_1CYCLE_5 /*BEMF3 sampling time*/
78 
79  #define HF_TIMx_CH1 TIM_CHANNEL_1
80  #define HF_TIMx_CH2 TIM_CHANNEL_2
81  #define HF_TIMx_CH3 TIM_CHANNEL_3
82  #define HF_TIMx_CCR1 CCR1 /*Channel 1*/
83  #define HF_TIMx_CCR2 CCR2 /*Channel 2*/
84  #define HF_TIMx_CCR3 CCR3 /*Channel 3*/
85 
86  #define DAC_ENABLE 0
87  #define DACx htim3
88  #define DAC_CH TIM_CHANNEL_2
89  #define CCRx CCR2
91  #define GPIO_PORT_ZCR GPIOC
92  #define GPIO_CH_ZCR GPIO_PIN_7
93  #define GPIO_PORT_COMM GPIOC
94  #define GPIO_CH_COMM GPIO_PIN_4
96  #define STARTM_CMD 0
97  #define STOPMT_CMD 1
98  #define SETSPD_CMD 2
99  #define GETSPD_CMD 3
100  #define INIREF_CMD 4
101  #define POLESP_CMD 5
102  #define ACCELE_CMD 6
103  #define DMGCTR_CMD 7
104  #define MAXDMG_CMD 8
105  #define MINDMG_CMD 9
106  #define KP_PRM_CMD 10
107  #define KI_PRM_CMD 11
108  #define POTENZ_CMD 12
109  #define HELP_CMD 13
110  #define STATUS_CMD 14
111  #define DIRECT_CMD 15
124  void MC_SixStep_ADC_Channel(uint32_t);
125  void MC_SixStep_Nucleo_Init(void);
126  void START_Ref_Generation(void);
127  void STOP_Ref_Generation(void);
128  void Set_Ref_Generation(uint16_t);
129  void Bemf_delay_calc(void);
130  void START_DAC(void);
131  void STOP_DAC(void);
132  void SET_DAC_value(uint16_t);
133  uint32_t Get_UART_Data(void);
134  void MC_SixStep_EnableInput_CH1_E_CH2_E_CH3_D(void);
135  void MC_SixStep_EnableInput_CH1_E_CH2_D_CH3_E(void);
136  void MC_SixStep_EnableInput_CH1_D_CH2_E_CH3_E(void);
137  void MC_SixStep_DisableInput_CH1_D_CH2_D_CH3_D(void);
138  void MC_SixStep_Start_PWM_driving(void);
139  void MC_SixStep_Stop_PWM_driving(void);
140  void MC_SixStep_HF_TIMx_SetDutyCycle_CH1(uint16_t);
141  void MC_SixStep_HF_TIMx_SetDutyCycle_CH2(uint16_t);
142  void MC_SixStep_HF_TIMx_SetDutyCycle_CH3(uint16_t);
143  void MC_SixStep_Current_Reference_Start(void);
144  void MC_SixStep_Current_Reference_Stop(void);
145  void MC_SixStep_Current_Reference_Setvalue(uint16_t);
146 
154 #endif
155 
uint32_t Get_UART_Data(void)
API function for STM32 instruction.
This file provides the set of functions to manage the X-Nucleo board.
Generated on Fri Sep 11 2015 16:47:21 for X-CUBE-SPN7 for X-NUCLEO-IHM07M1 by   doxygen 1.8.9.1