Dies ist eine alte Version des Dokuments!
Hallo Welt in C für das mySTM32 Board Light
//--------------------------------------------------------------------------- // Title : Hello STM32 World, ARM C application in SiSy //--------------------------------------------------------------------------- // Function : ... // Wiring : ... //--------------------------------------------------------------------------- // Hardware : ... // Clock : ... MHz // Language : ARM C // Date : ... // Version : ... // Author : ... //--------------------------------------------------------------------------- #include <stddef.h> #include <stdlib.h> #include "hardware.h" void initApplication() { // config 10ms SystemTimer SysTick_Config(SystemCoreClock/100); // user initializations here RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB,ENABLE); GPIO_InitTypeDef led; led.GPIO_Mode = GPIO_Mode_OUT; led.GPIO_OType = GPIO_OType_PP; led.GPIO_Pin = GPIO_Pin_0; led.GPIO_PuPd = GPIO_PuPd_NOPULL; led.GPIO_Speed = GPIO_Speed_2MHz; GPIO_Init(GPIOB,&led); } int main(void) { SystemInit(); initApplication(); do{ GPIO_ToggleBits(GPIOB,GPIO_Pin_0); waitMs(200); } while (true); return 0; } extern "C" void SysTick_Handler(void) { // Application SysTick default 10ms } //------------------------------------------------------------------------------
Version mit der STM32 HAL Library
…
Version mit der STM32 LL Library
…