Grazie Xaratroom come supponevi A, B4, ecc sono costanti, ti invio il codice completo.
PORTA, PORTB, DDRA, ecc sono funzioni di libreria del micro per configurare gli I_O e per leggere gli ingressi e scrivere sulle uscite.

main.c:

// output: none //
// azione: inizializza direzione delle porte//
//------------------------------------------------------//

void init_io(void)
{
DDRA = 0x0f; // PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
// in in in in out out out out

PORTA = 0X00; // PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0
// x x x x 0 0 0 0

DDRB = 0x0f; // PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
// in in in in out in in in

PORTB = 0X00; // PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
// x x x x 0 x x x
}


int main(void)
{
init_io();
TIMSK = (1<<TOIE0);
if (TOIE0 == 1)
PORTA = 0x01;
}

file in_out.c:

#include "cost.h"
#include <avr/io.h>


struct io {
char port;
char bit;
};
struct io conf = {A, B4}, en = {A, B5}, oimp = {A, B0}, film = {A, B1};




//------------------------------------------------------//
//nome funzione: read //
// input: struct //
// output: char //
// azione: legge pin ingresso //
//------------------------------------------------------//

char read(struct io x)
{
char ret=0;

switch(x.port)
{
case A:
{
ret=(PINA & x.bit);
break;
}
case B:
{
ret=(PINB & x.bit);
break;
}
case C:
{
//ret=(PINC & x.bit);
break;
}
case D:
{
//ret=(PIND & x.bit);
break;
}
}
return ret;
}

//------------------------------------------------------//
//nome funzione: out //
// input: struct //
// output: nessuno //
// azione: setta pin uscita //
//------------------------------------------------------//


void out(struct io x)
{

switch(x.port)
{
case A:
{
PORTA=(PORTA | x.bit);
break;
}
case B:
{
PORTB=(PORTB | x.bit);
break;
}
case C:
{
//PORTC=(PORTC | x.bit);
break;
}
case D:
{
//PORTD=(PORTD | x.bit);
break;
}
}
return;
}

//------------------------------------------------------//
//nome funzione: outoff //
// input: struct //
// output: nessuno //
// azione: resetta pin uscita //
//------------------------------------------------------//


void outoff(struct io x)
{

switch(x.port)
{
case A:
{
PORTA=(PORTA & !x.bit);
break;
}
case B:
{
PORTB=(PORTB & !x.bit);
break;
}
case C:
{
//PORTC=(PORTC & !x.bit);
break;
}
case D:
{
//PORTD=(PORTD & !x.bit);
break;
}
}
return;
}

file in_out.h

extern struct io conf;
extern struct io en;
extern struct io oimp;
extern struct io film;
extern char read(struct io x);
extern void out(struct io x);
extern void outoff(struct io x);

file cost.h:

#define B0 0x01 //maschera bit
#define B1 0x02 //maschera bit
#define B2 0x04 //maschera bit
#define B3 0x08 //maschera bit
#define B4 0x10 //maschera bit
#define B5 0x20 //maschera bit
#define B6 0x40 //maschera bit
#define B7 0x80 //maschera bit
#define A 0x01
#define B 0x02
#define C 0x03
#define D 0x04