Exemple #1
0
def oom_get_memory(port, function):

    funcmap = getfm(port.port_type)
    retval = {}
    for keys in funcmap[function]:
        retval[keys] = oom_get_keyvalue(port, keys)
    return retval
Exemple #2
0
port = oom_get_port(5)
print '0xA0, page 0, offset 0, 128 bytes'
print_block_hex(oom_get_memory_sff(port, 0xA0, 0, 0, 128))
print
print '0xA0, page 0, offset 128, 128 bytes'
print_block_hex(oom_get_memory_sff(port, 0xA0, 0, 128, 128))

# get the internal list of keys and decoders for this type of module
# report their values for this port
keymap = getmm(port.port_type)
print str(len(keymap.keys())) + ' keys implemented'
for keyx in sorted(keymap.keys()):
    if len(keymap[keyx]) == 5:
        if keymap[keyx][0] == 'get_bytes':
            val = oom_get_keyvalue(port, keyx)
            print keyx + ': ' + hexstr(val)
        else:
            print keyx + ': ' + str(oom_get_keyvalue(port, keyx))

# similarly, get the function keys for this module type,
# report their values for this port
print ' '
print 'functions, with their keys and values:'
print ' '
fnkeys = getfm(port.port_type)
for keyx in fnkeys:
    val = oom_get_memory(port, keyx)
    print keyx + ': '
    print str(val)
    print