Luisa Chiu Portfolio
DRV8847.DRV8847 Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
nSLEEPThis is an active-high enable pin that corresponds to pin A15
nFAULTThis is a pin that detects faults and corresponds to pin B2
timVariable that specifies timer number

Member Function Documentation

◆ fault_cb()

def DRV8847.DRV8847.fault_cb (   self,
  IRQ_irc 
)

Callback function to run on fault condition.

Parameters
IRQ_srcThe source of the interrupt request.

◆ motor()

def DRV8847.DRV8847.motor (   self,
  pinA,
  pinB,
  channel_A,
  channel_B 
)

Initializes and return a motor object associated with DRV8847.

Returns
An object of class Motor

Member Data Documentation

◆ fault

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

◆ fault_cb_flag

DRV8847.DRV8847.fault_cb_flag

A boolean flag that signals the motor of a fault detection.

This variable initializes the fault callback flag

◆ nFAULT

DRV8847.DRV8847.nFAULT

This is a pin that detects faults and corresponds to pin B2.

Detects fault conditions that may damage the motors

◆ nSLEEP

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.

◆ tim

DRV8847.DRV8847.tim

Variable that specifies timer number.

Uses an attribute of frequency to create a timer object


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