close
Skip to content

pyTooling/pyDeviceAccess

 
 

Repository files navigation

pyDeviceAccess

[!ATTENTION] This is under development.

Use Cases

  • Abstract access to devices and registers by Python classes.
  • Replace C programs with mmap or the usage of devmem for testing register accesses.

Examples

from pyDeviceAccess import Device, RegisterMode

with Device(0x8000_0000, size=256) as dev:
  ctrl   = dev.UInt32(0x00)
  status = dev.UInt32(0x04, mode=RegisterMode.READ_ONLY)
  fifo   = dev.UInt32Array(0x10, count=8, mode=RegisterMode.WRITE_ONLY)

  ctrl.value = 0x0000_0001
  print(hex(status.value))
	
  for i, reg in enumerate(fifo):
    reg.value = i

Contributors

License

This Python package (source code) is licensed under Apache License 2.0.
The accompanying documentation is licensed under Creative Commons - Attribution-4.0 (CC-BY 4.0).


SPDX-License-Identifier: Apache-2.0

About

Access device's physical memory (configuration registers).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors