MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Enumerations | Functions
drv8312kit_revD/f28x/f2806x/src/float/hal.h File Reference

Contains public interface to various functions related to the HAL object. More...

`#include "sw/modules/math/src/float/math.h"`
`#include "hal_obj.h"`

Go to the source code of this file.

## Macros
#define | Device_cal (void (*)(void))0x3D7C80
#define | FP_SCALE 32768
| Defines used in oscillator calibration functions. More...
#define | FP_ROUND FP_SCALE/2
| Defines the quantity added to Q15 numbers before converting to integer to round the number. More...
#define | OSC_POSTRIM 32
| Defines the amount to add to Q16.15 fixed point number to shift from a fine trim range of. More...
#define | OSC_POSTRIM_OFF FP_SCALE*OSC_POSTRIM
#define | getOsc1FineTrimSlope() (*(int16_t (*)(void))0x3D7E90)()
| The following functions return reference values stored in OTP. More...
#define | getOsc1FineTrimOffset() (*(int16_t (*)(void))0x3D7E93)()
| Defines the oscillator 1 fine trim at high temp. More...
#define | getOsc1CoarseTrim() (*(int16_t (*)(void))0x3D7E96)()
| Defines the oscillator 1 coarse trim. More...
#define | getOsc2FineTrimSlope() (*(int16_t (*)(void))0x3D7E99)()
| Defines the slope used to compensate oscillator 2 (fine trim steps / ADC code). Stored. More...
#define | getOsc2FineTrimOffset() (*(int16_t (*)(void))0x3D7E9C)()
| Defines the oscillator 2 fine trim at high temp. More...
#define | getOsc2CoarseTrim() (*(int16_t (*)(void))0x3D7E9F)()
| Defines the oscillator 2 coarse trim. More...
#define | getRefTempOffset() (*(int16_t (*)(void))0x3D7EA2)()
| Defines the ADC reading of temperature sensor at reference temperature for compensation. More...
#define | HAL_PWM_DBFED_CNT 1
| Defines the PWM deadband falling edge delay count (system clocks) More...
#define | HAL_PWM_DBRED_CNT 1
| Defines the PWM deadband rising edge delay count (system clocks) More...
#define | HAL_turnLedOff HAL_setGpioLow
| Defines the function to turn LEDs off. More...
#define | HAL_turnLedOn HAL_setGpioHigh
| Defines the function to turn LEDs on. More...
#define | HAL_toggleLed HAL_toggleGpio
| Defines the function to turn LEDs on. More...

