Microchip® Advanced Software Framework

spi_master_example_sam.c File Reference

Example of usage of the SPI Master Mode Basic Services.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "conf_spi_master_example.h"

Macros

#define DATA_BUFFER_SIZE   0x04
 
AT25DF321 Commands
#define AT25DF_CMDC_RD_MID_REG   0x9F
 

Functions

int main (void)
 Main function. More...
 
static bool spi_at25df_mem_check (void)
 Read AT25DF321 manufacturer and device ID, check the density. More...
 

Variables

uint8_t data [DATA_BUFFER_SIZE] = { AT25DF_CMDC_RD_MID_REG }
 First Status Command Register - Second Dummy Data. More...
 
struct spi_device SPI_DEVICE_EXAMPLE
 

#define AT25DF_CMDC_RD_MID_REG   0x9F

Status Register Read (Serial/8-bit Mode).

#define DATA_BUFFER_SIZE   0x04

Referenced by spi_at25df_mem_check().

static bool spi_at25df_mem_check ( void  )
static

Read AT25DF321 manufacturer and device ID, check the density.

References data, DATA_BUFFER_SIZE, spi_deselect_device(), spi_read_packet(), spi_select_device(), and spi_write_packet().

Referenced by main().

First Status Command Register - Second Dummy Data.

struct spi_device SPI_DEVICE_EXAMPLE
Initial value:
= {
.id = SPI_DEVICE_EXAMPLE_ID
}