Flash 7 click
Flash 7 Click is a compact add-on board that contains a high-performance memory solution. This board features the GD25LQ16C, a high-performance 16Mbit SPI NOR Flash Memory solution with advanced security features from GigaDevice Semiconductor.
click Product page
Click library
- Author : Stefan Ilic
- Date : Jul 2021.
- Type : SPI type
Software Support
We provide a library for the Flash7 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Flash7 Click driver.
Standard key functions :
flash7_cfg_setup
Config Object Initialization function.
void flash7_cfg_setup(flash7_cfg_t *cfg)
Flash 7 configuration object setup function.
Flash 7 Click configuration object.
Definition flash7.h:220
flash7_init
Initialization function.
err_t flash7_init(flash7_t *ctx, flash7_cfg_t *cfg)
Flash 7 initialization function.
Flash 7 Click context object.
Definition flash7.h:203
flash7_default_cfg
Click Default Configuration function.
err_t flash7_default_cfg(flash7_t *ctx)
Flash 7 default configuration function.
Example key functions :
flash7_send_command
Send command function.
void flash7_send_command(flash7_t *ctx, uint8_t cmd)
Send command function.
flash7_page_program
Page program function.
uint8_t flash7_page_program(flash7_t *ctx, uint32_t mem_addr, uint8_t *p_tx_data, uint16_t n_bytes)
Page program function.
flash7_read_memory
Read memory function.
void flash7_read_memory(flash7_t *ctx, uint32_t mem_addr, uint8_t *p_rx_data, uint16_t n_bytes)
Read memory function.
Example Description
This is an example that demonstrates the use of the Flash 7 click board.
The demo application is composed of two sections :
Application Init
Initialization driver enables SPI, disables write protect and hold, performs whole chip erase, targets the memory address at "4096" for page program starting point and writes data which is also displayed on the log.
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( SPI_MASTER_ERROR == init_flag ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
log_printf( &logger, " ----------------------- \r\n" );
log_printf( &logger, " Chip Erase \r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
memory_addr = 4096;
log_printf( &logger, " ----------------------- \r\n" );
log_printf( &logger, " Write data : %s ", demo_data );
log_printf( &logger, " ----------------------- \r\n" );
Delay_ms ( 100 );
log_info( &logger, " Application Task " );
log_printf( &logger, " ----------------------- \r\n" );
}
#define FLASH7_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition flash7.h:187
void flash7_chip_erase(flash7_t *ctx)
Chip erase function.
void application_init(void)
Definition main.c:37
Application Task
In this example, the data is read from the targeted memory address. The results are being sent to the Usart Terminal. This task repeats every 5 sec.
log_printf( &logger, " Read data : %s ", rx_data );
log_printf( &logger, " ----------------------- \r\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
void application_task(void)
Definition main.c:89
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Flash7
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.