Class for implementing several serial ports

ModbusSlave::ModbusSlave() {
  this->serno = 0;
  this->txenpin = 0;
}

this-> is implied. You look silly using it.

How can I implement this depending on the microcontroller?

There are #defined variable that define which board is selected when compiling. Why can't you use them?