'读出芯片ID
ReDim WriteDataTemp(0)
ReDim ReadDataTemp(4)
Text1.Text = " 读取flash ID AT45DB321D:0×"
CopyMemory WriteDataTemp(0), FLASH_IDREAD, 1
ret = VSI_WriteReadBytes(VSI_USBSPI, 0, 0, WriteDataTemp(0), 1, ReadDataTemp(0), 4)
If ret <> ControlSPI.SUCCESS Then
MsgBox ("读取flash ID AT45DB321D错误!")
Exit Sub
Else
Text1.Text = Text1.Text + IIf(Len(Hex(ReadDataTemp(0))) = 1, "0" + Hex(ReadDataTemp(0)), Hex(ReadDataTemp(0))) + IIf(Len(Hex(ReadDataTemp(1))) = 1, "0" + Hex(ReadDataTemp(1)), Hex(ReadDataTemp(1))) + IIf(Len(Hex(ReadDataTemp(2))) = 1, "0" + Hex(ReadDataTemp(2)), Hex(ReadDataTemp(2))) + IIf(Len(Hex(ReadDataTemp(3))) = 1, "0" + Hex(ReadDataTemp(3)), Hex(ReadDataTemp(3)))
End If
|