ioport: Added avr_iopin_t
authorMichel Pollet <buserror@gmail.com>
Wed, 14 Sep 2011 07:02:44 +0000 (08:02 +0100)
committerMichel Pollet <buserror@gmail.com>
Wed, 14 Sep 2011 07:17:51 +0000 (08:17 +0100)
Descriptor for pin name/pin number

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

index f0a080f..bc090b2 100644 (file)
@@ -66,6 +66,15 @@ typedef struct avr_ioport_state_t {
 // add port name (uppercase) to get the port state
 #define AVR_IOCTL_IOPORT_GETSTATE(_name) AVR_IOCTL_DEF('i','o','s',(_name))
 
+/**
+ * pin structure
+ */
+typedef struct avr_iopin_t {
+       uint16_t port : 8;                      ///< port e.g. 'B'
+       uint16_t pin : 8;               ///< pin number
+} avr_iopin_t;
+#define AVR_IOPIN(_port, _pin) { .port = _port, .pin = _pin }
+
 /*
  * Definition for an IO port
  */