Borrowed some config ideas from
https://github.com/stm32f4/5110/blob/0693e9b4c06dfa74d4670e2bf45750b10a08dff9/5110/5110.c