flash4 2.0.0.0
|
Flash 4 click is a perfect solution for the mass storage option in various embedded applications. With fast performance being one of its key features, Flash 4 click can also be used for the code shadowing, execute-in-place (XIP), and data storage.
We provide a library for the Flash4 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Flash4 Click driver.
- Initialization function.void flash4_cfg_setup ( flash4_cfg_t *cfg );
FLASH4_RETVAL flash4_init ( flash4_t *ctx, flash4_cfg_t *cfg );
void flash4_generic_transfer ( flash4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len );
- Write command function.void flash4_read_manufacturer_id ( flash4_t *ctx, uint8_t *device_id );
void flash4_write_command ( flash4_t *ctx, uint8_t cmd );
void flash4_read_flash_4 ( flash4_t *ctx, uint8_t *out_data, uint32_t addr, uint8_t n_data );
This example demonstrates the use of Flash 4 Click board.
The demo application is composed of two sections :
Initializes the driver and enables the click board, then checks the communication by reading the device and manufacturer IDs.
Erases sector memory starting from 0x00001234 address, then writes a desired message to the same address. After that, verifies if the message is written correctly by reading it back and displaying it to the USB UART every 5 seconds.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.