![]() |
![]() |
|
MSPM0C1106HallSensoredTrapMotorControlLibrary
1.0
|
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... | |
| __STATIC_INLINE void DRV8353_setnSleep | ( | DRV8353_Instance * | drvHandle, |
| DRV8353_DRV_NSLEEP_STAT | value | ||
| ) |
set nSleep
| [in] | drvHandle | The drv instance |
| [in] | value | nSleep value |
References DRV8353_ADCVRefSel(), DRV8353_DRV_NSLEEP_AWAKE, DRV8353_DRV_NSLEEP_SLEEP, DRV8353_enable(), DRV8353_getCurrent(), DRV8353_getVoltage(), DRV8353_init(), DRV8353_MAXIMUM_WAKEUP_TIME, DRV8353_updateCSAScaleFactor(), HAL_delayMicroSeconds(), HAL_GPIO_PIN_HIGH, HAL_GPIO_PIN_LOW, HAL_writeGPIOPin(), and DRV8353_Instance::nsleep.
Referenced by DRV8353_enable().
| void DRV8353_init | ( | DRV8353_Instance * | drvHandle | ) |
initialize the drv8353 module
| [in] | drvHandle | The drv instance |
References HAL_enableADCInterrupt(), DRV8353_Instance::IsenA, DRV8353_Instance::IsenB, DRV8353_Instance::IsenC, DRV8353_Instance::Vsen, DRV8353_Instance::VsenA, DRV8353_Instance::VsenB, and DRV8353_Instance::VsenC.
Referenced by DRV8353_setnSleep().
| void DRV8353_enable | ( | DRV8353_Instance * | drvHandle | ) |
Enable DRV.
| [in] | drvHandle | The drv instance |
References DRV8353_DRV_NSLEEP_AWAKE, DRV8353_DRV_NSLEEP_SLEEP, and DRV8353_setnSleep().
Referenced by DRV8353_setnSleep().
| void DRV8353_updateCSAScaleFactor | ( | DRV8353_Instance * | drvHandle, |
| uint16_t | csa | ||
| ) |
updates the current gain scale factor
| [in] | drvHandle | The drv instance |
| [in] | csa | DRV8353 CSA gain value |
References DRV8353_Instance::csa_sf.
Referenced by DRV8353_setnSleep().
| _iq20 DRV8353_getVoltage | ( | HAL_ADC_CHAN | chan | ) |
Get voltage from adc channel.
| [in] | chan | The ADC channel name |
References DRV8353_VOLTAGE_CONV_CONST, and HAL_getIQ20VoltageFromADC().
Referenced by DRV8353_setnSleep().
| _iq20 DRV8353_getCurrent | ( | HAL_ADC_CHAN | chan, |
| DRV8353_Instance * | drvHandle, | ||
| _iq20 | vRef | ||
| ) |
Get current from adc channel.
| [in] | chan | The ADC channel name |
| [in] | drvHandle | The drv instance |
| [in] | vRef | voltage reference for current |
References DRV8353_Instance::csa_sf, and HAL_getIQ20VoltageFromADC().
Referenced by DRV8353_setnSleep().
| void DRV8353_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 | 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 DRV8353_setnSleep().
| __STATIC_INLINE _iq20 DRV8353_getcsaVref | ( | uint16_t | vRef | ) |
get Current reference in IQ20
| [in] | vRef | CSA reference voltage in milli volts |