The DRV8847 class is used to enable and dissable the DRV8847 motor controller board as well as handle fault detection. More...
Public Member Functions | |
def | __init__ (self, nSLEEP_pin, nFAULT_pin, maxFaultSep=500) |
A method to initialize a DRV8847 object. More... | |
def | enable (self) |
A method to enable the motor by pulling the sleep pin high. | |
def | disable (self) |
A method to disable the motor by pulling the sleep pin low. | |
def | fault_CB (self, IRQ_src) |
An interrupt used to dissable the motors and enter a fault state if the DRV8847 board signals a fault. More... | |
def | clear_fault (self) |
A method used to clear a fault so that the motors can be enabled. More... | |
def | channel (self, INx_pin, INx_ch, INy_pin, INy_ch, INxy_timer) |
A method to create a DRV8847_channel object for controlling individual motors. More... | |
Public Attributes | |
nSLEEP | |
The pyb.Pin object that enables and diables the motor. | |
nFault | |
The pyb.Timer object used to generate PWM for the motor. | |
faultInt | |
fault | |
Wether or not the DRV8847 object is in a fault condition. More... | |
maxFaultSep | |
lastFaultTime | |
The DRV8847 class is used to enable and dissable the DRV8847 motor controller board as well as handle fault detection.
Note that the DRV8847 class does not control either motor conected to the board. Individual motors are controlled by the DRV8847_channel class.
def ME405_FP_DRV8847.DRV8847.__init__ | ( | self, | |
nSLEEP_pin, | |||
nFAULT_pin, | |||
maxFaultSep = 500 |
|||
) |
A method to initialize a DRV8847 object.
def ME405_FP_DRV8847.DRV8847.channel | ( | self, | |
INx_pin, | |||
INx_ch, | |||
INy_pin, | |||
INy_ch, | |||
INxy_timer | |||
) |
A method to create a DRV8847_channel object for controlling individual motors.
INx_pin | A pyb.Pin object connected to one lead of the motor via the DRV8847 board. |
INx_ch | The timer channel corresponding to INx_pin (integer). |
INy_pin | A pyb.Pin object connected to the other lead of the motor via the DRV8847 board. |
INy_ch | The timer channel corresponding to INy_pin (integer). |
INxy_timer | A pyb.Timer object to use for PWM on both the motor leads. |
def ME405_FP_DRV8847.DRV8847.clear_fault | ( | self | ) |
A method used to clear a fault so that the motors can be enabled.
The fault will only clear if the DRV8847 board is not currently in a fault condition.
def ME405_FP_DRV8847.DRV8847.fault_CB | ( | self, | |
IRQ_src | |||
) |
ME405_FP_DRV8847.DRV8847.fault |
Wether or not the DRV8847 object is in a fault condition.
The motors will not enable until DRV8847.clear_fault is called.