| |||||
Technical Support On-Line Manuals MCBSTM32 User's Guide | Using STM32_Init.cThe file STM32_Init.c is part of every example. It contains the initialization of the clocks, independent watchdog (IWDG), system timer (SysTick), realtime clock (RTC), Timers, USARTs, general purpose I/O (GPIO) and embedded Flash interface (EFI). The Configuration Wizard makes it easy to configure these peripherals. File STM32_Init.c provides the function void stm32_Init (void) which initializes the peripherals according the selected configuration. Call stm32_Init() at the beginning of your int main (void) function.
/*------------------------------------------------------------------------
MAIN function
*----------------------------------------------------------------------*/
int main (void) {
stm32_Init (); // STM32 setup
// ... add a your code here
while (1) { // Loop forever
// ... add your code here
} // end while
} // end main
The following peripherals may be configured: Clock Configuration
Independent Watchdog Configuration
System Timer Configuration
Realtime clock Configuration
Timer Configuration For each timer (TIM1..TIM4) it is possible to change the following settings:
Under detailed settings it is possible to set the contents of the single timer register. If detailed settings is checked than the settings for period and repetition counter are ignored. USART Configuration For each USART (USART1..USART3) it is possible to change the following settings:
Tamper Configuration For Tamper detection it is possible to change the following settings:
External Interrupt/Event Configuration For each external line (EXTI0..EXTI15) it is possible to change the following settings:
Alternate Function Remap Configuration For some peripherals it is possible to remap the used pins:
General Purpose I/O Configuration For each GPIO register (GPIOA..GPIOE) change the configuration of every single pin. Embedded Flash Configuration
Note
| ||||
| |||||