![]() |
Mechatronics Portfolio
Logan Williamson's Mechatronics Portfolio and Documentation Repository
|
A motor driver class for the DRV8847 from TI. More...
Public Member Functions | |
def | __init__ (self, timerPin, sleepPin, faultPin) |
Initializes and returns a DRV8847 object. More... | |
def | enable (self) |
Brings the DRV8847 out of sleep mode. More... | |
def | disable (self) |
Puts the DRV8847 in sleep mode. More... | |
def | fault_cb (self, IRQ_src) |
Callback function to run on fault condition. More... | |
def | motor (self, PWM_tim, IN1_pin, IN2_pin, chA, chB) |
Creates a DC motor object connected to the DRV8847. More... | |
Public Attributes | |
tim | |
nSLEEP | |
nFAULT | |
faultInt | |
faultStatus | |
A motor driver class for the DRV8847 from TI.
Objects of this class can be used to configure the DRV8847 motor driver and to create one or more objects of the Motor class which can be used to perform motor control. Refer to the DRV8847 datasheet here: https://www.ti.com/lit/ds/symlink/drv8847.pdf
def Lab0x03_DRV8847.DRV8847.__init__ | ( | self, | |
timerPin, | |||
sleepPin, | |||
faultPin | |||
) |
def Lab0x03_DRV8847.DRV8847.disable | ( | self | ) |
Puts the DRV8847 in sleep mode.
The disable method will disable all motors controlled by the motor driver class by setting the nSLEEP pin to low.
def Lab0x03_DRV8847.DRV8847.enable | ( | self | ) |
Brings the DRV8847 out of sleep mode.
The enable method disables the faultInt external interrupt and resets the nSLEEP pin specified upon driver instatiation to 'high' before waiting 50 microseconds to re-enable faultInt in preparation for another potential fault condition occurring. This will allow the user to once again operate the motor driver.
def Lab0x03_DRV8847.DRV8847.fault_cb | ( | self, | |
IRQ_src | |||
) |
Callback function to run on fault condition.
IRQ_src | The source of the interrupt request. |
nFAULT | Fault indication pin. This pin is pulled logic low by a fault condition interrupt request. This open-drain output requires an external pullup resistor. The associated pin is also used as an input pin for the DRV8847S device for releasing the I2C bus. |
def Lab0x03_DRV8847.DRV8847.motor | ( | self, | |
PWM_tim, | |||
IN1_pin, | |||
IN2_pin, | |||
chA, | |||
chB | |||
) |
Creates a DC motor object connected to the DRV8847.