HPM SDK
HPMicro Software Development Kit
hpm_femc_drv.h File Reference
#include "hpm_femc_regs.h"

Go to the source code of this file.

Data Structures

struct  femc_axi_q_weight_t
 Structure for specifying the configuration of AXI queue weight. More...
 
struct  femc_sdram_config_t
 Structure for specifying the configuration of SDRAM. More...
 
struct  femc_sram_config_t
 Structure for specifying the configuration of SRAM. More...
 
struct  femc_config_t
 Structure for specifying the configuration of FEMC. More...
 
struct  femc_cmd_t
 Structure for FEMC command. More...
 

Macros

#define FEMC_SDRAM_MAX_BURST_LENGTH_IN_BYTE   (8UL)
 
#define FEMC_SDRAM_COLUMN_ADDR_12_BITS   (0U)
 
#define FEMC_SDRAM_COLUMN_ADDR_11_BITS   (1U)
 
#define FEMC_SDRAM_COLUMN_ADDR_10_BITS   (2U)
 
#define FEMC_SDRAM_COLUMN_ADDR_9_BITS   (3U)
 
#define FEMC_SDRAM_COLUMN_ADDR_8_BITS   (4U)
 
#define FEMC_SDRAM_CAS_LATENCY_1   (1U)
 
#define FEMC_SDRAM_CAS_LATENCY_2   (2U)
 
#define FEMC_SDRAM_CAS_LATENCY_3   (3U)
 
#define FEMC_SDRAM_BANK_NUM_4   (0U)
 
#define FEMC_SDRAM_BANK_NUM_2   (1U)
 
#define FEMC_SDRAM_CS0   (0U)
 
#define FEMC_SDRAM_CS1   (1U)
 
#define FEMC_SDRAM_PORT_SIZE_8_BITS   (0U)
 
#define FEMC_SDRAM_PORT_SIZE_16_BITS   (1U)
 
#define FEMC_SDRAM_PORT_SIZE_32_BITS   (2U)
 
#define FEMC_AXI_Q_COUNT   (2U)
 
#define FEMC_AXI_Q_A   (0U)
 
#define FEMC_AXI_Q_B   (1U)
 
#define FEMC_DQS_INTERNAL   (0U)
 
#define FEMC_DQS_FROM_PAD   (1U)
 
#define FEMC_CMD_KEY   FEMC_IPCMD_KEY_SET(0xA55A)
 
#define FEMC_CMD_WRITE_FLAG   (1UL << 31)
 
#define FEMC_CMD_SDRAM_READ   (0x8U)
 
#define FEMC_CMD_SDRAM_WRITE   (FEMC_CMD_WRITE_FLAG | 0x9U)
 
#define FEMC_CMD_SDRAM_MODE_SET   (FEMC_CMD_WRITE_FLAG | 0xAU)
 
#define FEMC_CMD_SDRAM_ACTIVE   (0xBU)
 
#define FEMC_CMD_SDRAM_AUTO_REFRESH   (0xCU)
 
#define FEMC_CMD_SDRAM_SELF_REFRESH   (0xDU)
 
#define FEMC_CMD_SDRAM_PRECHARGE   (0xEU)
 
#define FEMC_CMD_SDRAM_PRECHARGE_ALL   (0xFU)
 
#define FEMC_SRAM_AD_MUX_MODE   (0U)
 
#define FEMC_SRAM_AD_NONMUX_MODE   (3U)
 
#define FEMC_SRAM_ADV_HOLD_HIGH   (0U)
 
#define FEMC_SRAM_ADV_HOLD_LOW   (1U)
 
#define FEMC_SRAM_ADV_ACTIVE_LOW   (0U)
 
#define FEMC_SRAM_ADV_ACTIVE_HIGH   (1U)
 
#define FEMC_SRAM_PORT_SIZE_8_BITS   (0U)
 
#define FEMC_SRAM_PORT_SIZE_16_BITS   (1U)
 
#define FEMC_IO_CSX_SDRAM_CS1   (1U)
 
#define FEMC_IO_CSX_SRAM_CE   (6U)
 

Enumerations

enum  { status_femc_cmd_err = MAKE_STATUS(status_group_femc, 1) }
 

Functions

static void femc_enable (FEMC_Type *ptr)
 femc enable More...
 
static void femc_disable (FEMC_Type *ptr)
 femc disable More...
 
static void femc_sw_reset (FEMC_Type *ptr)
 femc software reset More...
 
void femc_default_config (FEMC_Type *ptr, femc_config_t *config)
 femc get default config More...
 
void femc_init (FEMC_Type *ptr, femc_config_t *config)
 femc init controller More...
 
void femc_get_typical_sdram_config (FEMC_Type *ptr, femc_sdram_config_t *config)
 femc get typical sdram config More...
 
hpm_stat_t femc_config_sdram (FEMC_Type *ptr, uint32_t clk_in_hz, femc_sdram_config_t *config)
 femc config sdram More...
 
void femc_get_typical_sram_config (FEMC_Type *ptr, femc_sram_config_t *config)
 femc get typical sram config More...
 
hpm_stat_t femc_config_sram (FEMC_Type *ptr, uint32_t clk_in_hz, femc_sram_config_t *config)
 femc config sram More...