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().
int main | ( | void | ) |
Main function.
References board_init(), IOPORT_PIN_LEVEL_HIGH, IOPORT_PIN_LEVEL_LOW, ioport_set_pin_level(), spi_at25df_mem_check(), spi_enable(), spi_master_init(), spi_master_setup_device(), SPI_MODE_0, and sysclk_init().
|
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().
uint8_t data[DATA_BUFFER_SIZE] = { AT25DF_CMDC_RD_MID_REG } |
First Status Command Register - Second Dummy Data.
struct spi_device SPI_DEVICE_EXAMPLE |