![]() |
![]() |
|
MSPM0C1106HallSensoredTrapMotorControlLibrary
1.0
|
Data Structures | |
| struct | drv8328_Instance |
| Defines drv8328 instance. More... | |
Macros | |
| #define | drv8328_MAXIMUM_WAKEUP_TIME (2000) |
| Defines the time to wakeup the drv after reset. | |
| #define | drv8328_VOLTAGE_CONV_CONST _IQ20(23.044) |
| Defines voltage conversion constant. | |
| #define | drv8328_CSA_REF_VOLTAGE (3300) |
| Defines CSA reference voltage. | |
Enumerations | |
| enum | drv8328_DRVOFF_PIN_STAT { drv8328_DRVOFF_PIN_LOW = HAL_GPIO_PIN_LOW, drv8328_DRVOFF_PIN_HIGH = HAL_GPIO_PIN_HIGH } |
| enum | drv8328_DRV_NSLEEP_STAT { drv8328_DRV_NSLEEP_SLEEP = HAL_GPIO_PIN_LOW, drv8328_DRV_NSLEEP_AWAKE = HAL_GPIO_PIN_HIGH } |
| Represents NSLEEP Pin State. More... | |
Functions | |
| __STATIC_INLINE void | drv8328_setDrvoff (drv8328_Instance *drvHandle, drv8328_DRVOFF_PIN_STAT value) |
| set drvoff More... | |
| __STATIC_INLINE void | drv8328_setnSleep (drv8328_Instance *drvHandle, drv8328_DRV_NSLEEP_STAT value) |
| set nSleep More... | |
| __STATIC_INLINE _iq20 | drv8328_getcsaVref (uint16_t vRef) |
| get Current reference in IQ20 More... | |
| void | drv8328_init (drv8328_Instance *drvHandle) |
| initialize the drv8328 module More... | |
| void | drv8328_enable (drv8328_Instance *drvHandle) |
| Enable DRV. More... | |
| void | drv8328_updateCSAScaleFactor (drv8328_Instance *drvHandle, uint16_t csa) |
| updates the current gain scale factor More... | |
| _iq20 | drv8328_getVoltage (HAL_ADC_CHAN chan) |
| Get voltage from adc channel. More... | |
| _iq20 | drv8328_getCurrent (HAL_ADC_CHAN chan, drv8328_Instance *drvHandle) |
| Get current from adc channel. More... | |
| void | drv8328_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 void drv8328_setDrvoff | ( | drv8328_Instance * | drvHandle, |
| drv8328_DRVOFF_PIN_STAT | value | ||
| ) |
set drvoff
| [in] | drvHandle | The drv instance |
| [in] | value | drvoff value |
References drv8328_DRVOFF_PIN_HIGH, drv8328_DRVOFF_PIN_LOW, drv8328_Instance::drvoff, HAL_GPIO_PIN_HIGH, HAL_GPIO_PIN_LOW, and HAL_writeGPIOPin().
Referenced by drv8328_enable().
| __STATIC_INLINE void drv8328_setnSleep | ( | drv8328_Instance * | drvHandle, |
| drv8328_DRV_NSLEEP_STAT | value | ||
| ) |
set nSleep
| [in] | drvHandle | The drv instance |
| [in] | value | nSleep value |
References drv8328_DRV_NSLEEP_AWAKE, drv8328_DRV_NSLEEP_SLEEP, drv8328_MAXIMUM_WAKEUP_TIME, HAL_delayMicroSeconds(), HAL_GPIO_PIN_HIGH, HAL_GPIO_PIN_LOW, HAL_writeGPIOPin(), and drv8328_Instance::nsleep.
Referenced by drv8328_enable().
| __STATIC_INLINE _iq20 drv8328_getcsaVref | ( | uint16_t | vRef | ) |
get Current reference in IQ20
| [in] | vRef | CSA reference voltage in milli volts |
References drv8328_ADCVRefSel(), drv8328_enable(), drv8328_getCurrent(), drv8328_getVoltage(), drv8328_init(), and drv8328_updateCSAScaleFactor().
| void drv8328_init | ( | drv8328_Instance * | drvHandle | ) |
initialize the drv8328 module
| [in] | drvHandle | The drv8328 instance |
References HAL_enableADCInterrupt(), drv8328_Instance::Isen, drv8328_Instance::Vsen, drv8328_Instance::VsenA, drv8328_Instance::VsenB, and drv8328_Instance::VsenC.
Referenced by drv8328_getcsaVref().
| void drv8328_enable | ( | drv8328_Instance * | drvHandle | ) |
Enable DRV.
| [in] | drvHandle | The drv8328 instance |
References drv8328_DRV_NSLEEP_AWAKE, drv8328_DRV_NSLEEP_SLEEP, drv8328_DRVOFF_PIN_LOW, drv8328_setDrvoff(), and drv8328_setnSleep().
Referenced by drv8328_getcsaVref().
| void drv8328_updateCSAScaleFactor | ( | drv8328_Instance * | drvHandle, |
| uint16_t | csa | ||
| ) |
updates the current gain scale factor
| [in] | drvHandle | The drv8328 instance |
| [in] | csa | drv8328 CSA gain value |
References drv8328_Instance::csa_sf.
Referenced by drv8328_getcsaVref().
| _iq20 drv8328_getVoltage | ( | HAL_ADC_CHAN | chan | ) |
Get voltage from adc channel.
| [in] | chan | The ADC channel name |
References drv8328_VOLTAGE_CONV_CONST, and HAL_getIQ20VoltageFromADC().
Referenced by drv8328_getcsaVref().
| _iq20 drv8328_getCurrent | ( | HAL_ADC_CHAN | chan, |
| drv8328_Instance * | drvHandle | ||
| ) |
Get current from adc channel.
| [in] | chan | The ADC channel name |
| [in] | drvHandle | The drv instance |
References drv8328_Instance::csa_sf, and HAL_getIQ20VoltageFromADC().
Referenced by drv8328_getcsaVref().
| void drv8328_ADCVRefSel | ( | HAL_ADC_VREF | adcRef, |
| HAL_ADC_CHAN | chan, | ||
| HAL_ADC_INT_VREF | internalVRef, | ||
| uint16_t | externalVRef | ||
| ) |
updates the adc voltage reference
| [in] | adcRef | ADC voltage reference |
| [in] | chan | The ADC channel name |
| [in] | internalVRef | Internal reference voltage |
| [in] | externalVRef | External reference voltage |
References HAL_ADC_VREF_EXTERNAL, HAL_ADC_VREF_INTERNAL, HAL_ADC_VREF_VDDA, HAL_setADCVRefExternal(), HAL_setADCVRefInternal(), and HAL_setADCVRefVDDA().
Referenced by drv8328_getcsaVref().