Microchip® Advanced Software Framework

is42s16100e_example.c File Reference

SDRAMC on EBI example for SAM.

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

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

Macros

#define SDRAMC_TEST_BUFF_SIZE   (30 * 1024)
 SDRAM benchmark test size. More...
 
#define SDRAMC_TEST_EVEN_TAG   (0x55aaaa55)
 SDRAMC access test data in even address. More...
 
#define SDRAMC_TEST_LENGTH   (10 * 1024)
 SDRAMC access test length. More...
 
#define SDRAMC_TEST_ODD_TAG   (0xaa5555aa)
 SDRAMC access test data in odd address. More...
 
#define SDRAMC_TEST_PAGE_NUM   (1024)
 SDRAM benchmark test page number. More...
 
#define STRING_EOL   "\r"
 
#define STRING_HEADER
 

Enumerations

enum  sdramc_status_t {
  SDRAMC_OK = 0,
  SDRAMC_TIMEOUT = 1,
  SDRAMC_ERROR = 2
}
 SDRAMC status. More...
 

Functions

static void configure_console (void)
 Configure the console uart. More...
 
static uint32_t get_delay_in_ticks (uint32_t ul_start_tick, uint32_t ul_end_tick)
 Get delayed number of ticks. More...
 
int main (void)
 Application entry point for sdramc_example. More...
 
static uint8_t sdram_access_test (void)
 Access test of the first 10K bytes of external SDRAM. More...
 
static uint32_t sdram_benchmarks (void)
 SDRAM benchmark test. More...
 
void SysTick_Handler (void)
 Systick handler to manage timestamp and delay. More...
 
static uint32_t tick_get_count (void)
 Get current tick count (in ms). More...
 

Variables

static volatile uint16_t gs_pus_mem_buff [SDRAMC_TEST_BUFF_SIZE]
 SDRAM benchmark buffer. More...
 
static volatile uint32_t gs_ul_ms_ticks = 0
 

#define SDRAMC_TEST_BUFF_SIZE   (30 * 1024)

SDRAM benchmark test size.

Referenced by sdram_benchmarks().

#define SDRAMC_TEST_EVEN_TAG   (0x55aaaa55)

SDRAMC access test data in even address.

Referenced by sdram_access_test().

#define SDRAMC_TEST_LENGTH   (10 * 1024)

SDRAMC access test length.

Referenced by sdram_access_test().

#define SDRAMC_TEST_ODD_TAG   (0xaa5555aa)

SDRAMC access test data in odd address.

Referenced by sdram_access_test().

#define SDRAMC_TEST_PAGE_NUM   (1024)

SDRAM benchmark test page number.

Referenced by sdram_benchmarks().

#define STRING_EOL   "\r"
#define STRING_HEADER
Value:
"-- SDRAMC Example --\r\n" \
"-- "BOARD_NAME " --\r\n" \
"-- Compiled: "__DATE__ " "__TIME__ " --"STRING_EOL
#define BOARD_NAME
Definition: fatfs_access_example.c:112
#define STRING_EOL
Definition: is42s16100e_example.c:99

Referenced by main().

SDRAMC status.

Enumerator
SDRAMC_OK 
SDRAMC_TIMEOUT 
SDRAMC_ERROR 

static void configure_console ( void  )
static

Configure the console uart.

References uart_rs232_options::baudrate, NULL, stdio_serial_init(), and sysclk_enable_peripheral_clock().

Referenced by main().

static uint32_t get_delay_in_ticks ( uint32_t  ul_start_tick,
uint32_t  ul_end_tick 
)
static

Get delayed number of ticks.

Parameters
ul_start_tickStart tick point.
ul_end_tickEnd tick point.
Returns
Delayed number of ticks.

Referenced by sdram_benchmarks().

static uint8_t sdram_access_test ( void  )
static

Access test of the first 10K bytes of external SDRAM.

Returns
SDRAMC_OK if test is passed, else SDRAMC_ERROR.

References SDRAMC_ERROR, SDRAMC_OK, SDRAMC_TEST_EVEN_TAG, SDRAMC_TEST_LENGTH, and SDRAMC_TEST_ODD_TAG.

Referenced by main().

static uint32_t sdram_benchmarks ( void  )
static

SDRAM benchmark test.

Returns
SDRAMC_OK for success and SDRAMC_ERROR for error.

References get_delay_in_ticks(), gs_pus_mem_buff, SDRAMC_ERROR, SDRAMC_OK, SDRAMC_TEST_BUFF_SIZE, SDRAMC_TEST_PAGE_NUM, and tick_get_count().

Referenced by main().

void SysTick_Handler ( void  )

Systick handler to manage timestamp and delay.

References gs_ul_ms_ticks.

static uint32_t tick_get_count ( void  )
static

Get current tick count (in ms).

Returns
Current tick count value.

References gs_ul_ms_ticks.

Referenced by sdram_benchmarks().

volatile uint16_t gs_pus_mem_buff[SDRAMC_TEST_BUFF_SIZE]
static

SDRAM benchmark buffer.

Referenced by sdram_benchmarks().

volatile uint32_t gs_ul_ms_ticks = 0
static

Referenced by SysTick_Handler(), and tick_get_count().