예제 #1
0
 def cfg_write(self, offset, val):
     assert offset >= 0 and offset < 0x400
     buf = c.create_string_buffer(struct.pack("I", val))
     c.pwrite(self.device, buf, 4, self.config_offset + offset)
예제 #2
0
 def cfg_read(self, offset):
     assert offset >= 0 and offset < 0x400
     buf = c.create_string_buffer(4)
     c.pread(self.device, buf, 4, self.config_offset + offset)
     return struct.unpack("I", buf)[0]