/* Your code will start executing here */ int main(void) { /* Call the peripheral setup functions */ setupDAC(); enableDAC(); setupGPIO(); if (energyEfficient) { setupLETimer(); //We don't supply a period here because we want the default value enableLETimer(); } else { setupNormalTimer(HIGH_ENERGY_FREQUENCY / BITRATE); } /* Enable interrupt handling */ setupNVIC(); /* TODO for higher energy efficiency, sleep while waiting for interrupts instead of infinite loop for busy-waiting */ if (energyEfficient) *SCR = 6; else __asm("wfi"); return 0; }
int main(void) { setupSleep(0b110); setupGPIO(); setupNVIC(); // playSong(&SCOM, 0x24FF); // wfi(); return 0; }
void init(void) { setupFlash(); setupClocks(); setupNVIC(); systick_init(SYSTICK_RELOAD_VAL); gpio_init_all(); afio_init(); setupADC(); setupTimers(); setupUSB(); boardInit(); }
void init(void) { setupFlash(); setupClocks(); setupNVIC(); systick_init(SYSTICK_RELOAD_VAL); gpio_init_all(); afio_init(); setupADC(); setupTimers(); // usb_cdcacm_enable(BOARD_USB_DISC_DEV, BOARD_USB_DISC_BIT); boardInit(); }
void init(void) { setupFlash(); setupClocks(); setupNVIC(); systick_init(SYSTICK_RELOAD_VAL); gpio_init_all(); afio_init(); setupADC(); setupTimers(); // setupUSB(); #if !defined(BOARD_STM32VLD) setupUSB(); #endif boardInit(); }
void init(void) { setupFlash(); // ok setupClocks(); // ok setupNVIC(); // ok systick_init(SYSTICK_RELOAD_VAL); // ok gpio_init_all(); // ok afio_init(); // ok setupADC(); // adcs increase mA! setupTimers(); }
/* * @brief stm32 board specific init * @param none * @return none * @note none */ void stm32utils_system_init(void) { setupFlash(); setupClocks(); setupNVIC(); systick_init(SYSTICK_RELOAD_VAL); gpio_init_all(); afio_init(); setupADC(); setupTimers(); setupUSART(USARTx, SERIAL_BAUDRATE); gpio_set_mode(GPIOA, 0, GPIO_OUTPUT_PP); gpio_write_bit(GPIOA, 0, 0); gpio_set_mode(GPIOA, 1, GPIO_OUTPUT_PP); gpio_write_bit(GPIOA, 1, 0); gpio_set_mode(GPIOA, 12, GPIO_OUTPUT_PP); gpio_write_bit(GPIOA, 12, 0); }
int main(void) { /* Call the peripheral setup functions */ setupGPIO(); setupDAC(); setupTimer(SAMPLE_PERIOD); /* Enable interrupt handling */ *SCR = 2; setupNVIC(); __asm volatile("wfi"); /* TODO for higher energy efficiency, sleep while waiting for interrupts instead of infinite loop for busy-waiting */ while(1); return 0; }
void init(void) { setupFlash(); setupClocks(); setupNVIC(); systick_init(SYSTICK_RELOAD_VAL); gpio_init_all(); afio_init(); setupADC(); setupTimers(); setupUSB(); boardInit(); //for debug gpio_set_mode(GPIOA, 2, GPIO_AF_OUTPUT_PP); gpio_set_mode(GPIOA, 3, GPIO_INPUT_FLOATING); usart_init(USART2); usart_set_baud_rate(USART2, STM32_PCLK1, 57600); usart_enable(USART2); /*delay(1000); TxDString("hello pandora\r\n");*/ }
// short_init is used by safecast to do a quick power-on // it's special cased to shorten the "ON" duty-cycle void short_init(void) { setupFlash(); setupClocks(); setupNVIC(); setupTimers(); }