MSPM0C1106HallSensoredTrapMotorControlLibrary  1.0
Data Structures | Macros | Enumerations | Functions
drv8311.h File Reference

Detailed Description

drv8311_MODULE Module


Overview

API's releated to drv8311


#include "hal.h"
Include dependency graph for drv8311.h:

Go to the source code of this file.

Data Structures

struct  drv8311_Instance
 Defines drv8311 instance. More...
 

Macros

#define drv8311_MAXIMUM_RESET_TIME   (40)
 Defines the time to clear the nSLEEP pin to reset faults.
 
#define drv8311_MAXIMUM_WAKEUP_TIME   (2000)
 Defines the time to wakeup the drv after reset.
 
#define drv8311_VOLTAGE_CONV_CONST   _IQ20(8.143)
 Defines voltage conversion constant.
 
#define drv8311_CSA_REF_VOLTAGE   (3000)
 Defines CSA reference voltage.
 
#define drv8311_CSAGAIN_0P25VA_IQ   _IQ20(0.25)
 Defines CSA gains 0.25 in IQ20.
 
#define drv8311_CSAGAIN_0P5VA_IQ   _IQ20(0.5)
 Defines CSA gains 0.5 in IQ20.
 
#define drv8311_CSAGAIN_1P0VA_IQ   _IQ20(1.0)
 Defines CSA gains 1.0 in IQ20.
 
#define drv8311_CSAGAIN_2P0VA_IQ   _IQ20(2.0)
 Defines CSA gains 2.0 in IQ20.
 

Enumerations

enum  drv8311_CSAGAIN {
  drv8311_CSAGAIN_0P25VA = 0x00 << 0,
  drv8311_CSAGAIN_0P5VA = 0x01 << 0,
  drv8311_CSAGAIN_1P0VA = 0x02 << 0,
  drv8311_CSAGAIN_2P0VA = 0x03 << 0
}
 
enum  drv8311_DRVOFF_PIN_STAT {
  drv8311_DRVOFF_PIN_LOW = HAL_GPIO_PIN_LOW,
  drv8311_DRVOFF_PIN_HIGH = HAL_GPIO_PIN_HIGH
}
 
enum  drv8311_DRV_NSLEEP_STAT {
  drv8311_DRV_NSLEEP_SLEEP = HAL_GPIO_PIN_LOW,
  drv8311_DRV_NSLEEP_AWAKE = HAL_GPIO_PIN_HIGH
}
 

Functions

__STATIC_INLINE void drv8311_setDrvoff (drv8311_Instance *drvHandle, drv8311_DRVOFF_PIN_STAT value)
 set drvoff More...
 
__STATIC_INLINE void drv8311_setnSleep (drv8311_Instance *drvHandle, drv8311_DRV_NSLEEP_STAT value)
 set nSleep More...
 
void drv8311_init (drv8311_Instance *drvHandle)
 initialize the drv8311 module More...
 
void drv8311_enable (drv8311_Instance *drvHandle)
 Enable DRV. More...
 
void drv8311_updateCSAScaleFactor (drv8311_Instance *drvHandle, drv8311_CSAGAIN csa)
 updates the current gain scale factor More...
 
_iq20 drv8311_getVoltage (HAL_ADC_CHAN chan)
 Get voltage from adc channel. More...
 
_iq20 drv8311_getCurrent (HAL_ADC_CHAN chan, drv8311_Instance *drvHandle, _iq20 vRef)
 Get current from adc channel. More...
 
void drv8311_ADCVRefSel (HAL_ADC_VREF adcRef, HAL_ADC_CHAN chan, HAL_ADC_INT_VREF internalVRef, uint16_t externalVRef)
 updates the adc voltage reference More...
 
__STATIC_INLINE _iq20 drv8311_getcsaVref (uint16_t vRef)
 get Current reference in IQ20 More...
 
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale