zhuqiang
驱动牛犊
驱动牛犊
  • 注册日期2002-12-07
  • 最后登录2006-04-10
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:936回复:1

S5933

楼主#
更多 发布于:2002-12-07 16:54
请问大侠,S5933如果在线修改,有分
ppphaitaoamingp
驱动牛犊
驱动牛犊
  • 注册日期2002-11-05
  • 最后登录2005-05-30
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2002-12-07 17:05
在硬件上将串口线连接好,在驱动程序流程如下: // once free, set the control reg for low address
WRITE_REGISTER_UCHAR(NV_Control_Reg, AMCC_NV_LOW_ADDRESS_COMMAND);
// then write the low part of the address
WRITE_REGISTER_UCHAR(NV_Data_Reg, (UCHAR) (params[AMCC_NV_OFFSET_INDEX] & 0x000000FF));
// set up for high half of address
WRITE_REGISTER_UCHAR(NV_Control_Reg, AMCC_NV_HIGH_ADDRESS_COMMAND);
// then write the high part of the address
WRITE_REGISTER_UCHAR(NV_Data_Reg, (UCHAR) ((params[AMCC_NV_OFFSET_INDEX] >> 8) & 0x000000FF));
// now send a dummy command to latch the address
WRITE_REGISTER_UCHAR(NV_Control_Reg, AMCC_NV_NO_COMMAND);
// now set the data into the data reg
WRITE_REGISTER_UCHAR(NV_Data_Reg, (UCHAR) params[AMCC_NV_WRITE_DATA_INDEX]);
// now send the write command
WRITE_REGISTER_UCHAR(NV_Control_Reg, AMCC_NV_WRITE_COMMAND);

while (Attempts<AMCC_NV_MAX_ATTEMPTS && (READ_REGISTER_UCHAR(NV_Control_Reg) & AMCC_NV_BUSY_MASK)) // wait while device busy
{
Attempts++; // keep trying until the AMCC chip is done
// This number is typically less than 5
}

if (Attempts==AMCC_NV_MAX_ATTEMPTS)
{
return STATUS_TIMEOUT;
}


// wrap things up
Irp->IoStatus.Information=0;
return STATUS_SUCCESS;

给点分吧,兄弟!
游客

返回顶部