Advertisement
Guest User

Untitled

a guest
Mar 25th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1. static void ebi_init(void)
  2. {
  3.     static struct ebi_cs_config     cs_config;
  4.     static struct ebi_sdram_config  sdram_config;
  5.    
  6.     ebi_setup_port(12, 0, 0, EBI_PORT_3PORT | EBI_PORT_SDRAM);
  7.     ebi_cs_set_mode(&cs_config, EBI_CS_MODE_SDRAM_gc);
  8.     ebi_cs_set_address_size(&cs_config, EBI_CS_ASPACE_8MB_gc);
  9.     ebi_cs_set_base_address(&cs_config, BOARD_EBI_SDRAM_BASE);
  10.     ebi_sdram_set_mode(&cs_config, EBI_CS_SDMODE_NORMAL_gc);
  11.     ebi_sdram_set_row_bits(&sdram_config, 12);
  12.     ebi_sdram_set_col_bits(&sdram_config, 10);
  13.     ebi_sdram_set_cas_latency(&sdram_config, 3);
  14.     ebi_sdram_set_mode_delay(&sdram_config, EBI_MRDLY_2CLK_gc);
  15.     ebi_sdram_set_row_cycle_delay(&sdram_config, EBI_ROWCYCDLY_7CLK_gc);
  16.     ebi_sdram_set_row_to_precharge_delay(&sdram_config, EBI_RPDLY_7CLK_gc);
  17.     ebi_sdram_set_write_recovery_delay(&sdram_config, EBI_WRDLY_1CLK_gc);
  18.     ebi_sdram_set_self_refresh_to_active_delay(&sdram_config,EBI_ESRDLY_7CLK_gc);
  19.     ebi_sdram_set_row_to_col_delay(&sdram_config, EBI_ROWCOLDLY_7CLK_gc);
  20.     ebi_sdram_set_refresh_period(&sdram_config, BOARD_EBI_SDRAM_REFRESH);
  21.     ebi_sdram_set_initialization_delay(&sdram_config,BOARD_EBI_SDRAM_INITDLY);
  22.     ebi_sdram_write_config(&sdram_config);
  23.     ebi_cs_write_config(EBI_SDRAM_CS, &cs_config);
  24.     ebi_enable_cs(EBI_SDRAM_CS, &cs_config);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement