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.
|
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...
|
|
|
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.
|
|
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...
|
|
uint32_t sdram_refresh_config_t::sdramRefreshRow |
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
-
instance | SDRAM module instance number. |
config | The SDRAM configuration structure. |
whichBlock | The block selection. |
ctlConfig | The 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
-
instance | SDRAM 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
-
instance | SDRAM module instance number. |
whichBlock | The block selection. |
command | The 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
-
instance | SDRAM module instance number. |
whichBlock | The block selection. |
command | The 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
-
instance | SDRAM module instance number. |
void SDRAM_DRV_SendSelfRefreshExitCmd |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | SDRAM module instance number. |
void SDRAM_DRV_SetRefreshCmd |
( |
uint32_t |
instance, |
|
|
sdram_block_selection_t |
whichBlock, |
|
|
bool |
enable |
|
) |
| |
- Parameters
-
instance | SDRAM module instance number. |
whichBlock | The block which is selected. |
enable | Enables or disables. |
void SDRAM_DRV_SetWriteProtectCmd |
( |
uint32_t |
instance, |
|
|
sdram_block_selection_t |
whichBlock, |
|
|
bool |
enable |
|
) |
| |
- Parameters
-
instance | SDRAM module instance number. |
whichBlock | The block which is selected. |
enable | Enables or disables. |
void SDRAM_DRV_SetOperateValidCmd |
( |
uint32_t |
instance, |
|
|
sdram_block_selection_t |
whichBlock, |
|
|
bool |
enable |
|
) |
| |
- Parameters
-
instance | SDRAM module instance number. |
whichBlock | The block which is selected. |
enable | Enables or disables. |
SDRAM_Type* const g_sdramBase[] |