38 #ifndef __STM32F103_NUCLEO_IHM07M1_H
39 #define __STM32F103_NUCLEO_IHM07M1_H
41 #include "stm32f1xx_hal.h"
42 #include "main_F103.h"
47 #define HALL_ENCODER_TIMx htim2
52 #define GPIO_PORT_1 GPIOC
53 #define GPIO_CH1 GPIO_PIN_10
54 #define GPIO_PORT_2 GPIOC
55 #define GPIO_CH2 GPIO_PIN_11
56 #define GPIO_PORT_3 GPIOC
57 #define GPIO_CH3 GPIO_PIN_12
58 #define GPIO_SET GPIO_PIN_SET
59 #define GPIO_RESET GPIO_PIN_RESET
61 #define ADC_CH_1 ADC_CHANNEL_11
62 #define ADC_CH_2 ADC_CHANNEL_9
63 #define ADC_CH_3 ADC_CHANNEL_1
64 #define ADC_CH_4 ADC_CHANNEL_12
65 #define ADC_Bemf_CH1 ADC_CHANNEL_13
66 #define ADC_Bemf_CH2 ADC_CHANNEL_8
67 #define ADC_Bemf_CH3 ADC_CHANNEL_7
69 #define ADC_CH_1_ST ADC_SAMPLETIME_1CYCLE_5
70 #define ADC_CH_2_ST ADC_SAMPLETIME_28CYCLES_5
71 #define ADC_CH_3_ST ADC_SAMPLETIME_28CYCLES_5
72 #define ADC_CH_4_ST ADC_SAMPLETIME_28CYCLES_5
73 #define ADC_Bemf_CH1_ST ADC_SAMPLETIME_28CYCLES_5
74 #define ADC_Bemf_CH2_ST ADC_SAMPLETIME_28CYCLES_5
75 #define ADC_Bemf_CH3_ST ADC_SAMPLETIME_28CYCLES_5
77 #define HF_TIMx_CH1 TIM_CHANNEL_1
78 #define HF_TIMx_CH2 TIM_CHANNEL_2
79 #define HF_TIMx_CH3 TIM_CHANNEL_3
80 #define HF_TIMx_CCR1 CCR1
81 #define HF_TIMx_CCR2 CCR2
82 #define HF_TIMx_CCR3 CCR3
86 #define DAC_CH TIM_CHANNEL_2
89 #define GPIO_PORT_ZCR GPIOC
90 #define GPIO_CH_ZCR GPIO_PIN_7
91 #define GPIO_PORT_COMM GPIOC
92 #define GPIO_CH_COMM GPIO_PIN_4
104 #define KP_PRM_CMD 10
105 #define KI_PRM_CMD 11
106 #define POTENZ_CMD 12
108 #define STATUS_CMD 14
109 #define DIRECT_CMD 15
122 void MC_SixStep_ADC_Channel(uint32_t);
123 void MC_SixStep_Nucleo_Init(
void);
124 void START_Ref_Generation(
void);
125 void STOP_Ref_Generation(
void);
126 void Set_Ref_Generation(uint16_t);
127 void START_DAC(
void);
129 void SET_DAC_value(uint16_t);
130 void Bemf_delay_calc(
void);
132 void MC_SixStep_EnableInput_CH1_E_CH2_E_CH3_D(
void);
133 void MC_SixStep_EnableInput_CH1_E_CH2_D_CH3_E(
void);
134 void MC_SixStep_EnableInput_CH1_D_CH2_E_CH3_E(
void);
135 void MC_SixStep_DisableInput_CH1_D_CH2_D_CH3_D(
void);
136 void MC_SixStep_Start_PWM_driving(
void);
137 void MC_SixStep_Stop_PWM_driving(
void);
138 void MC_SixStep_HF_TIMx_SetDutyCycle_CH1(uint16_t);
139 void MC_SixStep_HF_TIMx_SetDutyCycle_CH2(uint16_t);
140 void MC_SixStep_HF_TIMx_SetDutyCycle_CH3(uint16_t);
141 void MC_SixStep_Current_Reference_Start(
void);
142 void MC_SixStep_Current_Reference_Stop(
void);
143 void MC_SixStep_Current_Reference_Setvalue(uint16_t);
uint32_t Get_UART_Data(void)
API function for STM32 instruction.
This file provides the set of functions to manage the X-Nucleo board.