Questo e' con i template, a mio parere la scelta migliore nel tuo caso ( Arduino ci va a nozze e tu non ti devi sbattere sul codice

):
void EPROOM_write( unsigned addr , void* buff , unsigne length )
{
unsigned i;
while( length - i++ ) EPROOM.write( ((unsigned char*)addr) + i , buff[i] );
}
template <class type> void EPROOM_write( unsigned addr , type var )
{
EEPROM.write( addr , &var , sizeof(type) );
}
void EPROOM_write( unsigned addr , const char* str )
{
do EEPROM.write( addr++ , *str ); while( *str++ ); // oppure EEPROM.write( addr , str , strlen( str ) + 1 );
}
Ci sarebbe anche un'altra via, che non necessita di g++ ma si basa sul precompilatore, in pratica il risultato e' lo stesso dei template, ma se vuoi del codice C99 "pulito" ti puo' aiutare, probabilmente e' inutilmente macchinoso nel tuo caso, ma hai detto mai:
void EPROOM_write_ptr( unsigned addr , void* buff , unsigne length )
{
unsigned i;
while( length - i++ ) EPROOM.write( ((unsigned char*)addr) + i , buff[i] );
}
#define EPROOM_write( TYPE , ADDR , VAR ) EPROOM_write_ ## TYPE ( unsigned ADDR , VAR )
#define EPROOM_WRITE( TYPE ) void EPROOM_write_ ## TYPE ( unsigned addr , TYPE var ) \
{ \
EEPROM_write_ptr( addr , &var , sizeof(type) ); \
}
EPROOM_WRITE( unsigned char )
EPROOM_WRITE( unsigned short )
...
EPROOM_WRITE( signed short )
EPROOM_WRITE( signed long )
void foo()
{
EPROOM_write( unsigned int , 0xDEADBEAF, 12345 );
EPROOM_write( signed car , 0xABCDEFAB, 0x7F );
...
}
Good luck!