Propeller OS versions - what about DIRA/OUTA/INA commands for pin I/O?
Cluso99
Posts: 18,069
I have thought about adding the ability of simple setting and reading the propeller I/O pins using OS commands.
Firstly, has anyone done this?
What about the format?
I am thinking of using the DIRA, OUTA and INA commands with parameters...
What format should we use? For example...
SD:>DIRA [pin]=1
SD:>DIRA Pn=1
SD:>DIRA [pin]~
SD:>DIRA Pn~
SD:>DIRA [pin]:=1
Should we handle multiple pins on a line? If so, what format?
Use comma separated
Use spin syntax...
SD:>DIRA [1..3]~
OUTA would work exactly like DIRA.
INA would read all pins and extract only those required by the parameters. If no parameters, show all.
For a single pin a 1 or 0 would be fine.
For multiple pins, should we display Hex, Binary and Decimal on the same line? For example...
SD:>INA
$xxxxxxxx %bbbbbbbb_bbbbbbbb_bbbbbbbb_bbbbbbbb dddddddddd
Maybe we could also add WAITPEQ and WAITPNE ?
Any comments/ideas?
Firstly, has anyone done this?
What about the format?
I am thinking of using the DIRA, OUTA and INA commands with parameters...
What format should we use? For example...
SD:>DIRA [pin]=1
SD:>DIRA Pn=1
SD:>DIRA [pin]~
SD:>DIRA Pn~
SD:>DIRA [pin]:=1
Should we handle multiple pins on a line? If so, what format?
Use comma separated
Use spin syntax...
SD:>DIRA [1..3]~
OUTA would work exactly like DIRA.
INA would read all pins and extract only those required by the parameters. If no parameters, show all.
For a single pin a 1 or 0 would be fine.
For multiple pins, should we display Hex, Binary and Decimal on the same line? For example...
SD:>INA
$xxxxxxxx %bbbbbbbb_bbbbbbbb_bbbbbbbb_bbbbbbbb dddddddddd
Maybe we could also add WAITPEQ and WAITPNE ?
Any comments/ideas?
Comments
I assume the "shell" cog would maintain the dira/pina status and not need to fork a separate cog for it...
No need for a separate cog to do this. In my OS, everything is a separate command file, so any command can be added simply. Also, leaves the most hub space free. So DIRA, OUTA and INA are actually separate files, as are DIR, COPY, REN (rename), DEL (delete), etc. makes it easy to customise, or add, any command required.