[HELP] Set the speed of 2 DC motors with H-Bridge

for this kind of h bridge i would like to use functions actually

void Motor(boolean Dir, int Speed)
{
  int Stop;
  if (Dir ==Stop)
  {
    digitalWrite(Pin1,LOW);
    digitalWrite(Pin2,LOW);
  }
  else
  {
    digitalWrite(Pin1,Dir);
    digitalWrite(Pin2,!Dir);
    analogWrite(EnPin,Speed);
  }
}

for dir you could specify HIGH and LOW,