Skip to main content

IO port based on mmap

Project description

mport

IO port based on shared memory map (mmap).

install

pip install mport

Usage

  • Prototype protocols
  • Build control layer and/or data collection layer for AI training applications
  • Broadcast operations to multiple receiving applications
  • Hardware simulation where you have virtual devices running as separate processes yet communicate via ports

Example Reader

import mport

speed_port = mport.Port('io.dat')
light_port = mport.Port('io.dat', offset=2)

while True:
  car.set_speed(speed_port.value)
  car.light(light_port.value)

Example speed controller

import mport

speed_port = mport.Port('io.dat')

speed_port.value = 42

Example light controller

import mport

light_port = mport.Port('io.dat', offset=2)
light_port.value = True

RGB LED Example

python3 -m mport.examples.rgb_led
python3 -m mport.exmaples.rgb_led_drive

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mport-0.1.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

mport-0.1.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page