void system_setup(void) { clock_setup(); mco_setup(); usb_setup(); systick_setup(); rng_setup(); battery_setup(); speaker_setup(); jack_setup(); // setup pad and screen interface_setup(); // setup and reset SAM2695 sam2695_setup(); wait_ms(100); sam2695_reset(); usbmidi_setup(); // init gfx and fill screen gfx_init(ssd1306_drawpixel, SSD1306_WIDTH, SSD1306_HEIGHT, GFX_FONT_SMALL); gfx_setRotation(GFX_ROT_180); gfx_fillScreen(OLED_BLACK); gfx_setTextColor(OLED_WHITE, OLED_BLACK); // gfx_setTextWrap(1); gfx_setTextSize(1); ssd1306_display(); }
int main(void) { uint16_t printer_data = 0xff; clock_setup(); gpio_setup(); mco_setup(); usart_setup(); spi_setup(); //timer_setup(); systick_setup(SYSTICK_FREQ); print("Hello from STM32F0\n"); // StepperMotor engine(GPIOA, M1,M2,M3,M4); //gpio_port_write(GPIOA,0); // gpio_set(GPIOA,GPIO1); //engine.step(100); while (1) { printer_send(printer_data); engine.step(1); delay(200); //engine.step(1); /* for(i = 0; i < sizeof(steps)/sizeof(steps[0]);i++) { gpio_port_write(GPIOA,steps[i]); delay(3); } */ }; }
int main(void) { clock_setup(); gpio_setup(); mco_setup(); /* setup systick to generate 2 LED flashes per second */ systick_setup(8); /* Do nothing in main loop */ while (1); }
int main(void) { clock_setup(); gpio_setup(); mco_setup(); /* 125ms ticks => 250ms period => 4Hz blinks */ systick_setup(125); /* Do nothing in main loop */ while (1); }
int main(void) { cm_disable_interrupts(); clk_tree_setup(); mco_setup(); clock_setup(); usb_setup(); cli_setup(); pwm_init(); led_setup(); button_setup(); ncn_setup(); cm_enable_interrupts(); while (1) { __WFI(); } return 0; }