A motor driver class for the DRV8847 from Texas Instruments. More...
Public Member Functions | |
| def | __init__ (self, nSLEEP, nFAULT, tim) |
| Constructs a motor driver object. More... | |
| def | enable (self) |
| Brings the DRV8847 out of sleep mode. | |
| def | disable (self) |
| Puts the DRV8847 in sleep mode. | |
| def | fault_cb (self, IRQ_irc) |
| Callback function to run on fault condition. More... | |
| def | motor (self, pinA, pinB, channel_A, channel_B) |
| Initializes and return a motor object associated with DRV8847. More... | |
Public Attributes | |
| nSLEEP | |
| This is an active-high enable pin that corresponds to pin A15. More... | |
| nFAULT | |
| This is a pin that detects faults and corresponds to pin B2. More... | |
| tim | |
| Variable that specifies timer number. More... | |
| fault_cb_flag | |
| A boolean flag that signals the motor of a fault detection. More... | |
| fault | |
| Registers the callback function and causes an interrupt when fault is triggered. More... | |
A motor driver class for the DRV8847 from Texas Instruments.
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.
| def DRV8847.DRV8847.__init__ | ( | self, | |
| nSLEEP, | |||
| nFAULT, | |||
| tim | |||
| ) |
Constructs a motor driver object.
The motor driver object is created from three attributes: nSLEEP, nFAULT, and timer number.
| nSLEEP | This is an active-high enable pin that corresponds to pin A15 |
| nFAULT | This is a pin that detects faults and corresponds to pin B2 |
| tim | Variable that specifies timer number |
| def DRV8847.DRV8847.fault_cb | ( | self, | |
| IRQ_irc | |||
| ) |
Callback function to run on fault condition.
| IRQ_src | The source of the interrupt request. |
| def DRV8847.DRV8847.motor | ( | self, | |
| pinA, | |||
| pinB, | |||
| channel_A, | |||
| channel_B | |||
| ) |
| DRV8847.DRV8847.fault |
Registers the callback function and causes an interrupt when fault is triggered.
Defines a variable for the interrupt request for fault detection
| DRV8847.DRV8847.fault_cb_flag |
A boolean flag that signals the motor of a fault detection.
This variable initializes the fault callback flag
| DRV8847.DRV8847.nFAULT |
This is a pin that detects faults and corresponds to pin B2.
Detects fault conditions that may damage the motors
| DRV8847.DRV8847.nSLEEP |
This is an active-high enable pin that corresponds to pin A15.
When set on high, it enables the motors. When set on low, it disables the motors.
| DRV8847.DRV8847.tim |
Variable that specifies timer number.
Uses an attribute of frequency to create a timer object