Microchip® Advanced Software Framework

at45dbx_example.c File Reference
#include <string.h>
#include "compiler.h"
#include "preprocessor.h"
#include "board.h"
#include "power_clocks_lib.h"
#include "gpio.h"
#include "spi.h"
#include "print_funcs.h"
#include "conf_at45dbx.h"
#include "at45dbx.h"

Macros

#define AT45DBX_ENABLE_NPCS_PIN(NPCS, unused)   {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION},
 
#define MSG_GOODBYE   "\r\n ---------- End of AT45DBX example ---------- \r\n"
 
#define MSG_WELCOME   "\r\n ---------- Welcome to AT45DBX example ---------- \r\n"
 Welcome message to display. More...
 
Test Result Messages
#define TEST_SUCCESS   "\t[PASS]\r\n"
 
#define TEST_FAIL   "\t[FAIL]\r\n"
 
Clock Settings
#define EXAMPLE_TARGET_PBACLK_FREQ_HZ   FOSC0
 

Functions

static void at45dbx_example_check_mem (void)
 Performs a memory check on all DFs. More...
 
static void at45dbx_example_test_byte_mem (void)
 Tests single-byte access functions. More...
 
static void at45dbx_example_test_multiple_sector (void)
 Tests multiple-sector access functions. More...
 
static void at45dbx_example_test_RAM_mem (void)
 Tests single-sector access functions. More...
 
void at45dbx_read_multiple_sector_callback (const void *psector)
 Callback function invoked after each sector read during at45dbx_read_multiple_sector. More...
 
static void at45dbx_resources_init (void)
 Initializes AT45DBX resources: GPIO, SPI and AT45DBX. More...
 
void at45dbx_write_multiple_sector_callback (void *psector)
 Callback function invoked before each sector write during at45dbx_write_multiple_sector. More...
 
int main (void)
 Main function. Execution starts here. More...
 

Variables

static U32 at45dbx_example_error_cnt
 Number of erroneous bytes detected during the test of the AT45DBX multiple- sector access functions. More...
 
static const Union32 PATTERN_MULTIPLE_SECTOR = {0xDEADBEEF}
 Pattern to test the AT45DBX multiple-sector access functions with. More...
 

#define AT45DBX_ENABLE_NPCS_PIN (   NPCS,
  unused 
)    {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION},

Referenced by at45dbx_resources_init().

#define EXAMPLE_TARGET_PBACLK_FREQ_HZ   FOSC0

Referenced by at45dbx_resources_init(), and main().

#define MSG_GOODBYE   "\r\n ---------- End of AT45DBX example ---------- \r\n"

Referenced by main().

#define MSG_WELCOME   "\r\n ---------- Welcome to AT45DBX example ---------- \r\n"

Welcome message to display.

Referenced by main().

static void at45dbx_example_check_mem ( void  )
static

Performs a memory check on all DFs.

References at45dbx_mem_check(), AT45DBX_MEM_CNT, AT45DBX_MEM_SIZE, print_dbg(), print_dbg_ulong(), TEST_FAIL, and TEST_SUCCESS.

Referenced by main().

static void at45dbx_example_test_byte_mem ( void  )
static
static void at45dbx_example_test_multiple_sector ( void  )
static
static void at45dbx_example_test_RAM_mem ( void  )
static

U32 at45dbx_example_error_cnt
static

Number of erroneous bytes detected during the test of the AT45DBX multiple- sector access functions.

Referenced by at45dbx_example_test_multiple_sector(), and at45dbx_read_multiple_sector_callback().

const Union32 PATTERN_MULTIPLE_SECTOR = {0xDEADBEEF}
static

Pattern to test the AT45DBX multiple-sector access functions with.