/* * riscv-bldc.h * * Created on: 28.07.2018 * Author: eyck */ #ifndef RISCV_BLDC_H_ #define RISCV_BLDC_H_ #include extern uint32_t pwm; extern uint32_t DRIVE_PORT; enum { UL=1, //! Port pin connected to phase U, low side enable switch. UH=0, //! Port pin connected to phase U, high side enable switch. VL=11, //! Port pin connected to phase V, low side enable switch. VH=10, //! Port pin connected to phase V, high side enable switch. WL=19, //! Port pin connected to phase W, low side enable switch. WH=20, //! Port pin connected to phase W, high side enable switch. CW=0, //! Clockwise rotation flag. CCW=1, //! Counterclockwise rotation flag. SENSU_P=0, //! Phase U voltage to sense SENSV_P=1, //! Phase V voltage to sense SENSW_P=2, //! Phase W voltage to sense SENSU_N=4, //! Phase U voltage to sense SENSV_N=5, //! Phase V voltage to sense SENSW_N=6, //! Phase W voltage to sense DRIVE_MASK=(1<