#include "amswirelib.hpp" uint8_t read_portsD() { return PIND; } uint8_t read_portsB() { return PINB; } uint8_t read_portsC() { return PINC; } uint8_t read_portD(uint8_t N) { return (PIND & (1<>N; } uint8_t read_portB(uint8_t N) { return (PINB & (1<>N; } uint8_t read_portC(uint8_t N) { return (PINC & (1<>N; } void write_portsD(uint8_t V) { PORTD = V; } void write_portsB(uint8_t V) { PORTB = V; } void write_portsC(uint8_t V) { PORTC = V; } void write_portD(uint8_t N, uint8_t V) { PORTD = (PORTD & ~(1<=0&&amsPN<=7) { N = amsPN-0; DDRD = (DDRD & ~(1<=8 && amsPN<=15) { N = amsPN-8; DDRB = (DDRB & ~(1<=16&&amsPN<=23) { N = amsPN-16; DDRC = (DDRC & ~(1<=0&&amsPN<=7) { N = amsPN-0; PORTD = (PORTD & ~(1<=8 && amsPN<=15) { N = amsPN-8; PORTB = (PORTB & ~(1<=16&&amsPN<=23) { N = amsPN-16; PORTC = (PORTC & ~(1<=0&&amsPN<=7) { N = amsPN-0; ret = (PIND & (1<>N; } else if(amsPN>=8 && amsPN<=15) { N = amsPN-8; ret = (PINB & (1<>N; } else if(amsPN>=16&&amsPN<=23) { N = amsPN-16; ret = (PINC & (1<>N; } else { //nothing; } return ret;; }