AVR XMEGA External Bus Interface (EBI) example.
Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
static status_code_t | ebi_test_addr_bus (hugemem_ptr_t base, uint32_t size) |
Test the EBI address bus wired to the SRAM. More... | |
static status_code_t | ebi_test_data_bus (hugemem_ptr_t base) |
Test the EBI data bus wired to the SRAM. More... | |
static status_code_t | ebi_test_data_integrity (hugemem_ptr_t base, uint32_t size) |
Perform a SRAM data integrity test. More... | |
int | main (void) |
Main function. More... | |
Variables | |
static struct ebi_cs_config | cs_config |
EBI chip select configuration. More... | |
|
static |
Test the EBI address bus wired to the SRAM.
This function will perform an address bus test to locate any shorts or open leads to the SRAM device.
base | Base address of the external memory device |
size | Size of the external memory device |
STATUS_OK | on success, and status_code_t error code on failure |
References ERR_IO_ERROR, hugemem_read8(), hugemem_write8(), and STATUS_OK.
Referenced by main().
|
static |
Test the EBI data bus wired to the SRAM.
This function will perform a walking 1s to locate any shorts or open leads to the SRAM device.
base | Base address of the external memory device |
STATUS_OK | on success, and status_code_t error code on failure |
References ERR_IO_ERROR, hugemem_read32(), hugemem_write32(), and STATUS_OK.
Referenced by main().
|
static |
Perform a SRAM data integrity test.
This function will perform a SRAM data integrity test by writing 0s and 1s to the entire external device.
base | Base address of the external memory device |
size | Size of the external memory device |
STATUS_OK | on success, and status_code_t error code on failure |
References ERR_IO_ERROR, hugemem_read32(), hugemem_write32(), and STATUS_OK.
Referenced by main().
int main | ( | void | ) |
Main function.
References board_init(), cs_config, EBI_CS_ASPACE_128KB_gc, ebi_cs_set_address_size(), ebi_cs_set_base_address(), ebi_cs_set_mode(), ebi_cs_set_sram_wait_states(), ebi_cs_write_config(), ebi_enable_cs(), EBI_PORT_3PORT, EBI_PORT_CS0, EBI_PORT_SRAM, ebi_setup_port(), ebi_test_addr_bus(), ebi_test_data_bus(), ebi_test_data_integrity(), gpio_set_pin_low, sleepmgr_enter_sleep(), sleepmgr_init(), and sysclk_init().
|
static |
EBI chip select configuration.
This struct holds the configuration for the chip select used to set up the SRAM. The example code will use the EBI helper function to setup the contents before writing the configuration using ebi_cs_write_config().
Referenced by main().