mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
2d7fb9a715
The timing of the DMA transfer can vary a bit, so tweak the allowed values. Also test the return value of `rp2.DMA.irq.flags()` to make sure the IRQ is correctly signalled. Signed-off-by: Damien George <damien@micropython.org>
17 lines
765 B
Plaintext
17 lines
765 B
Plaintext
# test basic usage
|
|
DMA(0)
|
|
{'inc_read': 1, 'high_pri': 0, 'write_err': 0, 'ring_sel': 0, 'enable': 1, 'treq_sel': 63, 'sniff_en': 0, 'irq_quiet': 1, 'read_err': 0, 'chain_to': 0, 'busy': 0, 'inc_write': 1, 'ring_size': 0, 'bswap': 0, 'size': 2, 'ahb_err': 0}
|
|
0 0 0 4161593 0 <memoryview>
|
|
ValueError
|
|
# test memory copy
|
|
True
|
|
bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07') bytearray(b'\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff')
|
|
# test timing
|
|
True
|
|
bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07') bytearray(b'\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff')
|
|
# test immediate trigger
|
|
bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07') bytearray(b'\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff')
|
|
# test irq
|
|
irq fired 1
|
|
bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07') bytearray(b'\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff')
|