## Enumerations
enum | HAL_LedNumber_e { HAL_Gpio_LED2 =GPIO_Number_34, HAL_Gpio_LED3 =GPIO_Number_39, HAL_Gpio_LED2 =GPIO_Number_34, HAL_Gpio_LED3 =GPIO_Number_39, HAL_Gpio_LED2 =GPIO_Number_31, HAL_Gpio_LED3 =GPIO_Number_34, HAL_Gpio_LED2 =GPIO_Number_31, HAL_Gpio_LED3 =GPIO_Number_34, HAL_Gpio_LED2 =GPIO_Number_31, HAL_Gpio_LED3 =GPIO_Number_34, HAL_Gpio_LED2 =GPIO_Number_31, HAL_Gpio_LED3 =GPIO_Number_34, HAL_Gpio_LED2 =GPIO_Number_31, HAL_Gpio_LED3 =GPIO_Number_34, HAL_Gpio_LED2 =GPIO_Number_31, HAL_Gpio_LED3 =GPIO_Number_34 }
| Enumeration for the LED numbers. More...
enum | HAL_PwmFreq_e { HAL_PwmFreq_2_kHz = 22500, HAL_PwmFreq_3_kHz = 15000, HAL_PwmFreq_4_kHz = 11250, HAL_PwmFreq_5_kHz = 9000, HAL_PwmFreq_6_kHz = 7500, HAL_PwmFreq_8_kHz = 5625, HAL_PwmFreq_9_kHz = 5000, HAL_PwmFreq_10_kHz = 4500, HAL_PwmFreq_12_kHz = 3750, HAL_PwmFreq_15_kHz = 3000, HAL_PwmFreq_18_kHz = 2500, HAL_PwmFreq_20_kHz = 2250, HAL_PwmFreq_24_kHz = 1875, HAL_PwmFreq_25_kHz = 1800, HAL_PwmFreq_30_kHz = 1500, HAL_PwmFreq_36_kHz = 1250, HAL_PwmFreq_40_kHz = 1125, HAL_PwmFreq_45_kHz = 1000, HAL_PwmFreq_50_kHz = 900, HAL_PwmFreq_60_kHz = 750, HAL_PwmFreq_75_kHz = 600, HAL_PwmFreq_90_kHz = 500, HAL_PwmFreq_100_kHz = 450, HAL_PwmFreq_120_kHz = 375, HAL_PwmFreq_125_kHz = 360, HAL_PwmFreq_150_kHz = 300, HAL_PwmFreq_2_kHz = 22500, HAL_PwmFreq_3_kHz = 15000, HAL_PwmFreq_4_kHz = 11250, HAL_PwmFreq_5_kHz = 9000, HAL_PwmFreq_6_kHz = 7500, HAL_PwmFreq_8_kHz = 5625, HAL_PwmFreq_9_kHz = 5000, HAL_PwmFreq_10_kHz = 4500, HAL_PwmFreq_12_kHz = 3750, HAL_PwmFreq_15_kHz = 3000, HAL_PwmFreq_18_kHz = 2500, HAL_PwmFreq_20_kHz = 2250, HAL_PwmFreq_24_kHz = 1875, HAL_PwmFreq_25_kHz = 1800, HAL_PwmFreq_30_kHz = 1500, HAL_PwmFreq_36_kHz = 1250, HAL_PwmFreq_40_kHz = 1125, HAL_PwmFreq_45_kHz = 1000, HAL_PwmFreq_50_kHz = 900, HAL_PwmFreq_60_kHz = 750, HAL_PwmFreq_75_kHz = 600, HAL_PwmFreq_90_kHz = 500, HAL_PwmFreq_100_kHz = 450, HAL_PwmFreq_120_kHz = 375, HAL_PwmFreq_125_kHz = 360, HAL_PwmFreq_150_kHz = 300, HAL_PwmFreq_2_kHz = 22500, HAL_PwmFreq_3_kHz = 15000, HAL_PwmFreq_4_kHz = 11250, HAL_PwmFreq_5_kHz = 9000, HAL_PwmFreq_6_kHz = 7500, HAL_PwmFreq_8_kHz = 5625, HAL_PwmFreq_9_kHz = 5000, HAL_PwmFreq_10_kHz = 4500, HAL_PwmFreq_12_kHz = 3750, HAL_PwmFreq_15_kHz = 3000, HAL_PwmFreq_18_kHz = 2500, HAL_PwmFreq_20_kHz = 2250, HAL_PwmFreq_24_kHz = 1875, HAL_PwmFreq_25_kHz = 1800, HAL_PwmFreq_30_kHz = 1500, HAL_PwmFreq_36_kHz = 1250, HAL_PwmFreq_40_kHz = 1125, HAL_PwmFreq_45_kHz = 1000, HAL_PwmFreq_50_kHz = 900, HAL_PwmFreq_60_kHz = 750, HAL_PwmFreq_75_kHz = 600, HAL_PwmFreq_90_kHz = 500, HAL_PwmFreq_100_kHz = 450, HAL_PwmFreq_120_kHz = 375, HAL_PwmFreq_125_kHz = 360, HAL_PwmFreq_150_kHz = 300 }
| Enumeration for the PWM frequencies. More...
enum | HAL_SensorType_e { HAL_SensorType_Current =0, HAL_SensorType_Voltage, HAL_SensorType_Current =0, HAL_SensorType_Voltage, HAL_SensorType_Current =0, HAL_SensorType_Voltage, HAL_SensorType_Current =0, HAL_SensorType_Voltage, HAL_SensorType_Current =0, HAL_SensorType_Voltage, HAL_SensorType_Current =0, HAL_SensorType_Voltage, HAL_SensorType_Current =0, HAL_SensorType_Voltage, HAL_SensorType_Current =0, HAL_SensorType_Voltage }
| Enumeration for the sensor types. More...

## Functions
interrupt void | led2ISR (void)
interrupt void | led3OffISR (void)
interrupt void | led3OnISR (void)
interrupt void | mainISR (void)
void | HAL_AdcCalChanSelect (HAL_Handle handle, const ADC_SocChanNumber_e chanNumber)
| Selects the analog channel used for calibration. More...
uint16_t | HAL_AdcCalConversion (HAL_Handle handle)
| Reads the converted value from the selected calibration channel. More...
void | HAL_AdcOffsetSelfCal (HAL_Handle handle)
| Executes the offset calibration of the ADC. More...
static void | HAL_acqAdcInt (HAL_Handle handle, const ADC_IntNumber_e intNumber)
| Acknowledges an interrupt from the ADC so that another ADC interrupt can happen again. More...
static void | HAL_acqPwmInt (HAL_Handle handle, const PWM_Number_e pwmNumber)
| Acknowledges an interrupt from the PWM so that another PWM interrupt can happen again. More...
void | HAL_cal (HAL_Handle handle)
| Executes calibration routines. More...
void | HAL_disableGlobalInts (HAL_Handle handle)
| Disables global interrupts. More...
static void | HAL_disablePwm (HAL_Handle handle)
| Disables the PWM device. More...
static void | HAL_disableTbClockSync (HAL_Handle handle)
| Disables the ePWM module time base clock sync signal. More...
void | HAL_enableAdcInts (HAL_Handle handle)
| Enables the ADC interrupts. More...
void | HAL_enableDebugInt (HAL_Handle handle)
| Enables the debug interrupt. More...
void | HAL_enableGlobalInts (HAL_Handle handle)
| Enables global interrupts. More...
static void | HAL_enablePwm (HAL_Handle handle)
| Enables the PWM devices. More...
void | HAL_enablePwmInt (HAL_Handle handle)
| Enables the PWM interrupt. More...
static void | HAL_enableTbClockSync (HAL_Handle handle)
| Enables the ePWM module time base clock sync signal. More...
static ADC_SocSampleDelay_e | HAL_getAdcSocSampleDelay (HAL_Handle handle, const ADC_SocNumber_e socNumber)
| Gets the ADC delay value. More...
static float_t | HAL_getBias (HAL_Handle handle, const HAL_SensorType_e sensorType, uint_least8_t sensorNumber)
| Gets the ADC bias value. More...
static float_t | HAL_getCurrentScaleFactor (HAL_Handle handle)
| Gets the current scale factor. More...
static void | HAL_getDutyCycles (HAL_Handle handle, uint16_t *pDutyCycles)
| Gets the PWM duty cycle times. More...
static uint_least8_t | HAL_getNumCurrentSensors (HAL_Handle handle)
| Gets the number of current sensors. More...
static uint_least8_t | HAL_getNumVoltageSensors (HAL_Handle handle)
| Gets the number of voltage sensors. More...
static float_t | HAL_getVoltageScaleFactor (HAL_Handle handle)
| Gets the voltage scale factor. More...
void | HAL_setupFaults (HAL_Handle handle)
| Configures the fault protection logic. More...
HAL_Handle | HAL_init (void *pMemory, const size_t numBytes)
| Initializes the hardware abstraction layer (HAL) object. More...
void | HAL_OscTempComp (HAL_Handle handle)
| Executes the oscillator 1 and 2 calibration functions. More...
void | HAL_osc1Comp (HAL_Handle handle, const int16_t sensorSample)
| Executes the oscillator 1 calibration based on input sample. More...
void | HAL_osc2Comp (HAL_Handle handle, const int16_t sensorSample)
| Executes the oscillator 2 calibration based on input sample. More...
uint16_t | HAL_computeOscTrimValue (int16_t coarse, int16_t fine)
static void | HAL_initIntVectorTable (HAL_Handle handle)
| Initializes the interrupt vector table. More...
static void | HAL_readAdcData (HAL_Handle handle, HAL_AdcData_t *pAdcData)
| Reads the ADC data. More...
static void | HAL_readAdcDataWithOffsets (HAL_Handle handle, HAL_AdcData_t *pAdcData)
static uint32_t | HAL_readTimerCnt (HAL_Handle handle, const uint_least8_t timerNumber)
| Reads the timer count. More...
static void | HAL_resetPwmCount (HAL_Handle handle, PWM_Number_e pwmNumber)
| Resets the PWM count. More...
static void | HAL_setAdcSocSampleDelay (HAL_Handle handle, const ADC_SocNumber_e socNumber, const ADC_SocSampleDelay_e sampleDelay)
| Sets the ADC SOC sample delay value. More...
static void | HAL_setBias (HAL_Handle handle, const HAL_SensorType_e sensorType, uint_least8_t sensorNumber, const float_t bias)
| Sets the ADC bias value. More...
static void | HAL_setCurrentScaleFactor (HAL_Handle handle, const float_t current_sf)
| Sets the current scale factor in the hal. More...
static void | HAL_setGpioHigh (HAL_Handle handle, const GPIO_Number_e gpioNumber)
| Sets the GPIO pin high. More...
static void | HAL_setGpioLow (HAL_Handle handle, const GPIO_Number_e gpioNumber)
| Sets the GPIO pin low. More...
static void | HAL_setNumCurrentSensors (HAL_Handle handle, const uint_least8_t numCurrentSensors)
| Sets the number of current sensors. More...
static void | HAL_setNumVoltageSensors (HAL_Handle handle, const uint_least8_t numVoltageSensors)
| Sets the number of voltage sensors. More...
static void | HAL_setPwmFreq_kHz (HAL_Handle handle, PWM_Number_e pwmNumber, HAL_PwmFreq_e pwmFreq_kHz)
| Sets the PWM frequency. More...
static void | HAL_setVoltageScaleFactor (HAL_Handle handle, const float_t voltage_sf)
| Sets the voltage scale factor in the hal. More...
void | HAL_setParams (HAL_Handle handle, const USER_Params *pUserParams)
| Sets the hardware abstraction layer parameters. More...
void | HAL_setupAdcs (HAL_Handle handle)
| Sets up the ADCs (Analog to Digital Converters) More...
void | HAL_setupClks (HAL_Handle handle)
| Sets up the clocks. More...
void | HAL_setupGpios (HAL_Handle handle)
| Sets up the GPIO (General Purpose I/O) pins. More...
void | HAL_setupFlash (HAL_Handle handle)
| Sets up the FLASH. More...
void | HAL_setupPeripheralClks (HAL_Handle handle)
| Sets up the peripheral clocks. More...
void | HAL_setupPie (HAL_Handle handle)
| Sets up the PIE (Peripheral Interrupt Expansion) More...
void | HAL_setupPll (HAL_Handle handle, const PLL_ClkFreq_e clkFreq)
| Sets up the PLL (Phase Lock Loop) More...
void | HAL_setupPwms (HAL_Handle handle, const float_t systemFreq_MHz, const float_t pwmPeriod_usec, const uint_least16_t numPwmTicksPerIsrTick)
| Sets up the PWMs (Pulse Width Modulators) More...
void | HAL_setupPwmDacs (HAL_Handle handle, const float_t systemFreq_MHz, const float_t dacFreq_kHz)
| Sets up the PWM DACs (Pulse Width Modulator Digital to Analof Converters) More...
void | HAL_setupQEP (QEP_Handle qepHandle, const USER_Params *pUserParams, const uint32_t unitTimerFreq_Hz)
| Sets up the QEP peripheral (Quadrature Encoder) More...
void | HAL_setupSpiA (HAL_Handle handle)
| Sets up the spiA peripheral. More...
void | HAL_setupSpiB (HAL_Handle handle)
| Sets up the spiB peripheral. More...
void | HAL_setupTimers (HAL_Handle handle, const float_t systemFreq_MHz)
| Sets up the timers. More...
static void | HAL_toggleGpio (HAL_Handle handle, const GPIO_Number_e gpioNumber)
| Toggles the GPIO pin. More...
static void | HAL_updateAdcBias (HAL_Handle handle, OFFSET_Handle *pOffsetHandle_I, OFFSET_Handle *pOffsetHandle_V)
| Updates the ADC bias values. More...
static void | HAL_writeDacData (HAL_Handle handle, const HAL_DacData_t *pDacData)
| Writes DAC data to the PWM comparators for DAC (digital-to-analog conversion) output. More...
static void | HAL_writePwmData (HAL_Handle handle, const HAL_PwmData_t *pPwmData)
| Writes PWM data to the PWM comparators for motor control. More...
static uint16_t | HAL_readPwmPeriod (HAL_Handle handle, const PWM_Number_e pwmNumber)
| Reads PWM period register. More...

## Detailed Description

Contains public interface to various functions related to the HAL object.

(C) Copyright 2014, Texas Instruments, Inc.

Definition in file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

## Function Documentation

static void HAL_acqAdcInt | ( | HAL_Handle | handle,
|  | const ADC_IntNumber_e | intNumber
| ) |  |
| inline static

Acknowledges an interrupt from the ADC so that another ADC interrupt can happen again.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | intNumber | The interrupt number

Definition at line 213 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::adcHandle, and _HAL_Obj_::pieHandle.

static void HAL_acqPwmInt | ( | HAL_Handle | handle,
|  | const PWM_Number_e | pwmNumber
| ) |  |
| inline static

Acknowledges an interrupt from the PWM so that another PWM interrupt can happen again.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pwmNumber | The PWM number

Definition at line 233 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::pieHandle, and _HAL_Obj_::pwmHandle.

static void HAL_disablePwm | ( | HAL_Handle | handle | ) |
| inline static

Disables the PWM device.

Turns off the outputs of the EPWM peripherals which will put the power switches into a high impedance state.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Definition at line 270 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::pwmHandle.

static void HAL_disableTbClockSync | ( | HAL_Handle | handle | ) |
| inline static

Disables the ePWM module time base clock sync signal.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Definition at line 284 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::clkHandle.

static void HAL_enablePwm | ( | HAL_Handle | handle | ) |
| inline static

Enables the PWM devices.

Turns on the outputs of the EPWM peripheral which will allow the power switches to be controlled.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Definition at line 318 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::pwmHandle.

static void HAL_enableTbClockSync | ( | HAL_Handle | handle | ) |
| inline static

Enables the ePWM module time base clock sync signal.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Definition at line 337 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::clkHandle.

static ADC_SocSampleDelay_e HAL_getAdcSocSampleDelay | ( | HAL_Handle | handle,
|  | const ADC_SocNumber_e | socNumber
| ) |  |
| inline static

Gets the ADC delay value.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | socNumber | The ADC SOC number

Returns
  The ADC delay value

Definition at line 351 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::adcHandle.

static float_t HAL_getBias | ( | HAL_Handle | handle,
|  | const HAL_SensorType_e | sensorType,
|  | uint_least8_t | sensorNumber
| ) |  |
| inline static

Gets the ADC bias value.

The ADC bias contains the feedback circuit's offset and bias. Bias is the mathematical offset used when a bi-polar signal is read into a uni-polar ADC.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | sensorType | The sensor type
  [in] | sensorNumber | The sensor number

Returns
  The ADC bias value

Definition at line 368 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::adcBias, HAL_SensorType_Current, HAL_SensorType_Voltage, _HAL_AdcData_t_::I_A, _HAL_AdcData_t_::V_V, and _MATH_vec3_::value.

Referenced by HAL_updateAdcBias().

static float_t HAL_getCurrentScaleFactor | ( | HAL_Handle | handle | ) |
| inline static

Gets the current scale factor.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Returns
  The current scale factor

Definition at line 391 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::current_sf.

Referenced by HAL_readAdcData(), and HAL_readAdcDataWithOffsets().

static void HAL_getDutyCycles | ( | HAL_Handle | handle,
|  | uint16_t * | pDutyCycles
| ) |  |
| inline static

Gets the PWM duty cycle times.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pDutyCycles | A pointer to memory for the duty cycle durations

Definition at line 402 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::pwmHandle.

static uint_least8_t HAL_getNumCurrentSensors | ( | HAL_Handle | handle | ) |
| inline static

Gets the number of current sensors.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Returns
  The number of current sensors

Definition at line 417 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::numCurrentSensors.

Referenced by HAL_updateAdcBias().

static uint_least8_t HAL_getNumVoltageSensors | ( | HAL_Handle | handle | ) |
| inline static

Gets the number of voltage sensors.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Returns
  The number of voltage sensors

Definition at line 429 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::numVoltageSensors.

Referenced by HAL_updateAdcBias().

static float_t HAL_getVoltageScaleFactor | ( | HAL_Handle | handle | ) |
| inline static

Gets the voltage scale factor.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Returns
  The voltage scale factor

Definition at line 441 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::voltage_sf.

Referenced by HAL_readAdcData(), and HAL_readAdcDataWithOffsets().

static void HAL_initIntVectorTable | ( | HAL_Handle | handle | ) |
| inline static

Initializes the interrupt vector table.

Points the ISR to the function mainISR.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle

Definition at line 482 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References mainISR(), and _HAL_Obj_::pieHandle.

static void HAL_readAdcData | ( | HAL_Handle | handle,
|  | HAL_AdcData_t * | pAdcData
| ) |  |
| inline static

Reads the ADC data.

Reads in the ADC result registers, adjusts for offsets, and scales the values according to the settings in user.h. The structure gAdcData holds three phase voltages, three line currents, and one DC bus voltage.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pAdcData | A pointer to the ADC data buffer

Definition at line 508 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::adcBias, _HAL_Obj_::adcHandle, _HAL_AdcData_t_::dcBus_V, HAL_getCurrentScaleFactor(), HAL_getVoltageScaleFactor(), _HAL_AdcData_t_::I_A, _HAL_AdcData_t_::V_V, and _MATH_vec3_::value.

static void HAL_readAdcDataWithOffsets | ( | HAL_Handle | handle,
|  | HAL_AdcData_t * | pAdcData
| ) |  |
| inline static

Definition at line 557 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::adcHandle, _HAL_AdcData_t_::dcBus_V, HAL_getCurrentScaleFactor(), HAL_getVoltageScaleFactor(), _HAL_AdcData_t_::I_A, _HAL_AdcData_t_::V_V, and _MATH_vec3_::value.

static uint16_t HAL_readPwmPeriod | ( | HAL_Handle | handle,
|  | const PWM_Number_e | pwmNumber
| ) |  |
| inline static

Reads PWM period register.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pwmNumber | The PWM number

Returns
  The PWM period value

Definition at line 987 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::pwmHandle.

static uint32_t HAL_readTimerCnt | ( | HAL_Handle | handle,
|  | const uint_least8_t | timerNumber
| ) |  |
| inline static

Reads the timer count.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | timerNumber | The timer number, 0,1 or 2

Returns
  The timer count

Definition at line 603 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::timerHandle.

static void HAL_resetPwmCount | ( | HAL_Handle | handle,
|  | PWM_Number_e | pwmNumber
| ) |  |
| inline static

Resets the PWM count.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pwmNumber | The PWM number

Definition at line 615 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::pwmHandle.

static void HAL_setAdcSocSampleDelay | ( | HAL_Handle | handle,
|  | const ADC_SocNumber_e | socNumber,
|  | const ADC_SocSampleDelay_e | sampleDelay
| ) |  |
| inline static

Sets the ADC SOC sample delay value.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | socNumber | The SOC number
  [in] | sampleDelay | The delay value for the ADC

Definition at line 630 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::adcHandle.

static void HAL_setBias | ( | HAL_Handle | handle,
|  | const HAL_SensorType_e | sensorType,
|  | uint_least8_t | sensorNumber,
|  | const float_t | bias
| ) |  |
| inline static

Sets the ADC bias value.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | sensorType | The sensor type
  [in] | sensorNumber | The sensor number
  [in] | bias | The ADC bias value

Definition at line 647 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::adcBias, HAL_SensorType_Current, HAL_SensorType_Voltage, _HAL_AdcData_t_::I_A, _HAL_AdcData_t_::V_V, and _MATH_vec3_::value.

Referenced by HAL_updateAdcBias().

static void HAL_setCurrentScaleFactor | ( | HAL_Handle | handle,
|  | const float_t | current_sf
| ) |  |
| inline static

Sets the current scale factor in the hal.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | current_sf | The current scale factor

Definition at line 671 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::current_sf.

static void HAL_setGpioHigh | ( | HAL_Handle | handle,
|  | const GPIO_Number_e | gpioNumber
| ) |  |
| inline static

Sets the GPIO pin high.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | gpioNumber | The GPIO number

Definition at line 685 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::gpioHandle.

static void HAL_setGpioLow | ( | HAL_Handle | handle,
|  | const GPIO_Number_e | gpioNumber
| ) |  |
| inline static

Sets the GPIO pin low.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | gpioNumber | The GPIO number

Definition at line 700 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::gpioHandle.

static void HAL_setNumCurrentSensors | ( | HAL_Handle | handle,
|  | const uint_least8_t | numCurrentSensors
| ) |  |
| inline static

Sets the number of current sensors.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | numCurrentSensors | The number of current sensors

Definition at line 715 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::numCurrentSensors.

static void HAL_setNumVoltageSensors | ( | HAL_Handle | handle,
|  | const uint_least8_t | numVoltageSensors
| ) |  |
| inline static

Sets the number of voltage sensors.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | numVoltageSensors | The number of voltage sensors

Definition at line 729 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::numVoltageSensors.

static void HAL_setPwmFreq_kHz | ( | HAL_Handle | handle,
|  | PWM_Number_e | pwmNumber,
|  | HAL_PwmFreq_e | pwmFreq_kHz
| ) |  |
| inline static

Sets the PWM frequency.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pwmNumber | The PWM number
  [in] | pwmFreq_kHz | The PWM frequency, kHz

Definition at line 744 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::pwmHandle.

static void HAL_setVoltageScaleFactor | ( | HAL_Handle | handle,
|  | const float_t | voltage_sf
| ) |  |
| inline static

Sets the voltage scale factor in the hal.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | voltage_sf | The voltage scale factor

Definition at line 759 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::voltage_sf.

static void HAL_toggleGpio | ( | HAL_Handle | handle,
|  | const GPIO_Number_e | gpioNumber
| ) |  |
| inline static

Toggles the GPIO pin.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | gpioNumber | The GPIO number

Definition at line 864 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References _HAL_Obj_::gpioHandle.

static void HAL_updateAdcBias | ( | HAL_Handle | handle,
|  | OFFSET_Handle * | pOffsetHandle_I,
|  | OFFSET_Handle * | pOffsetHandle_V
| ) |  |
| inline static

Updates the ADC bias values.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pOffsetHandle_I | The pointer to the the current offset handles
  [in] | pOffsetHandle_V | The pointer to the the voltage offset handles

Definition at line 880 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References HAL_getBias(), HAL_getNumCurrentSensors(), HAL_getNumVoltageSensors(), HAL_SensorType_Current, HAL_SensorType_Voltage, HAL_setBias(), and OFFSET_getOffset().

static void HAL_writeDacData | ( | HAL_Handle | handle,
|  | const HAL_DacData_t * | pDacData
| ) |  |
| inline static

Writes DAC data to the PWM comparators for DAC (digital-to-analog conversion) output.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pDacData | The pointer to the DAC data

Definition at line 915 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References MATH_sat(), _HAL_Obj_::pwmDacHandle, and _HAL_DacData_t_::value.

static void HAL_writePwmData | ( | HAL_Handle | handle,
|  | const HAL_PwmData_t * | pPwmData
| ) |  |
| inline static

Writes PWM data to the PWM comparators for motor control.

Parameters

  [in] | handle | The hardware abstraction layer (HAL) handle
  [in] | pPwmData | The pointer to the PWM data

Definition at line 960 of file drv8312kit_revD/f28x/f2806x/src/float/hal.h.

References MATH_sat(), _HAL_Obj_::pwmHandle, _HAL_PwmData_t_::Vabc_pu, and _MATH_vec3_::value.