stm32l: attempt to make the lcd display code a bit more generic