阅读:936回复:1
S5933
请问大侠,S5933如果在线修改,有分
|
|
沙发#
发布于: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; |
|
|