Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void ebi_init(void)
- {
- static struct ebi_cs_config cs_config;
- static struct ebi_sdram_config sdram_config;
- ebi_setup_port(12, 0, 0, EBI_PORT_3PORT | EBI_PORT_SDRAM);
- ebi_cs_set_mode(&cs_config, EBI_CS_MODE_SDRAM_gc);
- ebi_cs_set_address_size(&cs_config, EBI_CS_ASPACE_8MB_gc);
- ebi_cs_set_base_address(&cs_config, BOARD_EBI_SDRAM_BASE);
- ebi_sdram_set_mode(&cs_config, EBI_CS_SDMODE_NORMAL_gc);
- ebi_sdram_set_row_bits(&sdram_config, 12);
- ebi_sdram_set_col_bits(&sdram_config, 10);
- ebi_sdram_set_cas_latency(&sdram_config, 3);
- ebi_sdram_set_mode_delay(&sdram_config, EBI_MRDLY_2CLK_gc);
- ebi_sdram_set_row_cycle_delay(&sdram_config, EBI_ROWCYCDLY_7CLK_gc);
- ebi_sdram_set_row_to_precharge_delay(&sdram_config, EBI_RPDLY_7CLK_gc);
- ebi_sdram_set_write_recovery_delay(&sdram_config, EBI_WRDLY_1CLK_gc);
- ebi_sdram_set_self_refresh_to_active_delay(&sdram_config,EBI_ESRDLY_7CLK_gc);
- ebi_sdram_set_row_to_col_delay(&sdram_config, EBI_ROWCOLDLY_7CLK_gc);
- ebi_sdram_set_refresh_period(&sdram_config, BOARD_EBI_SDRAM_REFRESH);
- ebi_sdram_set_initialization_delay(&sdram_config,BOARD_EBI_SDRAM_INITDLY);
- ebi_sdram_write_config(&sdram_config);
- ebi_cs_write_config(EBI_SDRAM_CS, &cs_config);
- ebi_enable_cs(EBI_SDRAM_CS, &cs_config);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement