Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing low-level registers of an embedded device using Python

Tags:

python

c

embedded

I have an embedded device with Python installed on in. Is it possible to explicitly access registers in pure Python, or should I write C extensions for my Python code?

like image 459
Randomblue Avatar asked Mar 08 '12 14:03

Randomblue


2 Answers

It seems that you can't access the low level registers. I recommend just writing a short C extension code to allow Python to access the registers you need.

like image 171
PearsonArtPhoto Avatar answered Oct 22 '22 09:10

PearsonArtPhoto


I assume "registers" means "i/o-mapped device registers".

If you have Linux-x86, there is a Python PortIO package.

From the link: "PortIO is a Python wrapper for the port I/O macros like outb, inb, etc. provided by the C library on Linux x86 platforms. "

like image 31
David Pointer Avatar answered Oct 22 '22 09:10

David Pointer