Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SDRAMC Peripheral driver

Overview

This section describes the programming interface of the SDRAMC Peripheral driver. The SDRAMC driver configures and uses the SDRAM controller hardware. It supports module initialization and SDRAMC configuration.

Data Structures

struct  sdram_refresh_config_t
 SDRAM configuration structure for refresh timing. More...
 

Functions

void SDRAM_DRV_Init (uint32_t instance, sdram_refresh_config_t *configure, sdram_block_selection_t whichBlock, sdram_blockctl_configure_t *ctlConfig)
 Initializes the SDRAM controller. More...
 
void SDRAM_DRV_Deinit (uint32_t instance)
 Disables the SDRAM module and gate control. More...
 
void SDRAM_DRV_SendCommand (uint32_t instance, sdram_block_selection_t whichBlock, sdram_command_t command)
 Sends the SDRAM command. More...
 
bool SDRAM_DRV_IsCommandFinished (uint32_t instance, sdram_block_selection_t whichBlock, sdram_command_t command)
 Gets the SDRAM command execute status. More...
 
void SDRAM_DRV_SendSelfRefreshCmd (uint32_t instance)
 Sends the self-refresh command to SDRAM. More...
 
void SDRAM_DRV_SendSelfRefreshExitCmd (uint32_t instance)
 Sends the self-refresh exit command to SDRAM. More...
 
void SDRAM_DRV_SetRefreshCmd (uint32_t instance, sdram_block_selection_t whichBlock, bool enable)
 Enables/disables refresh. More...
 
void SDRAM_DRV_SetWriteProtectCmd (uint32_t instance, sdram_block_selection_t whichBlock, bool enable)
 Enables/disables the write protect. More...
 
void SDRAM_DRV_SetOperateValidCmd (uint32_t instance, sdram_block_selection_t whichBlock, bool enable)
 Enables/disables the operation valid. More...
 

Variables

SDRAM_Type *const g_sdramBase []
 Table of base addresses for SDRAM instances. More...
 
const IRQn_Type g_sdramIrqId []
 Table to save SDRAM IRQ enumeration numbers defined in the CMSIS header file.
 

Data Structure Documentation

struct sdram_refresh_config_t

Defines a configure structure SDRAMConfig to refresh and uses the SDRAM_DRV_Init() function to make necessary initializations.

Data Fields

sdram_refresh_time_t refreshTime
 Trc:The number of bus clocks inserted between a REF and next ACTIVE command.
 
uint32_t sdramRefreshRow
 The SDRAM refresh time each row: ns/row. More...
 

Field Documentation

uint32_t sdram_refresh_config_t::sdramRefreshRow

Function Documentation

void SDRAM_DRV_Init ( uint32_t  instance,
sdram_refresh_config_t configure,
sdram_block_selection_t  whichBlock,
sdram_blockctl_configure_t *  ctlConfig 
)

This function must be called before calling any other SDRAM controller driver functions. This function ungates the SDRAM controller clock and sets the SDRAM controller clock. Pass in its configuration structure.

Parameters
instanceSDRAM module instance number.
configThe SDRAM configuration structure.
whichBlockThe block selection.
ctlConfigThe block control configuration
void SDRAM_DRV_Deinit ( uint32_t  instance)

This function disables the SDRAM controller clock. SDRAM_DRV_Init must be called if you want to use SDRAM again.

Parameters
instanceSDRAM module instance number.
void SDRAM_DRV_SendCommand ( uint32_t  instance,
sdram_block_selection_t  whichBlock,
sdram_command_t  command 
)

This function sends either a precharge or MRS command to SDRAM.

Parameters
instanceSDRAM module instance number.
whichBlockThe block selection.
commandThe command, see to "sdram_command_t".
bool SDRAM_DRV_IsCommandFinished ( uint32_t  instance,
sdram_block_selection_t  whichBlock,
sdram_command_t  command 
)

This function stops and disables the SDRAM carrier generator and modulator. When the SDRAM carrier generator and modulator is disabled the IRO signal can be controlled directly by calling SDRAM_DRV_SetIroCtl function.

Parameters
instanceSDRAM module instance number.
whichBlockThe block selection.
commandThe command, see to "sdram_command_t".
Returns
the execute status of command
  • true, the command is finished.
  • false, the command is on-going.
void SDRAM_DRV_SendSelfRefreshCmd ( uint32_t  instance)
Parameters
instanceSDRAM module instance number.
void SDRAM_DRV_SendSelfRefreshExitCmd ( uint32_t  instance)
Parameters
instanceSDRAM module instance number.
void SDRAM_DRV_SetRefreshCmd ( uint32_t  instance,
sdram_block_selection_t  whichBlock,
bool  enable 
)
Parameters
instanceSDRAM module instance number.
whichBlockThe block which is selected.
enableEnables or disables.
void SDRAM_DRV_SetWriteProtectCmd ( uint32_t  instance,
sdram_block_selection_t  whichBlock,
bool  enable 
)
Parameters
instanceSDRAM module instance number.
whichBlockThe block which is selected.
enableEnables or disables.
void SDRAM_DRV_SetOperateValidCmd ( uint32_t  instance,
sdram_block_selection_t  whichBlock,
bool  enable 
)
Parameters
instanceSDRAM module instance number.
whichBlockThe block which is selected.
enableEnables or disables.

Variable Documentation

SDRAM_Type* const g_sdramBase[]