int main(void) { cpu_clock_init(); cpu_clock_pll1_max_speed(); rtc_init(); pin_setup(); /* Blink LED1/2/3/4 on the board. */ while (1) { led_on(LED1); led_off(LED2); led_on(LED3); led_off(LED4); delay(5000000); led_off(LED1); led_on(LED2); led_off(LED3); led_on(LED4); delay(5000000); } return 0; }
int main(void) { cpu_clock_init(); /* CPU Clock is now 104 MHz */ ssp_clock_init(); systickInit(); SETUPgout(EN_VDD); SETUPgout(MIXER_EN); SETUPgout(MIC_AMP_DIS); SETUPgout(LED1); SETUPgout(LED2); SETUPgout(LED3); SETUPgout(LED4); inputInit(); lcdInit(); lcdFill(0xff); lcdPrintln("Flash-App"); lcdNl(); lcdDisplay(); cpld_flash(); cpu_clock_set(50); full_msc(); return 0; }
int main(void) { pin_setup(); enable_1v8_power(); cpu_clock_init(); scs_dwt_cycle_counter_enabled(); systick_setup(); led_on(LED1); led_on(LED2); led_on(LED3); while (1) { led_on(LED1); led_on(LED2); led_on(LED3); sys_tick_wait_time_ms(500); led_off(LED1); led_off(LED2); led_off(LED3); sys_tick_wait_time_ms(500); } return 0; }
/** * @brief Initialize the CPU, set IRQ priorities */ void cpu_init(void) { /* initialize the Cortex-M core */ cortexm_init(); /* initialize the clock system */ cpu_clock_init(); }
int main(void) { const uint32_t freq = 2441000000U; pin_setup(); gpio_set(PORT_EN1V8, PIN_EN1V8); /* 1V8 on */ cpu_clock_init(); ssp1_init(); gpio_set(PORT_LED1_3, (PIN_LED1)); /* LED1 on */ ssp1_set_mode_max2837(); max2837_setup(); rffc5071_setup(); gpio_set(PORT_LED1_3, (PIN_LED2)); /* LED2 on */ max2837_set_frequency(freq); max2837_start(); max2837_tx(); gpio_set(PORT_LED1_3, (PIN_LED3)); /* LED3 on */ while (1); max2837_stop(); return 0; }
int main(void) { cpu_clock_init(); /* CPU Clock is now 104 MHz */ systickInit(); // cpu_clock_set(204); SETUPgout(EN_VDD); SETUPgout(MIXER_EN); SETUPgout(MIC_AMP_DIS); SETUPgout(LED1); SETUPgout(LED2); SETUPgout(LED3); SETUPgout(LED4); inputInit(); lcdInit(); fsInit(); lcdFill(0xff); readConfig(); generated_init(); while(1){ // if(getInput()){ handleMenu(&menu_main); getInputWaitRelease(); // }; // fancyNickname(); }; return 0; }
int main(void) { int i; uint8_t buf[515]; pin_setup(); enable_1v8_power(); cpu_clock_init(); /* program test data to SPI flash */ for (i = 0; i < 515; i++) buf[i] = (i * 3) & 0xFF; w25q80bv_setup(); w25q80bv_chip_erase(); w25q80bv_program(790, 515, &buf[0]); /* blink LED1 and LED3 */ while (1) { gpio_set(PORT_LED1_3, (PIN_LED1|PIN_LED3)); /* LEDs on */ for (i = 0; i < 8000000; i++) /* Wait a bit. */ __asm__("nop"); gpio_clear(PORT_LED1_3, (PIN_LED1|PIN_LED3)); /* LED off */ for (i = 0; i < 8000000; i++) /* Wait a bit. */ __asm__("nop"); } return 0; }
int main(void) { pin_setup(); enable_1v8_power(); cpu_clock_init(); scs_dwt_cycle_counter_enabled(); systick_setup(); gpio_set(PORT_LED1_3, (PIN_LED1|PIN_LED2|PIN_LED3)); /* LEDs on */ while (1) { gpio_set(PORT_LED1_3, (PIN_LED1)); /* LED1 on */ gpio_set(PORT_LED1_3, (PIN_LED2)); /* LED2 on */ gpio_set(PORT_LED1_3, (PIN_LED3)); /* LED3 on */ sys_tick_wait_time_ms(500); gpio_clear(PORT_LED1_3, (PIN_LED3)); /* LED3 off */ gpio_clear(PORT_LED1_3, (PIN_LED2)); /* LED2 off */ gpio_clear(PORT_LED1_3, (PIN_LED1)); /* LED1 off */ sys_tick_wait_time_ms(500); } return 0; }
/** * @brief Initialize the CPU, set IRQ priorities */ void cpu_init(void) { /* initialize the Cortex-M core */ cortexm_init(); /* initialize the clock system */ cpu_clock_init(); /* trigger static peripheral initialization */ periph_init(); }
/** * @brief Initialize the CPU, set IRQ priorities */ void cpu_init(void) { /* initialize the Cortex-M core */ cortexm_init(); /* Enable the CC2538's more compact alternate interrupt mapping */ SYS_CTRL->I_MAP = 1; /* initialize the clock system */ cpu_clock_init(); }
/** * @brief Initialize the CPU, set IRQ priorities */ void cpu_init(void) { /* initialize the Cortex-M core */ cortexm_init(); /* chip initialization */ CHIP_Init(); SystemInit(); /* initialize the clock system */ cpu_clock_init(); }
/** * @brief Initialize the CPU, set IRQ priorities */ void cpu_init(void) { /* configure the vector table location to internal flash */ SCB->VTOR = FLASH_BASE; /* initialize the clock system */ cpu_clock_init(); /* set pendSV interrupt to lowest possible priority */ NVIC_SetPriority(PendSV_IRQn, 0xff); }
int main(uint32_t startloc) { cpu_clock_init(); ssp_clock_init(); systickInit(); // cpu_clock_set(204); SETUPgout(EN_VDD); SETUPgout(MIXER_EN); SETUPgout(MIC_AMP_DIS); SETUPgout(LED1); SETUPgout(LED2); SETUPgout(LED3); SETUPgout(LED4); inputInit(); flashInit(); lcdInit(); fsInit(); lcdFill(0xff); /* Display BL Image here */ sli=startloc; if (startloc != (uintptr_t)&_app_start){ /* not booted via DFU, do autoboot */ char filename[FLEN]; switch(getInputRaw()){ case BTN_LEFT: getInputWaitRelease(); doRealExec(1); break; case BTN_UP: doMSC(); default: case BTN_NONE: readTextFile(BOOTCFG, filename, FLEN); lcdPrintln("Booting:"); lcdPrintln(filename); bootFile(filename); break; }; }; static const struct MENU main={ "Bootloader", { { "Exec Firmware", &doExec}, { "MSC", &doMSC}, { "Flash Boot Ldr", &doFlash}, { "Info", &doInfo}, {NULL,NULL} }}; do { handleMenu(&main); }while(1); }
int main(void) { pin_setup(); enable_1v8_power(); cpu_clock_init(); ssp1_init(); gpio_set(PORT_LED1_3, PIN_LED1); //test_sgpio_sliceA_D(); test_sgpio_interface(); //test_sgpio_all_slices(); while(1); return 0; }
int main(void) { cpu_clock_init(); ssp_clock_init(); inputInit(); lcdInit(); lcdFill(0xff); OFF(MIXER_EN); static const struct MENU main={ "img test", { { "LCD", &doLCD}, {NULL,NULL} }}; handleMenu(&main); return 0; }
int main(uint32_t startloc) { cpu_clock_init(); ssp_clock_init(); systick_set_reload(208000); systick_set_clocksource(0); systick_interrupt_enable(); systick_counter_enable(); // cpu_clock_pll1_max_speed(); SETUPgout(EN_VDD); SETUPgout(MIXER_EN); SETUPgout(LED1); SETUPgout(LED2); SETUPgout(LED3); SETUPgout(LED4); inputInit(); flashInit(); lcdInit(); fsInit(); lcdFill(0xff); /* Display BL Image here */ sli=startloc; if (startloc != (uintptr_t)&_app_start){ /* not booted via DFU, do autoboot */ if (getInputRaw()!=BTN_LEFT){ char filename[FLEN]; readTextFile(BOOTCFG, filename, FLEN); lcdPrintln("Fname"); lcdPrintln(filename); bootFile(filename,0); }; }; static const struct MENU main={ "Bootloader", { { "Info", &doInfo}, { "Exec", &doExec}, { "Flash", &doFlash}, {NULL,NULL} }}; handleMenu(&main); return 0; }
int main(void) { pin_setup(); enable_1v8_power(); cpu_clock_init(); ssp1_init(); CGU_BASE_PERIPH_CLK = (CGU_BASE_CLK_AUTOBLOCK | (CGU_SRC_PLL1 << CGU_BASE_CLK_SEL_SHIFT)); CGU_BASE_APB1_CLK = (CGU_BASE_CLK_AUTOBLOCK | (CGU_SRC_PLL1 << CGU_BASE_CLK_SEL_SHIFT)); gpio_set(PORT_LED1_3, PIN_LED1); //test_sgpio_sliceA_D(); test_sgpio_interface(); //test_sgpio_all_slices(); while(1); return 0; }
int main(void) { pin_setup(); gpio_set(PORT_EN1V8, PIN_EN1V8); /* 1V8 on */ cpu_clock_init(); scs_dwt_cycle_counter_enabled(); systick_setup(); gpio_clear(PORT_LED1_3, (PIN_LED1)); /* LED1 off */ /* Test number of instruction per second (MIPS) slow blink ON 1s, OFF 1s */ LED1_TOGGLE(); nb_inst_per_sec[0] = test_nb_instruction_per_sec_100_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[1]= test_nb_instruction_per_sec_105_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[2]= test_nb_instruction_per_sec_110_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[3]= test_nb_instruction_per_sec_115_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[4] = test_nb_instruction_per_sec_120_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[5] = test_nb_instruction_per_sec_150_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[6] = test_nb_instruction_per_sec_200_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[7] = test_nb_instruction_per_sec_1000_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[8] = test_nb_instruction_per_sec_100_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[9]= test_nb_instruction_per_sec_105_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[10]= test_nb_instruction_per_sec_110_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[11]= test_nb_instruction_per_sec_115_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[12] = test_nb_instruction_per_sec_120_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[13] = test_nb_instruction_per_sec_150_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[14] = test_nb_instruction_per_sec_200_nop_asm(); LED1_TOGGLE(); nb_inst_per_sec[15] = test_nb_instruction_per_sec_1000_nop_asm(); LED1_TOGGLE(); /* Test finished fast blink */ while (1) { gpio_set(PORT_LED1_3, (PIN_LED1)); /* LED1 on */ gpio_set(PORT_LED1_3, (PIN_LED2)); /* LED2 on */ gpio_set(PORT_LED1_3, (PIN_LED3)); /* LED3 on */ sys_tick_wait_time_ms(250); gpio_clear(PORT_LED1_3, (PIN_LED3)); /* LED3 off */ gpio_clear(PORT_LED1_3, (PIN_LED2)); /* LED2 off */ gpio_clear(PORT_LED1_3, (PIN_LED1)); /* LED1 off */ sys_tick_wait_time_ms(250); } return 0; }