Microchip® Advanced Software Framework

at45dbx_mem.h File Reference

CTRL_ACCESS interface for the AT45DBX data flash driver.

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

#include "conf_access.h"
#include "ctrl_access.h"

Functions

Control Interface
Ctrl_status at45dbx_test_unit_ready (void)
 Tests the memory state and initializes the memory if required. More...
 
Ctrl_status at45dbx_read_capacity (U32 *u32_nb_sector)
 Returns the address of the last valid sector in the memory. More...
 
bool at45dbx_wr_protect (void)
 Returns the write-protection state of the memory. More...
 
bool at45dbx_removal (void)
 Tells whether the memory is removable. More...
 
bool at45dbx_unload (bool unload)
 Unload/load the memory. More...
 
MEM <-> RAM Interface
Ctrl_status at45dbx_df_2_ram (U32 addr, void *ram)
 Copies 1 data sector from the memory to RAM. More...
 
Ctrl_status at45dbx_ram_2_df (U32 addr, const void *ram)
 Copies 1 data sector from RAM to the memory. More...
 

Ctrl_status at45dbx_df_2_ram ( U32  addr,
void *  ram 
)

Copies 1 data sector from the memory to RAM.

Parameters
addrAddress of first memory sector to read.
ramPointer to RAM buffer to write.
Returns
Status.
Ctrl_status at45dbx_ram_2_df ( U32  addr,
const void *  ram 
)

Copies 1 data sector from RAM to the memory.

Parameters
addrAddress of first memory sector to write.
ramPointer to RAM buffer to read.
Returns
Status.
Ctrl_status at45dbx_read_capacity ( U32 u32_nb_sector)

Returns the address of the last valid sector in the memory.

Parameters
u32_nb_sectorPointer to the address of the last valid sector.
Returns
Status.
bool at45dbx_removal ( void  )

Tells whether the memory is removable.

Returns
true if the memory is removable, else false.
Ctrl_status at45dbx_test_unit_ready ( void  )

Tests the memory state and initializes the memory if required.

The TEST UNIT READY SCSI primary command allows an application client to poll a LUN until it is ready without having to allocate memory for returned data.

This command may be used to check the media status of LUNs with removable media.

Returns
Status.
bool at45dbx_unload ( bool  unload)

Unload/load the memory.

Parameters
unloadtrue to unload, false to load.
Returns
true if the operation is success, else false.
bool at45dbx_wr_protect ( void  )

Returns the write-protection state of the memory.

Returns
true if the memory is write-protected, else false.
Note
Only used by removable memories with hardware-specific write protection.