Skip to content

Instantly share code, notes, and snippets.

@arfoll
Last active February 23, 2016 19:02
Show Gist options
  • Save arfoll/8eabe0fd1e04fc865bec to your computer and use it in GitHub Desktop.
Save arfoll/8eabe0fd1e04fc865bec to your computer and use it in GitHub Desktop.
imraa_concept
/etc/imraa.conf
Defines how pins will be used:
{
"lockfile-location": "xxx",
"Platform" :[
{"id":"512", "type":"GENERIC_FIRMATA", "flash":"/var/cache/101/firmata.img", "usbserial": "auto"}
],
"IO" :[
{"type":"gpio", "index":0, "raw": false, "label": "none"},
{"type":"i2c", "index":0, "raw": false, "label": "i2c-0"}
]
}
1. runs mraa_init(), initilise platform, if subplatforms set to flash then do so
2. write pinmuxing to set IO into mode via mraa:XXX calls and then setting ownership to 'false' so close/cleanup never happens
3. writes json lockfile in /tmp/ with subplatform ids
{
"Platform" :[
{"id": "0", "type":"NULL_PLATFORM"},
{"id":"512", "type":"GENERIC_FIRMATA", "uart": "/dev/ttyACM0"}
}
4. when mraa_init() runs check for lockfile, if lockfile read subplatform info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment