int main(void)
{
/* Initialize the SAM system */
SystemInit();
/* my initialization */
CLK_GEN_setup(2, CLKSRC_OSC48M | CLKDIV(100));
/* SERCOM1 setup */
pins_function(PORTA, (1111 << 16), FUNC_SERCOM );
SERCOM1_CLK_EN(2);
SERCOM_SYNC_baud(1, 100, 40000);
SERCOM_SPI_CTRLA_setup(1, (SPI_DATA_IN_PAD(0) | SPI_DATA_OUT_PAD(2) | SPI_MASTER | SPI_ENABLE | SPI_MASTER_MODE));
while (1)
{
SERCOM_SPI_8b_write(1, 0b01010101);
while(!SERCOM_SPI_INTFLG_read(1));
}
}
I guess not the most useful as you will need to see the rest in the header files.