Microchip® Advanced Software Framework

at25dfx.h File Reference

AT25DFx SerialFlash driver interface.

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

#include <compiler.h>
#include <at25dfx_hal.h>

Data Structures

struct  at25dfx_chip_config
 SerialFlash chip configuration. More...
 
struct  at25dfx_chip_module
 SerialFlash chip driver instance. More...
 

Typedefs

typedef uint32_t at25dfx_address_t
 SerialFlash internal address. More...
 
typedef uint16_t at25dfx_datalen_t
 Length of data package to read/write. More...
 

Enumerations

enum  at25dfx_block_size {
  AT25DFX_BLOCK_SIZE_4KB,
  AT25DFX_BLOCK_SIZE_32KB,
  AT25DFX_BLOCK_SIZE_64KB
}
 Size of block to erase. More...
 
enum  at25dfx_type {
  AT25DFX_512B,
  AT25DFX_021,
  AT25DFX_041A,
  AT25DFX_081,
  AT25DFX_081A,
  AT25DFX_161,
  AT25DFX_L161,
  AT25DFX_Q161,
  AT25DFX_321A,
  AT25DFX_641,
  AT25DFX_041B
}
 SerialFlash type. More...
 

Functions

Initialization
static enum status_code at25dfx_chip_init (struct at25dfx_chip_module *const module, at25dfx_spi_module_t *const spi_module, const struct at25dfx_chip_config *const config)
 Initialize chip driver instance. More...
 
Presence
enum status_code at25dfx_chip_check_presence (struct at25dfx_chip_module *chip)
 Check presence of chip. More...
 
Read/Write
enum status_code at25dfx_chip_read_buffer (struct at25dfx_chip_module *chip, at25dfx_address_t address, void *data, at25dfx_datalen_t length)
 Read data from chip. More...
 
enum status_code at25dfx_chip_write_buffer (struct at25dfx_chip_module *chip, at25dfx_address_t address, const void *data, at25dfx_datalen_t length)
 Write data to chip. More...
 
Erase
enum status_code at25dfx_chip_erase (struct at25dfx_chip_module *chip)
 Erase chip. More...
 
enum status_code at25dfx_chip_erase_block (struct at25dfx_chip_module *chip, at25dfx_address_t address, enum at25dfx_block_size block_size)
 Erase block. More...
 
Sector Protect
enum status_code at25dfx_chip_set_global_sector_protect (struct at25dfx_chip_module *chip, bool protect)
 Set sector protection globally. More...
 
enum status_code at25dfx_chip_set_sector_protect (struct at25dfx_chip_module *chip, at25dfx_address_t address, bool protect)
 Set protection setting of a single sector. More...
 
enum status_code at25dfx_chip_get_sector_protect (struct at25dfx_chip_module *chip, at25dfx_address_t address, bool *protect)
 Get protection setting of a single sector. More...
 
Sleep/Wake
enum status_code at25dfx_chip_sleep (struct at25dfx_chip_module *chip)
 Put device to sleep. More...
 
enum status_code at25dfx_chip_wake (struct at25dfx_chip_module *chip)
 Wake device from sleep. More...