This quick start will receive, transmit and transceive bytes on the EXT1 header.
In this use case the SERCOM SPI will be configured with the following settings:
There are no special setup requirements for this use-case.
Add to the main application source file, outside of any functions:
If not already present, add to the initialization code:
Add to the initialization code:
Create an instance of the driver to operate on.
In the initialization code, add a config struct for the driver.
Initialize the config struct and change to the desired configuration.
Initialize the device instance with the configuration and SERCOM to use.
Add to the application code:
Enable the SERCOM module before using it.
Start and wait for first transfer: receive 5 bytes, 3 of which will be written into the RX buffers.
Start transmission of the 6 bytes from TX buffers.
Keep trying to start next transfer until it succeeds: transmit the 6 bytes from the TX buffers and receive 5 bytes, writing 3 of them into the RX buffers simultaneously.
Wait for transfer to complete.