64 #define HALLTRAP_HALT_TIME_US (1e6) 256 uint16_t pulseWidth = 0;
MOTOR_STATE
Definition: hall_trap.h:101
__STATIC_INLINE void Halltrap_changeMotorDirection(Halltrap_Instance *hallTrap, MOTOR_DIR dir)
Changes the motor direction.
Definition: hall_trap.h:248
__STATIC_INLINE void Halltrap_disablePWM(Halltrap_Instance *hallTrap)
Disable the PWM output.
Definition: hall_trap.h:238
current from A to B in forward control and B to A in reverse control, phase C is open ...
Definition: hall_trap.h:121
HAL_PWM phaseA
Phase A timer.
Definition: hall_trap.h:154
void HAL_setPWMFreq(HAL_PWM pwm, uint32_t PWMFreq)
Sets PWMfreq for all timers.
Definition: hal.c:227
HAL_GPIO_IN hallC
HALL C GPIO.
Definition: hall_trap.h:152
Defines Motor Stop.
Definition: hall_trap.h:106
Defines hall A.
Definition: hall_trap.h:73
Hall Sensored Trap Motor Control Library HAL Module.
Defines Motor Brake Type Coast.
Definition: hall_trap.h:95
Defines Motor Directions Forward.
Definition: hall_trap.h:86
__STATIC_INLINE void HAL_PWMOutputLow(const HAL_PWM gndPhase_1, const HAL_PWM gndPhase_2, const HAL_PWM gndPhase_3)
Set all PWM outputs low.
Definition: hal.h:536
__STATIC_INLINE void HAL_PWMOutputHigh(const HAL_PWM gndPhase_1, const HAL_PWM gndPhase_2, const HAL_PWM gndPhase_3)
Set complementary PWM outputs high.
Definition: hal.h:560
MOTOR_BRAKE_TYPE
Definition: hall_trap.h:92
__STATIC_INLINE void Halltrap_setPWMFreq(Halltrap_Instance *hallTrap, uint32_t pwmFreq)
Sets the pwm frequency in all phases.
Definition: hall_trap.h:208
uint32_t Halltrap_calculateMotorSpeed(Halltrap_Instance *hallTrap, uint32_t poles)
Calculates motor speed.
Definition: hall_trap.c:239
current from B to C in forward control and C to B in reverse control, phase A is open ...
Definition: hall_trap.h:131
HAL_GPIO_IN
Definition: hal.h:109
Defines hall B.
Definition: hall_trap.h:75
void Halltrap_PWMUpdate(Halltrap_Instance *hallTrap, MOTOR_DIR dir, uint16_t pwmDuty)
Updates the PWM.
Definition: hall_trap.c:211
HAL_PWM phaseC
Phase C timer.
Definition: hall_trap.h:158
Defines Motor Run.
Definition: hall_trap.h:104
HALLTRAP_COMM_STATE
Definition: hall_trap.h:110
current from C to A in forward control and A to C in reverse control, phase B is open ...
Definition: hall_trap.h:116
void HAL_setDeadband(HAL_PWM pwm, uint16_t deadband)
Sets deadband for timer.
Definition: hal.c:214
HAL_CAPTURE_TIMER captureInput
input capture
Definition: hall_trap.h:160
current from B to A in forward control and A to B in reverse control, phase C is open ...
Definition: hall_trap.h:136
current from A to C in forward control and C to A in reverse control, phase B is open ...
Definition: hall_trap.h:141
HAL_GPIO_IN hallB
HALL B GPIO.
Definition: hall_trap.h:150
Defines Motor Brake Type Brake.
Definition: hall_trap.h:97
#define HALLTRAP_HALT_TIME_US
Defines the halt time before changing the motor direction.
Definition: hall_trap.h:64
Defines a halltrap instance.
Definition: hall_trap.h:145
__STATIC_INLINE void Halltrap_stopMotor(Halltrap_Instance *hallTrap, MOTOR_BRAKE_TYPE brakeType)
Stops the motor.
Definition: hall_trap.h:221
void Halltrap_Init(Halltrap_Instance *hallTrap)
Initialize the halltrap module.
Definition: hall_trap.c:53
MOTOR_DIR
Definition: hall_trap.h:83
current from C to B in forward control and B to C in reverse control, phase A is open ...
Definition: hall_trap.h:126
__STATIC_INLINE void Halltrap_setDeadband(Halltrap_Instance *hallTrap, uint16_t deadtime_ns)
Sets the deadband in all phases.
Definition: hall_trap.h:195
HAL_PWM
Definition: hal.h:137
Maximum hall signals.
Definition: hall_trap.h:79
Defines Motor Directions Reverse.
Definition: hall_trap.h:88
HAL_PWM phaseB
Phase B timer.
Definition: hall_trap.h:156
Defines hall C.
Definition: hall_trap.h:77
HAL_GPIO_IN hallA
HALL A GPIO.
Definition: hall_trap.h:148
HAL_CAPTURE_TIMER
Definition: hal.h:150
HALL
Definition: hall_trap.h:70
__STATIC_INLINE void HAL_delayMicroSeconds(uint32_t microSeconds)
Delays for specific time in microseconds.
Definition: hal.h:487