Microchip® Advanced Software Framework

spi.c File Reference

SAM Serial Peripheral Interface Driver.

Copyright (c) 2012-2020 Microchip Technology Inc. and its subsidiaries.

#include "spi.h"

Functions

static enum status_code _spi_set_config (struct spi_module *const module, const struct spi_config *const config)
 
enum status_code spi_init (struct spi_module *const module, Sercom *const hw, const struct spi_config *const config)
 Initializes the SERCOM SPI module. More...
 
enum status_code spi_read_buffer_wait (struct spi_module *const module, uint8_t *rx_data, uint16_t length, uint16_t dummy)
 Reads buffer of length SPI characters. More...
 
void spi_reset (struct spi_module *const module)
 Resets the SPI module. More...
 
enum status_code spi_select_slave (struct spi_module *const module, struct spi_slave_inst *const slave, const bool select)
 Selects slave device. More...
 
enum status_code spi_set_baudrate (struct spi_module *const module, uint32_t baudrate)
 Set the baudrate of the SPI module. More...
 
enum status_code spi_transceive_buffer_wait (struct spi_module *const module, uint8_t *tx_data, uint8_t *rx_data, uint16_t length)
 Sends and receives a buffer of length SPI characters. More...
 
enum status_code spi_transceive_wait (struct spi_module *const module, uint16_t tx_data, uint16_t *rx_data)
 Sends and reads a single SPI character. More...
 
enum status_code spi_write_buffer_wait (struct spi_module *const module, const uint8_t *tx_data, uint16_t length)
 Sends a buffer of length SPI characters. More...
 

static enum status_code _spi_set_config ( struct spi_module *const  module,
const struct spi_config *const  config 
)
static