Microchip® Advanced Software Framework

smc_sram_example.c File Reference

SMC SRAM Example for SAM.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "stdio_serial.h"
#include "conf_board.h"

Macros

#define SRAM_TEST_SIZE   (10*1024)
 SRAM test size. More...
 

Functions

static uint8_t access_sram_test (uint32_t base_addr)
 Go/No-Go test of the first 10K-Bytes of external SRAM access. More...
 
static void configure_console (void)
 Configure UART console. More...
 
static void configure_sram (uint32_t cs)
 Configure the SMC for SRAM access. More...
 
int main (void)
 Application entry point for smc_sram example. More...
 

#define SRAM_TEST_SIZE   (10*1024)

SRAM test size.

Referenced by access_sram_test().

static uint8_t access_sram_test ( uint32_t  base_addr)
static

Go/No-Go test of the first 10K-Bytes of external SRAM access.

Parameters
base_addrBase address of the SRAM.
Returns
0 if test is failed else 1.

References pio_set_pin_high(), pio_set_pin_low(), and SRAM_TEST_SIZE.

Referenced by main().

static void configure_console ( void  )
static
static void configure_sram ( uint32_t  cs)
static

Configure the SMC for SRAM access.

Parameters
csChip select.

References smc_set_cycle_timing(), smc_set_mode(), smc_set_pulse_timing(), and smc_set_setup_timing().

Referenced by main().

int main ( void  )

Application entry point for smc_sram example.

Returns
Unused (ANSI-C compatibility).

References access_sram_test(), board_init(), BOARD_NAME, configure_console(), configure_sram(), pio_configure_pin(), pmc_enable_periph_clk(), and sysclk_init().