sdram.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sdram_info

Defines

#define MODE_AUTOREFRESH   4
#define MODE_EXT_LOAD_MR   5
#define MODE_LOAD_MR   3
#define MODE_NOP   1
#define MODE_NORMAL   0
#define MODE_POWER_DOWN   6
#define MODE_PRECHARGE   2

Functions

void sdramc_init (const sdram_info *info)


Define Documentation

#define MODE_AUTOREFRESH   4

SDRAMC operation mode: Auto refresh

Definition at line 70 of file sdram.h.

#define MODE_EXT_LOAD_MR   5

SDRAMC operation mode: Extended Load

Definition at line 75 of file sdram.h.

#define MODE_LOAD_MR   3

SDRAMC operation mode: Load Mode Register

Definition at line 65 of file sdram.h.

#define MODE_NOP   1

SDRAMC operation mode: NO OP

Definition at line 55 of file sdram.h.

#define MODE_NORMAL   0

SDRAMC operation mode: Normal operation

Definition at line 50 of file sdram.h.

#define MODE_POWER_DOWN   6

SDRAMC operation mode: Power Down

Definition at line 80 of file sdram.h.

#define MODE_PRECHARGE   2

SDRAMC operation mode: Precharge

Definition at line 60 of file sdram.h.


Function Documentation

void sdramc_init ( const sdram_info info  ) 

This function will initialize the AVR32 SDRAM Controller

Parameters:
*info The setup and timing variables for the controller
Returns:
Nothing

Definition at line 56 of file sdram.c.

References sdram_info::banks, sdram_info::cas, sdram_info::cols, sdram_info::rows, sdram_delay(), sdram_info::tras, sdram_info::trc, sdram_info::trcd, sdram_info::trp, sdram_info::twr, and sdram_info::txsr.

Referenced by main().

00057 {
00058 
00059   volatile avr32_sdramc_t *hsdramc = &AVR32_SDRAMC;
00060   volatile avr32_hmatrix_t *hmatrix = &AVR32_HMATRIX;
00061   volatile avr32_pio_t *pio = &AVR32_PIOE;
00062 
00063   // Enable SDRAM mode for CS1 in the BAMBI mux 
00064   hmatrix->sfr[4] |= 0x0002;
00065   hmatrix->sfr[4] |= 0x0100;
00066 
00067   // Initialize data bus bits 31-16 (muxed with the LCDC).
00068   pio->asr |= 0x0000FFFF;
00069   pio->pdr |= 0x0000FFFF;
00070   
00071   // Setup SDRAM info
00072   hsdramc->cr = ( (info->cols-8) << AVR32_SDRAMC_CR_NC ) |
00073     ( (info->rows-11) << AVR32_SDRAMC_CR_NR ) |
00074     ( (info->banks-1) << AVR32_SDRAMC_CR_NB ) |
00075     ( info->cas << AVR32_SDRAMC_CR_CAS ) |
00076     ( info->twr << AVR32_SDRAMC_CR_TWR ) |
00077     ( info->trc << AVR32_SDRAMC_CR_TRC ) |
00078     ( info->trp << AVR32_SDRAMC_CR_TRP ) |
00079     ( info->trcd << AVR32_SDRAMC_CR_TRCD ) |
00080     ( info->tras << AVR32_SDRAMC_CR_TRAS ) |
00081     ( info->txsr << AVR32_SDRAMC_CR_TXSR );
00082 
00083   sdram_delay(200);
00084 
00085 }

Here is the call graph for this function:


Generated on Thu May 10 13:52:44 2007 for AVR32102 - Using the AVR32 SDRAM controller by  doxygen 1.5.1