Ejemplo n.º 1
0
Archivo: flash.py Proyecto: IceyP/N25Q
flash.write_enable()
print "Status=", flash.get_status()
flash.write_enable(False)
print "Status=", flash.get_status()

flash.bulk_erase()
while flash.get_status()["write_in_progress"]:
    pass

print "ID=", [hex(x) for x in flash.get_id()]

flash.init_system()

y = bytearray([0x32, 0x45, 0x12, 0x40])
flash.write(4, y)
flash.write(4100, y)

x = flash.read(0, 10)
print "READ: ", [hex(y) for y in x]
x = flash.read(4096, 10)
print "READ: ", [hex(y) for y in x]

flash.subsector_erase(0)
x = flash.read(0, 10)
print "READ: ", [hex(y) for y in x]
x = flash.read(4096, 10)
print "READ: ", [hex(y) for y in x]

tb.adv(100)
tb.end()