Examples Folder

Application level example functions are provided in examples\driver_examples.c. When we develop an application in the main.c file, these functions may be useful to call and adapt (if required), in order to very quickly build and test peripheral functionality. For example, a function to call “Hello World!” is provided for the USART.

/**
 * Example of using USART_0 to write "Hello World" using the IO abstraction.
 */void USART_0_example(void)
{
    struct io_descriptor *io;
    usart_sync_get_io_descriptor(&USART_0, &io);
    usart_sync_enable(&USART_0);

    io_write(io, (uint8_t *)"Hello World!", 12);
}

If you have added the USART driver only, you will find USART related functions only as this is the only peripheral that has been added to the project and configured in Atmel START.

Example functions are grouped into separate folders, which can easily be deleted if not needed so that the final project contains the production code only.