MSPM0C1106HallSensoredTrapMotorControlLibrary  1.0
Data Structures | Macros | Enumerations | Functions
Motor Driver/DRV8353

Data Structures

struct  DRV8353_Instance
 Defines DRV8353 instance. More...
 

Macros

#define DRV8353_ADDR_MASK   (0x7E00)
 Defines the address mask.
 
#define DRV8353_DATA_MASK   (0x00FF)
 Defines the data mask.
 
#define DRV8353_DATA_TRANSMIT_TO_READ   (0x00)
 Defines the data transmitted while reading a register.
 
#define DRV8353_INITIAL_PARITY   (0x00)
 Defines the initial parity of command word.
 
#define DRV8353_PARITY_CHECK   (0x01)
 Defines the parity checking bit.
 
#define DRV8353_RIGHT_SHIFT_REGISTER   (1)
 Defines the number of bits right shifted.
 
#define DRV8353_PARITY_BIT_POSITION   (8)
 Defines the position of the parity in command word.
 
#define DRV8353_ADDR_BIT_POSITION   (9)
 Defines the position of the parity in command word.
 
#define DRV8353_SPICMD_BIT_POSITION   (15)
 Defines the position of the parity in command word.
 
#define DRV8353_CLEAR_BIT_MASK   (0x01)
 Defines the claer bit mask.
 
#define DRV8353_MAXIMUM_RESET_TIME   (40)
 Defines the time to clear the nSLEEP pin to reset faults.
 
#define DRV8353_MAXIMUM_WAKEUP_TIME   (2000)
 Defines the time to wakeup the drv after reset.
 
#define DRV8353_VOLTAGE_CONV_CONST   _IQ20(39.582)
 Defines voltage conversion constant.
 
#define DRV8353_CSA_REF_VOLTAGE   (3300)
 Defines CSA reference voltage.
 

Enumerations

enum  DRV8353_DRV_NSLEEP_STAT {
  DRV8353_DRV_NSLEEP_SLEEP = HAL_GPIO_PIN_LOW,
  DRV8353_DRV_NSLEEP_AWAKE = HAL_GPIO_PIN_HIGH
}
 

Functions

__STATIC_INLINE void DRV8353_setnSleep (DRV8353_Instance *drvHandle, DRV8353_DRV_NSLEEP_STAT value)
 set nSleep More...
 
void DRV8353_init (DRV8353_Instance *drvHandle)
 initialize the drv8353 module More...
 
void DRV8353_enable (DRV8353_Instance *drvHandle)
 Enable DRV. More...
 
void DRV8353_updateCSAScaleFactor (DRV8353_Instance *drvHandle, uint16_t csa)
 updates the current gain scale factor More...
 
_iq20 DRV8353_getVoltage (HAL_ADC_CHAN chan)
 Get voltage from adc channel. More...
 
_iq20 DRV8353_getCurrent (HAL_ADC_CHAN chan, DRV8353_Instance *drvHandle, _iq20 vRef)
 Get current from adc channel. More...
 
void DRV8353_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 DRV8353_getcsaVref (uint16_t vRef)
 get Current reference in IQ20 More...
 

Detailed Description

Enumeration Type Documentation

§ DRV8353_DRV_NSLEEP_STAT

Enumerator
DRV8353_DRV_NSLEEP_SLEEP 

Define NSLEEP PIN LOW.

DRV8353_DRV_NSLEEP_AWAKE 

Define NSLEEP PIN HIGH.

Function Documentation

§ DRV8353_setnSleep()

__STATIC_INLINE void DRV8353_setnSleep ( DRV8353_Instance drvHandle,
DRV8353_DRV_NSLEEP_STAT  value 
)

§ DRV8353_init()

void DRV8353_init ( DRV8353_Instance drvHandle)

§ DRV8353_enable()

void DRV8353_enable ( DRV8353_Instance drvHandle)

Enable DRV.

Parameters
[in]drvHandleThe drv instance

References DRV8353_DRV_NSLEEP_AWAKE, DRV8353_DRV_NSLEEP_SLEEP, and DRV8353_setnSleep().

Referenced by DRV8353_setnSleep().

§ DRV8353_updateCSAScaleFactor()

void DRV8353_updateCSAScaleFactor ( DRV8353_Instance drvHandle,
uint16_t  csa 
)

updates the current gain scale factor

Parameters
[in]drvHandleThe drv instance
[in]csaDRV8353 CSA gain value

References DRV8353_Instance::csa_sf.

Referenced by DRV8353_setnSleep().

§ DRV8353_getVoltage()

_iq20 DRV8353_getVoltage ( HAL_ADC_CHAN  chan)

Get voltage from adc channel.

Parameters
[in]chanThe ADC channel name
Returns
Return

References DRV8353_VOLTAGE_CONV_CONST, and HAL_getIQ20VoltageFromADC().

Referenced by DRV8353_setnSleep().

§ DRV8353_getCurrent()

_iq20 DRV8353_getCurrent ( HAL_ADC_CHAN  chan,
DRV8353_Instance drvHandle,
_iq20  vRef 
)

Get current from adc channel.

Parameters
[in]chanThe ADC channel name
[in]drvHandleThe drv instance
[in]vRefvoltage reference for current
Returns
Return

References DRV8353_Instance::csa_sf, and HAL_getIQ20VoltageFromADC().

Referenced by DRV8353_setnSleep().

§ DRV8353_ADCVRefSel()

void DRV8353_ADCVRefSel ( HAL_ADC_VREF  adcRef,
HAL_ADC_CHAN  chan,
HAL_ADC_INT_VREF  internalVRef,
uint16_t  externalVRef 
)

updates the adc voltage reference

Parameters
[in]adcRefADC voltage reference
[in]chanADC channel name
[in]internalVRefInternal reference voltage
[in]externalVRefExternal reference voltage

References HAL_ADC_VREF_EXTERNAL, HAL_ADC_VREF_INTERNAL, HAL_ADC_VREF_VDDA, HAL_setADCVRefExternal(), HAL_setADCVRefInternal(), and HAL_setADCVRefVDDA().

Referenced by DRV8353_setnSleep().

§ DRV8353_getcsaVref()

__STATIC_INLINE _iq20 DRV8353_getcsaVref ( uint16_t  vRef)

get Current reference in IQ20

Parameters
[in]vRefCSA reference voltage in milli volts
Returns
_iq20 CSA reference voltage in _iq20 format
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale