Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class IOPort
- {
- public:
- IOPort(u16 a) { address = a; };
- ~IOPort() {};
- operator=(u8 u) { u2s.WriteByte(address,u); return 0; };
- operator|=(u8 u) { u2s.WriteBit(address,0xFF,u); return 0; };
- operator&=(u8 u) { u2s.WriteBit(address,u,0); return 0; };
- u16 address;
- };
- IOPort PINB(0x23);
- #define PINB7 7
- #define PINB6 6
- #define PINB5 5
- #define PINB4 4
- #define PINB3 3
- #define PINB2 2
- #define PINB1 1
- #define PINB0 0
- IOPort DDRB(0x24);
- #define DDB7 7
- #define DDB6 6
- #define DDB5 5
- #define DDB4 4
- #define DDB3 3
- #define DDB2 2
- #define DDB1 1
- #define DDB0 0
- IOPort PORTB(0x25);
- #define PORTB7 7
- #define PORTB6 6
- #define PORTB5 5
- #define PORTB4 4
- #define PORTB3 3
- #define PORTB2 2
- #define PORTB1 1
- #define PORTB0 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement