Commit ad7ea664f377587f9e91b6c685e8bbedd8f489d4
authorMichel Pollet <buserror@gmail.com>
Tue, 31 Aug 2010 10:48:44 +0000 (11:48 +0100)
committerMichel Pollet <buserror@gmail.com>
Tue, 31 Aug 2010 10:48:44 +0000 (11:48 +0100)
tree0b55f9667d49efe9a505ec271a826e16eb1c7677
parent2df48dd56ca8c9f93e9c20dc98492408d0b34f5b
Message:
ioport: Add an ioctl to get the port state

Example:
for (int i = 'A'; i <= 'F'; i++) { avr_ioport_state_t state;
if (avr_ioctl(AVR_IOCTL_IOPORT_GETSTATE(i), &state) == 0)
printf("PORT%c %02x DDR %02x PIN %02x\n",
state.name, state.port, state.ddr, state.pin);
}

Signed-off-by: Michel Pollet <buserror@gmail.com>
2 files changed:
simavr/sim/avr_ioport.c
simavr/sim/avr_ioport.h