Пример #1
0
def config_i2s_clocks():
    clks = descriptors.AUDIO_CLOCK_SETUP()
    clks.audioSource = 1  # I2S
    clks.audioSetup.driveClks = 0  # i2s_clocks driven externally
    return clks
Пример #2
0
            print "\n", rx.decode_error_status(status, "rd(0x401018)")
        print "Reg 0x401018 = %x" % value

    # Combined beacon and discover (disco)
    channel = int(raw_input("Enter desired channel: "))

    (status, null) = Tx.set_radio_channel(0, channel)
    if (status != 0x01):
        print "\n", Tx.decode_error_status(status,
                                           "set_radio_channel(0, channel)")
    (status, null) = Tx.discover(0)
    if (status != 0x01):
        print "\n", Tx.decode_error_status(status, "disco(4500,channel,0)")

    # Do I need to set i2s_clocks in?
    clks = desc.AUDIO_CLOCK_SETUP()
    clks.audioSource = 0x1
    clks.audioSetup.sclkFrequency = 0x0
    clks.audioSetup.driveClks = 0x0
    clks.audioSetup.mclkFrequency = 0x3
    clks.audioSetup.mclkOutputEnable = 0x0
    (status, null) = Tx.set_i2s_clocks(clks)
    if (status != 0x01):
        print "\n", Tx.decode_error_status(status, "set_i2s_clocks(clks)")

    # Audio slot setup
    print "Assigning audio slots..."
    (status, null) = Tx.slot(0, 1)
    if (status != 0x01):
        print "\n", Tx.decode_error_status(status, "slot(0,1)")