Sample SPI drivers for a number of the Adesto Technologies flash devices.
Adesto Layer

The Adesto layer is flash device/family specific. Each family of devices (i.e. Dataflash) has its own header, c file, and a set of opcodes defined in cmd_defs.h. Most commands available to each device have been declared and defined, and each has been commented. In addition, a sample sequence presented as a 'test' of the flash device can be found within the c files for each family. The 'test' runs through a sequence of events and showcases how to use the driver and commands.

All Adesto layer functions have 2 core elements; load a buffer with data, then communicate with the flash device via the bit-banged SPI driver.

Loading a buffer:

Transmitting via the SPI driver:

Options for printing the received and transmitted bytes (available as a debug tool within the code) are built on top of these features, along with certain conditionals for complex commands. A few functions (ex: standardflashWaitOnReady()), can be found within each family which are clearly derived from simpler base functions. These functions are helpful for programming and showcase how other functions can be put together to form a 'complex' sequence of commands.

A near comprehensive list of supported opcodes can be found in cmd_defs.h. The datasheet should still be consulted before using a flash device. The sample code is not intended as a be-all-end-all resource, rather it provides a point of reference for starting out with serial communication between an MCU and Adesto flash memory. Indeed, when tested on certain microcontrollers, the measured bit-banged SPI clock rate when running through a test program was lower than 1MHz, less than ideal for high speed applications.

File Links

Adesto Layer Files

Adesto Layer

Family Specific Files

Standardflash
Moneta
Dataflash
Fusion