Example #1
0
static void bus_spi_write(uint8_t c)
{
    spi_write8(c);
    console_puts("WRITE: 0x");
    console_puthex8(c);
    console_newline();
}
Example #2
0
static void bus_spi_read(void)
{
    uint8_t c;
    c = spi_write8(0xFF);
    console_puts("READ: 0x");
    console_puthex8(c);
    console_newline();
}
Example #3
0
int main(void)
{
    /* Bring up processor */
	cpu_init();
    watchdog_init();

#ifdef CONFIG_HW_LED_ALIVE_CHECK
    /* Bring up low level LED */
    hw_led_init();
#endif
#ifdef CONFIG_HW_UART
    /* Bring up low level hardware UART */
    hw_uart_init();
#endif
    /* Setup timer for tick counting */
    tick_init();

    /* Bring up high level LED */
    led_init();

    /* Bring up console */
    console_init();

#ifdef CONFIG_DEBUG_RESET_REASON
    /* Report reason for last reset */
    console_puts_P(PSTR("Reset cause:"));
    console_puthex8(MCUSR);
    console_newline();
#endif

    /* Set default LED pattern */
    led_set_seq(LED_SEQ_SINE);

#ifdef CONFIG_USBDEV
    usbdev_init(USBMODE_DEFAULT);
#endif

    /* HiZ bus mode selected by default */
    bus_init(&bus_hiz);

    /* Enable interrupts */
    cpu_enable_int();

    while(1)
	{
        driver_tick();
	}
}