RGPIO commands for simple ports (P-mode) are:
| Command | Comment | Example |
|---|---|---|
| P<port>+ | Set port Hi (turn it on) | P4+ |
| P<port>- | Set port Lo (turn it off) | P11- |
| P<port>R | Set port input and read value | P0x12R |
| P[n,]<port>L | Report when port goes Lo Cache n events – default=0, report once only. |
P8L |
| P[n,]<port>H | Report when port goes Hi Cache n events – default=0, report once only. |
P2,8H |
| P[n,]<port>L | Report when port changes Cache n events – default=1; if n=0, once only. |
P0,8C |
| P<port>l | Set port Hi and time how long before it goes Lo | P8l |
| P<port>h | Set port Lo and time how long before it goes Hi | P8l |
| P<port>U | Turn on the internal pullup on the port | P8U |
| P<port>u | Turn off the internal pullup on the port | P8u |
| Command | Response |
|---|---|
| P4R | P4:on |
| This reports the current state of the port. | |
| P8L | E8:off 2013/03/15 14:21:35 (812355433) |
| After an L command is sent, RGPIO watches for the port to change (using a hardware interrupt). The output will be available after the event has occured. The output can be pollled for, or a signal can be set. The output indicates the port, and state, the time and an incrementing timestamp for the event. | |
| P7h | E7:on t=56000 |
| After an h command is sent, RGPIO sets the port Lo and then times how long (in nanoseconds) it takes for the port to go Hi. The output can be pollled for, or a signal can be set. The output indicates the port, and state, the elapsed time. | |
Leave a Reply