Invalid conversion when making a function that passes parameters to digitalWrite

There's no reason to document the values of HIGH and LOW. That would just make the Arduino API less flexible. That could be harmful in case there was ever a situation where it was desirable to define HIGH and LOW as other values. The values are irrelevant as long as you know that using those names will always give you the expected results.