Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8621

MicroPython • Re: Experiments in chaining DMA to PIO - strange error and room for improvement?

$
0
0
Regarding the second question, sorry, I am not so much into MicroPython but you might find something useful here:
https://docs.micropython.org/en/latest/ ... emoryviews

Also viper functions make use of int and ptr data types:
https://docs.micropython.org/en/latest/ ... de-emitter
Viper supports its own set of types namely int, uint (unsigned integer), ptr, ptr8, ptr16 and ptr32. The ptrX types are discussed below.
...
Viper provides pointer types to assist the optimiser. These comprise
ptr Pointer to an object.
ptr8 Points to a byte.
ptr16 Points to a 16 bit half-word.
ptr32 Points to a 32 bit machine word.

The concept of a pointer may be unfamiliar to Python programmers. It has similarities to a Python memoryview object in that it provides direct access to data stored in memory. Items are accessed using subscript notation, but slices are not supported: a pointer can return a single item only. Its purpose is to provide fast random access to data stored in contiguous memory locations - such as data stored in objects which support the buffer protocol, and memory-mapped peripheral registers in a microcontroller. It should be noted that programming using pointers is hazardous: bounds checking is not performed and the compiler does nothing to prevent buffer overrun errors.
Good luck. :)

Statistics: Posted by gmx — Fri Sep 12, 2025 9:19 pm



Viewing all articles
Browse latest Browse all 8621

Trending Articles