semperflash 2.0.0.0
main.c File Reference

SemperFlash Click example. More...

#include "board.h"
#include "log.h"
#include "semperflash.h"

Functions

void error_handler (uint8_t stat)
 
void id_check ()
 
void application_init ()
 
void application_task ()
 
int main (void)
 

Variables

uint8_t id_data [8]
 
uint8_t txt_flag
 
uint8_t COMPANY_FLAG = 2
 
uint8_t CLICK_FLAG = 3
 
uint32_t ADRESS_MEMORY = 0x00001111
 

Detailed Description

SemperFlash Click example.

Description

This example showcases how to initialize and use the Semper Flash click. The click is a 512 Mbit SPI Flash memory module. Data can be stored in and read from the flash memory. There's also the option of erasing it's contents. Here's how to do it.

The demo application is composed of two sections :

Application Init

This function initializes and configures the click and logger modules. Additional con- figuring is done in the default_cfg(...) function. The device ID should appear in the UART console if the setup finishes successfully.

Application Task

This function first erases the contents of the flash memory and then writes, reads and prints two strings in the UART console. It does so every 2 seconds.

Author
MikroE Team

Function Documentation

◆ application_init()

void application_init ( )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( )

◆ error_handler()

void error_handler ( uint8_t stat)

◆ id_check()

void id_check ( )

◆ main()

int main ( void )

Variable Documentation

◆ ADRESS_MEMORY

uint32_t ADRESS_MEMORY = 0x00001111

◆ CLICK_FLAG

uint8_t CLICK_FLAG = 3

◆ COMPANY_FLAG

uint8_t COMPANY_FLAG = 2

◆ id_data

uint8_t id_data[8]

◆ txt_flag

uint8_t txt_flag