ME 305
Public Member Functions | Public Attributes | List of all members
driver.DRV8847 Class Reference

Controls motors. More...

Public Member Functions

def __init__ (self, TimerVal)
 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, channel, PWM_tim, IN1_pin, IN2_pin)
 Creates a DC motor object connected to the DRV8847. More...
 
def __init__ (self, TimerVal)
 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, channel, PWM_tim, IN1_pin, IN2_pin)
 Creates a DC motor object connected to the DRV8847. More...
 

Public Attributes

 FaultInt
 Holds the pin information for the fault condition. More...
 
 PWM_tim
 Initializes the timer that the driver uses @detail Sets the driver variable to pins of the ESP32 board.
 
 nSLEEP
 Initializes the Sleep pin. More...
 

Detailed Description

Controls motors.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def driver.DRV8847.__init__ (   self,
  TimerVal 
)

Initializes and returns a DRV8847 object.

Initializes driver class with Fault pin values, Sleep pin values and the actuive timer being used for this driver. This method assigns and activates the Fault and Sleep pins.

Parameters
TimerValThe index that the timer is set to. The values range from 1 to 14

◆ __init__() [2/2]

def driver.DRV8847.__init__ (   self,
  TimerVal 
)

Initializes and returns a DRV8847 object.

Initializes driver class with Fault pin values, Sleep pin values and the actuive timer being used for this driver. This method assigns and activates the Fault and Sleep pins.

Parameters
TimerValThe index that the timer is set to. The values range from 1 to 14

Member Function Documentation

◆ disable() [1/2]

def driver.DRV8847.disable (   self)

Puts the DRV8847 in sleep mode.

Deactivates the SLEEP pin and does not allow the motors to spin

◆ disable() [2/2]

def driver.DRV8847.disable (   self)

Puts the DRV8847 in sleep mode.

Deactivates the SLEEP pin and does not allow the motors to spin

◆ enable() [1/2]

def driver.DRV8847.enable (   self)

Brings the DRV8847 out of sleep mode.

Activates the SLEEP pin and allows the motors to power up.

◆ enable() [2/2]

def driver.DRV8847.enable (   self)

Brings the DRV8847 out of sleep mode.

Activates the SLEEP pin and allows the motors to power up.

◆ fault_cb() [1/2]

def driver.DRV8847.fault_cb (   self,
  IRQ_src 
)

Callback function to run on fault condition.

Deactivates the driver once a fault is detected. It then prints to the user that the driver has shut down due to a fault

Parameters
IRQ_srcThe source of the interrupt request.

◆ fault_cb() [2/2]

def driver.DRV8847.fault_cb (   self,
  IRQ_src 
)

Callback function to run on fault condition.

Deactivates the driver once a fault is detected. It then prints to the user that the driver has shut down due to a fault

Parameters
IRQ_srcThe source of the interrupt request.

◆ motor() [1/2]

def driver.DRV8847.motor (   self,
  channel,
  PWM_tim,
  IN1_pin,
  IN2_pin 
)

Creates a DC motor object connected to the DRV8847.

Parameters
channelContains channel number for specific motor used
PWM_timContains the the timer value for proper PWM
IN1_pinObject to interface with pin that determines rotation direction
IN2_pinObject to interface with pin that determines rotation direction
Returns
An object of class Motor

◆ motor() [2/2]

def driver.DRV8847.motor (   self,
  channel,
  PWM_tim,
  IN1_pin,
  IN2_pin 
)

Creates a DC motor object connected to the DRV8847.

Parameters
channelContains channel number for specific motor used
PWM_timContains the the timer value for proper PWM
IN1_pinObject to interface with pin that determines rotation direction
IN2_pinObject to interface with pin that determines rotation direction
Returns
An object of class Motor

Member Data Documentation

◆ FaultInt

driver.DRV8847.FaultInt

Holds the pin information for the fault condition.

Assigns the fault condition pin to a variable that can be used to shut-down a driver in case of an emergency to stop any damage to the motors

Initializes the fault condition for the driver

Initializes the fault condition by using the nFAULT pin and the properties of that pin to signal the code that there is something wrong with the motor (usually high heat or a short through the wire). Once the fault pin is triggered, the driver will shut down the motors

◆ nSLEEP

driver.DRV8847.nSLEEP

Initializes the Sleep pin.

Initializes the sleep pin that controls a pin of the board thatenables the driver to allow the motors to spin, or
disable the driver to keep the motors from spinning if there is a fault.


The documentation for this class was generated from the following files: