MSPM0C1106BrushedMotorControlLibrary  1.0
Macros | Enumerations | Functions
hal.h File Reference

Detailed Description

Brushed Motor Driver Library HAL Module.


#include "ti_msp_dl_config.h"
#include <ti/iqmath/include/IQmathLib.h>
Include dependency graph for hal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HIGH   (PIN_MODE_OUTPUT_HIGH)
 Set GPIO output to high.
 
#define LOW   (PIN_MODE_OUTPUT_LOW)
 Set GPIO output to low.
 

Enumerations

enum  PIN_MODE {
  PIN_MODE_OUTPUT_LOW = 0,
  PIN_MODE_OUTPUT_HIGH,
  PIN_MODE_INPUT_PU,
  PIN_MODE_INPUT_PD,
  PIN_MODE_INPUT_HZ,
  PIN_MODE_PERIPHERAL,
  PIN_MODE_MAX
}
 
enum  PWM_CHANNELS {
  PWM_CHANNEL_0 = 0,
  PWM_CHANNEL_1,
  PWM_CHANNELS_MAX
}
 Channels described here simply references individual PWM output pins. This means a micro-controller can have a single peripheral such as a timer that can be used to generate 1 or more different PWM signals. Each of those PWM signals are considered seperate PWM channels. More...
 
enum  SPI_CHANNELS {
  SPI_CHANNEL_0 = 0,
  SPI_CHANNELS_MAX
}
 Channels described usually references individual SPI peripheral instances ie ( SCLK, PICO and POCI). More...
 
enum  SPI_CS {
  SPI_CS_0 = 0,
  SPI_CS_1,
  SPI_CS_2,
  SPI_CS_3,
  SPI_CS_MAX
}
 The chip select number here has no relationship with the physical chip select that the SPI peripheral instance has. For example, SPI_CS_0 can be mapped to the peripheral's CS2 or even a GPIO pin that is being used as a chip select. More...
 
enum  GPIO_OUTPUT_PINS {
  GPIO_OUTPUT_PIN_0 = 0,
  GPIO_OUTPUT_PIN_1,
  GPIO_OUTPUT_PIN_2,
  GPIO_OUTPUT_PIN_3,
  GPIO_OUTPUT_PIN_4,
  GPIO_OUTPUT_PINS_MAX
}
 
enum  GPIO_INPUT_PINS {
  GPIO_INPUT_PIN_0 = 0,
  GPIO_INPUT_PINS_MAX
}
 
enum  ADC_CHANS {
  ADC_CHAN_0 = 0,
  ADC_CHAN_1,
  ADC_CHANS_MAX
}
 

Functions

void HAL_setDutyCycle (PWM_CHANNELS pwmChan, uint8_t targetDutyCycle)
 Sets the PWM duty cycle for a specific channel. More...
 
void HAL_setPWMFreq (PWM_CHANNELS pwmChan, uint32_t targetFreq)
 Sets the PWM frequency for a specific channel. More...
 
void HAL_configurePWMPin (PWM_CHANNELS pwmChan, PIN_MODE mode)
 Sets the PWM pin to specified pin mode. More...
 
void HAL_writeSPI8withTimeout (SPI_CHANNELS spi_chan, SPI_CS cs_chan, uint8_t data, uint32_t timeout)
 Performs a 8-bit SPI write with timeout. More...
 
uint8_t HAL_readSPI8withTimeout (SPI_CHANNELS spi_chan, SPI_CS cs_chan, uint32_t timeout)
 Performs a 8-bit SPI read with timeout. More...
 
void HAL_writeSPI16withTimeout (SPI_CHANNELS spi_chan, SPI_CS cs_chan, uint16_t data, int32_t timeout)
 Performs a 16-bit SPI write with timeout. More...
 
uint16_t HAL_readSPI16withTimeout (SPI_CHANNELS spi_chan, SPI_CS cs_chan, int32_t timeout)
 Performs a 16-bit SPI write with timeout. More...
 
void HAL_delayMicroSeconds (uint32_t num_us)
 Delay function in microseconds. More...
 
void HAL_delayMilliSeconds (uint32_t num_us)
 Delay function in milliseconds. More...
 
bool HAL_readGPIOInput (GPIO_INPUT_PINS pin)
 Read GPIO input pin value. More...
 
void HAL_setGPIOOutput (GPIO_OUTPUT_PINS pin, PIN_MODE mode)
 Set output pin's value. More...
 
void HAL_Init ()
 Function called to run initialization code needed by the HAL.
 
void HAL_setADCRefVoltage (ADC_CHANS adcChan, uint16_t voltage_mV)
 Set the reference voltage that specified ADC channel is using. The software doesn't know what reference voltage is associated with the ADC channel so this needs to be manually configured. More...
 
uint16_t HAL_getRawADCValue (ADC_CHANS adcChan)
 Return the latest raw ADC value from the specified ADC channel. More...
 
uint32_t HAL_getmVfromADC (ADC_CHANS adcChan)
 Returns the voltage in mV read from the specified ADC channel. Important This function depends on the correct ADC reference voltage being set HAL_setADCRefVoltage. More...
 
_iq20 HAL_getIQ20VoltageFromADC (ADC_CHANS adcChan)
 Returns the voltage in mV in IQ20 format read from the specified ADC channel Important This function depends on the correct ADC reference voltage being set HAL_setADCRefVoltage. More...
 
DL_ADC12_IIDX HAL_processADCIRQ (ADC12_Regs *adcInst)
 Function to process ADC interrupts and read converted ADC values. Should only be used in ADC irqs. More...
 
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale