EBI --- D0~D7 实现按键的输入
--- A12、A13、A14 实现地址的选配
--- CS0 控制数据的输入输出
不知各位高手是否用过?
这里我配置了SMC_SETUP、SMC_PULSE、SMC_CYCLE、SMC_MODE这几个寄存器,但无法实现按键输入功能,是否还需要其他配置?下附部分代码,请各位高手指点。谢谢。
struct sam9_smc_config smc_config = {
.ncs_read_setup = 1,// 2,//15, //128 /*->128 (bit5*128+bit4:0)*/
.nrd_setup = 1,
.ncs_write_setup = 1,
.nwe_setup = 1,
.ncs_read_pulse = 0x1f,
.nrd_pulse = 0x1f,
.ncs_write_pulse = 0x1f,
.nwe_pulse = 0x1f,
.read_cycle = 0x21,
.write_cycle = 0x21,
.mode = AT91_SMC_EXNWMODE_DISABLE +
AT91_SMC_DBW_8 + AT91_SMC_TDF_(0) + AT91_SMC_PS_4,
};
#define CSKEY_OFFSET (7<<12)
#define AT91C_EXT_BASE_ADD (0x10000000 + CSKEY_OFFSET)
void __iomem *key_base = NULL;
ucVal = *((u_char *)key_base);
key_base = ioremap(AT91C_EXT_BASE_ADD, SIZE_OF_KEY );
static void at91_key_timer_handler( unsigned long data)
{
pKey = (u_long *)key_base;
}
|