Python mmio package for Carambola2. With this module you can access all internal registers. You can do some magic with this tool, but it's very easy to do something very wrong if you don't know what are you doing. Be warned!
- You need to have carambola2 build environment installed and precompilled prior to building this package
- You might need to edit Makefile first line to meet your environment
CROSS_COMPILE = ~/carambola2/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-
Also some packages should be selected from
make menuconfig
- Languages
- Pyton
- python
- python-mini
- Pyton
Build python package
make python
Build test program - main()
make test
Note: you need wget with SSL support
cd /tmp/py_mmio rm mmio.py rm _mmio.so wget https://github.com/8devices/py_mmio/raw/master/src/mmio.py wget https://github.com/8devices/py_mmio/raw/master/src/_mmio.so wget https://github.com/8devices/py_mmio/raw/master/tests/blink_gpio18.py python blink_gpio18.py
Read current values:
io -4 -r 0x18040000 -- 18040000: 00006cff io -4 -r 0x1804000C -- 1804000c: 00002605 io -4 -r 0x18040010 -- 18040010: 00002605
Toggle led:
io -4 0x18040000 0x00046cff -- setup out io -4 0x1804000C 0x00042605 -- set io -4 0x18040010 0x00042605 -- clr
import gpio register = gpio.read(18) print "Read: 0x%08X" % register gpio.write(18, 1)