Most of the code is copied from the stm32f0x family Tested on stm32f103ze soc Signed-off-by: Feng Cheng <i@fengch.me>