My first attempt at creating a driver for bldc motors