Exemple #1
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;
}
Exemple #2
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;
}
Exemple #3
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;
}
Exemple #4
0
int main(void)
{
	int i;
	pin_setup();

	/* enable all power supplies */
	enable_1v8_power();
#ifdef HACKRF_ONE
	enable_rf_power();
#endif

	/* Blink LED1/2/3 on the board and Read BOOT0/1/2/3 pins. */
	while (1) 
	{
		boot0 = BOOT0_STATE;
		boot1 = BOOT1_STATE;
		boot2 = BOOT2_STATE;
		boot3 = BOOT3_STATE;

		gpio_set(PORT_LED1_3, (PIN_LED1|PIN_LED2|PIN_LED3)); /* LEDs on */
		for (i = 0; i < 2000000; i++)	/* Wait a bit. */
			__asm__("nop");
		gpio_clear(PORT_LED1_3, (PIN_LED1|PIN_LED2|PIN_LED3)); /* LED off */
		for (i = 0; i < 2000000; i++)	/* Wait a bit. */
			__asm__("nop");
	}

	return 0;
}
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) 
{
	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;
}