X-CUBE-SPN11 for X-NUCLEO-IHM11M1: main_F401.c File Reference

X-CUBE-SPN11 for X-NUCLEO-IHM11M1

main_F401.c File Reference

This file provides a set of functions needed to configure STM32 MCU. More...

#include "stm32f4xx_hal.h" #include "6Step_Lib.h"

Go to the source code of this file.

Functions

void SystemClock_Config (void)
 System Clock Configuration. More...
 
static void MX_ADC1_Init (void)
 
static void MX_TIM1_Init (void)
 
static void MX_TIM3_Init (void)
 
static void MX_TIM4_Init (void)
 
static void MX_USART2_UART_Init (void)
 
int main (void)
 

Variables

ADC_HandleTypeDef hadc1
 
TIM_HandleTypeDef htim1
 
TIM_HandleTypeDef htim2
 
TIM_HandleTypeDef htim3
 
TIM_HandleTypeDef htim4
 
UART_HandleTypeDef huart2
 

Detailed Description

This file provides a set of functions needed to configure STM32 MCU.

Author
IPC
Version
V0
Date
10/07/2016
Attention

© COPYRIGHT(c) 2015 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file main_F401.c.

Function Documentation

int main ( void  )

**************************************************************************

###### How to use the 6Step FW Example project ######

This workspace contains the middleware layer with Motor Control library to drive a motor connected on X-Nucleo board performing a 6-step control algorithm allowing the motor speed regulation through a potentiometer. The 6-step algorithm is based on 1shunt current sensing mode and sensorless algorithm for bEmf detection. The workspace is provided for STM32Fxx-Nucleo in four different configurations, normal, demo, comm mode, boot mode. The "normal" mode waits the blue button event to start the motor, the "demo" mode starts and stop the motor automatically, the "comm" mode enables the communication protocol with external PC terminal and the "boot" mode enables the FW for external boot loader.

A list of APIs is provided to send command to 6Step lib, for instance:

(#) MC_StartMotor() -> Start the motor

(#) MC_StoptMotor() -> Stop the motor

(#) MC_Set_Speed(...) -> Set the new motor speed

The MC_SixStep_param.h contains the full list of MC parameters


###### USER SPACE ######

Definition at line 74 of file main_F401.c.

References MC_SixStep_INIT(), MX_ADC1_Init(), MX_TIM1_Init(), MX_TIM3_Init(), MX_TIM4_Init(), MX_USART2_UART_Init(), and SystemClock_Config().

void MX_ADC1_Init ( void  )
static

Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)

Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.

Definition at line 180 of file main_F401.c.

References hadc1.

Referenced by main().

void MX_TIM1_Init ( void  )
static

Definition at line 213 of file main_F401.c.

References htim1.

Referenced by main().

void MX_TIM3_Init ( void  )
static

Definition at line 271 of file main_F401.c.

References htim3.

Referenced by main().

void MX_TIM4_Init ( void  )
static

Definition at line 304 of file main_F401.c.

References htim4.

Referenced by main().

void MX_USART2_UART_Init ( void  )
static

Definition at line 327 of file main_F401.c.

References huart2.

Referenced by main().

void SystemClock_Config ( void  )

System Clock Configuration.

Definition at line 149 of file main_F401.c.

Referenced by main().

Variable Documentation

ADC_HandleTypeDef hadc1

Definition at line 46 of file main_F401.c.

Referenced by ADC_IRQHandler(), MC_SixStep_Nucleo_Init(), and MX_ADC1_Init().

TIM_HandleTypeDef htim1

Definition at line 48 of file main_F401.c.

Referenced by MC_SixStep_Nucleo_Init(), MX_TIM1_Init(), and TIM1_BRK_TIM9_IRQHandler().

TIM_HandleTypeDef htim2

Definition at line 49 of file main_F401.c.

TIM_HandleTypeDef htim3

Definition at line 50 of file main_F401.c.

Referenced by MX_TIM3_Init().

TIM_HandleTypeDef htim4

Definition at line 51 of file main_F401.c.

Referenced by MX_TIM4_Init(), and TIM4_IRQHandler().

UART_HandleTypeDef huart2

Definition at line 53 of file main_F401.c.

Referenced by MX_USART2_UART_Init(), and USART2_IRQHandler().

Generated by   doxygen 1.8.11