MSPM0G3507HallSensoredTrapMotorControlLibrary  1.0
hal.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 /*!****************************************************************************
34  * @file hal.h
35  * @brief Hall Sensored Trap Motor Control Library HAL Module
36  * @defgroup HALL_SENSORED_TRAP__MSPM0G_HAL LP_MSPM0G3507 - \
37  * Hardware Abstraction Layer (HAL)
38  *
39  *
40  * @anchor hall_sensored_trap_lp_mpsm0g3507_hal_Overview
41  * # Overview
42  *
43  * The HAL module provides micro-controller agnostic set of application
44  * programming interfaces (APIs) to be used by other module's in the library
45  * as well as in the user's application code.
46  *
47  * <hr>
48  ******************************************************************************/
53 #ifndef _HAL_H
54 #define _HAL_H
55 
56 #include "ti_msp_dl_config.h"
57 #include <ti/iqmath/include/IQmathLib.h>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
64 #define HAL_SYSTEM_FREQ_MHZ ((int32_t)80)
65 
67 #define HAL_PWM_TIMER_FREQ_MHZ ((int32_t)80)
68 
70 #define HAL_CAPTURE_TIMER_FREQ ((int32_t)100000)
71 
73 #define HAL_VDDA_REFVOLTAGE (3300)
74 
76 #define MAX_ADC_VALUE (4095)
77 
79 typedef enum
80 {
86 
88 typedef enum
89 {
106 }HAL_ADC_CHAN;
107 
109 typedef enum
110 {
121 }HAL_GPIO_IN;
122 
124 typedef enum
125 {
134 }HAL_GPIO_OUT;
135 
137 typedef enum
138 {
147 }HAL_PWM;
148 
150 typedef enum
151 {
157 
159 typedef enum
160 {
166 
168 typedef enum {
173 } HAL_SPI_CHAN;
174 
176 typedef enum {
187 } HAL_SPI_CS;
188 
190 typedef enum
191 {
198 }HAL_ADC_VREF;
199 
201 typedef enum
202 {
204  HAL_ADC_INT_VREF_2P5V = DL_VREF_BUFCONFIG_OUTPUT_2_5V,
206  HAL_ADC_INT_VREF_1P4V = DL_VREF_BUFCONFIG_OUTPUT_1_4V
208 
210 typedef enum
211 {
213  HAL_ADC_IIDX_OVERFLOW = DL_ADC12_IIDX_OVERFLOW,
214 
216  HAL_ADC_IIDX_TRIG_OVERFLOW = DL_ADC12_IIDX_TRIG_OVERFLOW,
217 
220  HAL_ADC_IIDX_WINDOW_COMP_HIGH = DL_ADC12_IIDX_WINDOW_COMP_HIGH,
221 
224  HAL_ADC_IIDX_WINDOW_COMP_LOW = DL_ADC12_IIDX_WINDOW_COMP_LOW,
225 
227  HAL_ADC_IIDX_INIFG = DL_ADC12_IIDX_INIFG,
228 
230  HAL_ADC_IIDX_DMA_DONE = DL_ADC12_IIDX_DMA_DONE,
231 
233  HAL_ADC_IIDX_UNDERFLOW = DL_ADC12_IIDX_UNDERFLOW,
234 
236  HAL_ADC_IIDX_MEM0_RESULT_LOADED = DL_ADC12_IIDX_MEM0_RESULT_LOADED,
237 
239  HAL_ADC_IIDX_MEM1_RESULT_LOADED = DL_ADC12_IIDX_MEM1_RESULT_LOADED,
240 
242  HAL_ADC_IIDX_MEM2_RESULT_LOADED = DL_ADC12_IIDX_MEM2_RESULT_LOADED,
243 
245  HAL_ADC_IIDX_MEM3_RESULT_LOADED = DL_ADC12_IIDX_MEM3_RESULT_LOADED,
246 
248  HAL_ADC_IIDX_MEM4_RESULT_LOADED = DL_ADC12_IIDX_MEM4_RESULT_LOADED,
249 
251  HAL_ADC_IIDX_MEM5_RESULT_LOADED = DL_ADC12_IIDX_MEM5_RESULT_LOADED,
252 
254  HAL_ADC_IIDX_MEM6_RESULT_LOADED = DL_ADC12_IIDX_MEM6_RESULT_LOADED,
255 
257  HAL_ADC_IIDX_MEM7_RESULT_LOADED = DL_ADC12_IIDX_MEM7_RESULT_LOADED,
258 
260  HAL_ADC_IIDX_MEM8_RESULT_LOADED = DL_ADC12_IIDX_MEM8_RESULT_LOADED,
261 
263  HAL_ADC_IIDX_MEM9_RESULT_LOADED = DL_ADC12_IIDX_MEM9_RESULT_LOADED,
264 
266  HAL_ADC_IIDX_MEM10_RESULT_LOADED = DL_ADC12_IIDX_MEM10_RESULT_LOADED,
267 
269  HAL_ADC_IIDX_MEM11_RESULT_LOADED = DL_ADC12_IIDX_MEM11_RESULT_LOADED,
270 }HAL_ADC_IIDX;
271 
273 typedef struct HAL_GPIO_Instance_
274 {
276  IOMUX_PINCM iomux;
278  GPIO_Regs * port;
280  uint32_t pin;
282  IRQn_Type IRQn;
284 
286 typedef struct HAL_ADC_instance_
287 {
289  ADC12_Regs * inst;
291  HAL_ADC_IIDX endOfSeq;
293  IRQn_Type IRQn;
295  uint16_t value;
297  uint16_t refVoltagemV;
299  DL_ADC12_MEM_IDX memIdx;
301 
303 typedef struct HAL_Timer_Instance_
304 {
306  GPTIMER_Regs *gptimer;
308  DL_TIMER_CC_INDEX ccIndex;
310  IRQn_Type IRQn;
312 
314 typedef struct HAL_fault_instance
315 {
317  GPTIMER_Regs *gptimer;
319  GPIO_Regs * port;
321  uint32_t pin;
323 
325 
327 
329 
331 
335 void HAL_init();
336 
342 bool HAL_readGPIOPin(HAL_GPIO_IN pin);
343 
349 void HAL_writeGPIOPin(HAL_GPIO_OUT pin, HAL_GPIO_STATE value);
350 
356 void HAL_setDeadband(HAL_PWM pwm, uint16_t deadband);
357 
363 void HAL_setPWMFreq(HAL_PWM pwm, uint32_t PWMFreq);
364 
371 void HAL_writeSPI16(HAL_SPI_CHAN chan, HAL_SPI_CS cs, uint16_t data);
372 
379 uint16_t HAL_readSPI16(HAL_SPI_CHAN chan, HAL_SPI_CS cs);
380 
386 void HAL_setADCRefVoltage(HAL_ADC_CHAN chan, uint16_t voltage_mV);
387 
393 uint32_t HAL_getmvFromADC(HAL_ADC_CHAN chan);
394 
400 _iq20 HAL_getIQ20VoltageFromADC(HAL_ADC_CHAN chan);
401 
407 HAL_ADC_IIDX HAL_processADCIRQ(ADC12_Regs *adcInst);
408 
413 void HAL_enableADCInterrupt(HAL_ADC_CHAN chan);
414 
419 void HAL_enableGPIOInterrupt(HAL_GPIO_IN pin);
420 
425 void HAL_enablePWMInterrupt(HAL_PWM PWM);
426 
431 void HAL_enableCaptureInterrupt(HAL_CAPTURE_TIMER capture);
432 
437 void HAL_setADCVRefVDDA(HAL_ADC_CHAN chan);
438 
444 void HAL_setADCVRefInternal(HAL_ADC_CHAN chan, HAL_ADC_INT_VREF internalVRef);
445 
451 void HAL_setADCVRefExternal(HAL_ADC_CHAN chan, uint16_t externalVRef);
452 
457 void HAL_clearTimerFault(HAL_FAULT_INPUT fault);
458 
464 bool HAL_getTimerFaultStatus(HAL_FAULT_INPUT fault);
465 
471 uint32_t HAL_getCaptureFrequency(HAL_CAPTURE_TIMER capture);
472 
480 void HAL_ADCVRefSel(HAL_ADC_VREF adcRef, HAL_ADC_CHAN chan,
481  HAL_ADC_INT_VREF internalVRef, uint16_t externalVRef);
482 
487 __STATIC_INLINE void HAL_delayMicroSeconds(uint32_t microSeconds)
488 {
489  delay_cycles(HAL_SYSTEM_FREQ_MHZ * microSeconds);
490  return;
491 }
492 
500 __STATIC_INLINE void HAL_updatePWM(const HAL_PWM posPhase,
501  const HAL_PWM gndPhase,
502  const HAL_PWM opnPhase,
503  const uint16_t PWMDuty)
504 {
505  HAL_Timer_Instance *positivePhase = &PWMBase[posPhase];
506  HAL_Timer_Instance *groundPhase = &PWMBase[gndPhase];
507  HAL_Timer_Instance *openPhase = &PWMBase[opnPhase];
508 
509  /* get the timer load value */
510  uint16_t PWMPeriod = DL_TimerA_getLoadValue(positivePhase->gptimer);
511  /* Calculate the capture compare value */
512  uint16_t posPhase_cmpValue = PWMPeriod - (PWMPeriod * PWMDuty)/100;
513 
514  /* Set the capture compare value to positive phase */
515  DL_TimerA_setCaptureCompareValue(positivePhase->gptimer,
516  posPhase_cmpValue,
517  positivePhase->ccIndex);
518 
519  DL_Timer_overrideCCPOut(positivePhase->gptimer, DL_TIMER_FORCE_OUT_DISABLED,
520  DL_TIMER_FORCE_CMPL_OUT_DISABLED, positivePhase->ccIndex);
521 
522  DL_Timer_overrideCCPOut(groundPhase->gptimer, DL_TIMER_FORCE_OUT_LOW,
523  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase->ccIndex);
524 
525  DL_Timer_overrideCCPOut(openPhase->gptimer, DL_TIMER_FORCE_OUT_LOW,
526  DL_TIMER_FORCE_CMPL_OUT_LOW, openPhase->ccIndex);
527 }
528 
529 
536 __STATIC_INLINE void HAL_PWMOutputLow(const HAL_PWM gndPhase_1,
537  const HAL_PWM gndPhase_2,
538  const HAL_PWM gndPhase_3)
539 {
540  HAL_Timer_Instance *groundPhase01 = &PWMBase[gndPhase_1];
541  HAL_Timer_Instance *groundPhase02 = &PWMBase[gndPhase_2];
542  HAL_Timer_Instance *groundPhase03 = &PWMBase[gndPhase_3];
543 
544  DL_Timer_overrideCCPOut(groundPhase01->gptimer, DL_TIMER_FORCE_OUT_LOW,
545  DL_TIMER_FORCE_CMPL_OUT_LOW, groundPhase01->ccIndex);
546 
547  DL_Timer_overrideCCPOut(groundPhase02->gptimer, DL_TIMER_FORCE_OUT_LOW,
548  DL_TIMER_FORCE_CMPL_OUT_LOW, groundPhase02->ccIndex);
549 
550  DL_Timer_overrideCCPOut(groundPhase03->gptimer, DL_TIMER_FORCE_OUT_LOW,
551  DL_TIMER_FORCE_CMPL_OUT_LOW, groundPhase03->ccIndex);
552 }
553 
560 __STATIC_INLINE void HAL_PWMOutputHigh(const HAL_PWM gndPhase_1,
561  const HAL_PWM gndPhase_2,
562  const HAL_PWM gndPhase_3)
563 {
564  HAL_Timer_Instance *groundPhase01 = &PWMBase[gndPhase_1];
565  HAL_Timer_Instance *groundPhase02 = &PWMBase[gndPhase_2];
566  HAL_Timer_Instance *groundPhase03 = &PWMBase[gndPhase_3];
567 
568  DL_Timer_overrideCCPOut(groundPhase01->gptimer, DL_TIMER_FORCE_OUT_LOW,
569  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase01->ccIndex);
570 
571  DL_Timer_overrideCCPOut(groundPhase02->gptimer, DL_TIMER_FORCE_OUT_LOW,
572  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase02->ccIndex);
573 
574  DL_Timer_overrideCCPOut(groundPhase03->gptimer, DL_TIMER_FORCE_OUT_LOW,
575  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase03->ccIndex);
576 }
577 
578 #ifdef __cplusplus
579 }
580 #endif
581 #endif /* _HAL_H */
582 
HAL_Timer_Instance inputCapture[HAL_CAPTURE_TIMER_MAX]
Array to store the capture instances.
Definition: hal.c:74
Total number of output GPIO pins.
Definition: hal.h:133
GPIO_Regs * port
GPIO port.
Definition: hal.h:278
DL_ADC12_MEM_IDX memIdx
ADC memory IDX.
Definition: hal.h:299
ADC12 interrupt index for MEMRESx result lower than window comparator low threshold.
Definition: hal.h:224
GPTIMER_Regs * gptimer
Timer Register.
Definition: hal.h:306
Index associated to PWM channel 2.
Definition: hal.h:142
ADC12 interrupt index for MEM3 result loaded interrupt.
Definition: hal.h:245
GPIO_Regs * port
GPIO port.
Definition: hal.h:319
void HAL_enableGPIOInterrupt(HAL_GPIO_IN pin)
Enables GPIO interrupts.
Definition: hal.c:375
DL_TIMER_CC_INDEX ccIndex
Timer ccIndex.
Definition: hal.h:308
uint32_t HAL_getmvFromADC(HAL_ADC_CHAN chan)
Get milli volts from ADC.
Definition: hal.c:313
void HAL_enablePWMInterrupt(HAL_PWM PWM)
Enables PWM interrupts.
Definition: hal.c:385
ADC Internal Reference 2.5V.
Definition: hal.h:204
Index associated to output GPIO PIN 1.
Definition: hal.h:127
HAL_ADC_CHAN
Definition: hal.h:88
Index associated to chip select 0.
Definition: hal.h:178
HAL_GPIO_IN
Definition: hal.h:109
ADC12 interrupt index for MEM8 result loaded interrupt.
Definition: hal.h:260
ADC12 interrupt index for MEMRESX overflow.
Definition: hal.h:213
void HAL_setADCVRefInternal(HAL_ADC_CHAN chan, HAL_ADC_INT_VREF internalVRef)
Set ADC voltage reference to internal reference.
Definition: hal.c:422
Index associated to ADC Channel 3.
Definition: hal.h:97
void HAL_setADCVRefExternal(HAL_ADC_CHAN chan, uint16_t externalVRef)
Set ADC voltage reference to external reference.
Definition: hal.c:452
void HAL_writeGPIOPin(HAL_GPIO_OUT pin, HAL_GPIO_STATE value)
Write to GPIOpin.
Definition: hal.c:221
Index associated to input GPIO PIN 4.
Definition: hal.h:118
Index associated to input GPIO PIN 3.
Definition: hal.h:116
HAL_ADC_instance ADCChannel[HAL_ADC_CHAN_MAX]
Array for storing the ADC instances.
Definition: hal.c:64
ADC12 interrupt index for MEM0 result loaded interrupt.
Definition: hal.h:236
IRQn_Type IRQn
Timer IRQN.
Definition: hal.h:310
Index associated to PWM channel 1.
Definition: hal.h:140
HAL_ADC_INT_VREF
Definition: hal.h:201
ADC12 interrupt index for sequence conversion trigger overflow.
Definition: hal.h:216
void HAL_enableADCInterrupt(HAL_ADC_CHAN chan)
Enables ADC interrupts.
Definition: hal.c:365
ADC12 interrupt index for MEM10 result loaded interrupt.
Definition: hal.h:266
Total number of input captures.
Definition: hal.h:155
Defines a fault instance.
Definition: hal.h:314
uint32_t pin
GPIO pin.
Definition: hal.h:280
ADC12 interrupt index for MEM4 result loaded interrupt.
Definition: hal.h:248
uint16_t value
ADC result.
Definition: hal.h:295
HAL_PWM
Definition: hal.h:137
IOMUX_PINCM iomux
IOMUX.
Definition: hal.h:276
void HAL_setDeadband(HAL_PWM pwm, uint16_t deadband)
Sets deadband for timer.
Definition: hal.c:242
HAL_SPI_CHAN
Definition: hal.h:168
Total number of input GPIO pins.
Definition: hal.h:120
__STATIC_INLINE void HAL_delayMicroSeconds(uint32_t microSeconds)
Delays for specific time in microseconds.
Definition: hal.h:487
bool HAL_getTimerFaultStatus(HAL_FAULT_INPUT fault)
Read the PWM timer fault bit.
Definition: hal.c:481
ADC12 interrupt index for result in range.
Definition: hal.h:227
void HAL_writeSPI16(HAL_SPI_CHAN chan, HAL_SPI_CS cs, uint16_t data)
Write data to spi.
Definition: hal.c:268
ADC External Reference.
Definition: hal.h:197
Total number of PWM channels.
Definition: hal.h:146
Index associated to output GPIO PIN 3.
Definition: hal.h:131
uint16_t refVoltagemV
ADC reference voltage.
Definition: hal.h:297
void HAL_enableCaptureInterrupt(HAL_CAPTURE_TIMER capture)
Enables capture interrupts.
Definition: hal.c:395
ADC12 interrupt index for DMA done.
Definition: hal.h:230
Defines a timer instance.
Definition: hal.h:303
void HAL_clearTimerFault(HAL_FAULT_INPUT fault)
Clear the PWM timer fault bit.
Definition: hal.c:470
GPIO set to low.
Definition: hal.h:82
__STATIC_INLINE void HAL_PWMOutputLow(const HAL_PWM gndPhase_1, const HAL_PWM gndPhase_2, const HAL_PWM gndPhase_3)
Set all PWM outputs low.
Definition: hal.h:536
struct HAL_fault_instance HAL_fault_instance
Defines a fault instance.
Total number of faults.
Definition: hal.h:164
Index associated to SPI channel 0.
Definition: hal.h:170
void HAL_setADCVRefVDDA(HAL_ADC_CHAN chan)
Set ADC voltage reference to VDDA.
Definition: hal.c:405
HAL_ADC_IIDX
Definition: hal.h:210
void HAL_init()
Initializes the hal object.
Definition: hal.c:84
Index associated to input GPIO PIN 2.
Definition: hal.h:114
Index associated to chip select 0.
Definition: hal.h:182
Total number of chip select pins.
Definition: hal.h:186
ADC12 interrupt index for MEM7 result loaded interrupt.
Definition: hal.h:257
HAL_ADC_IIDX HAL_processADCIRQ(ADC12_Regs *adcInst)
Read ADC values from results.
Definition: hal.c:345
struct HAL_GPIO_Instance_ HAL_GPIO_Instance
Defines a GPIO instance.
Index associated to chip select 0.
Definition: hal.h:180
HAL_Timer_Instance PWMBase[HAL_PWM_MAX]
Array for storing the PWM instances.
Definition: hal.c:69
Index associated to input capture 1.
Definition: hal.h:153
Index associated to ADC Channel 0.
Definition: hal.h:91
Total number of SPI channels.
Definition: hal.h:172
ADC Reference VDDA.
Definition: hal.h:193
Index associated to ADC Channel 5.
Definition: hal.h:101
Index associated to ADC Channel 4.
Definition: hal.h:99
Defines a ADC instance.
Definition: hal.h:286
ADC12 interrupt index for MEM10 result loaded interrupt.
Definition: hal.h:269
ADC12 interrupt index for MEM2 result loaded interrupt.
Definition: hal.h:242
void HAL_setADCRefVoltage(HAL_ADC_CHAN chan, uint16_t voltage_mV)
Set ADC reference voltage.
Definition: hal.c:303
ADC12 interrupt index for MEM1 result loaded interrupt.
Definition: hal.h:239
HAL_ADC_IIDX endOfSeq
ADC end of sequence.
Definition: hal.h:291
HAL_fault_instance faultInput[HAL_FAULT_INPUT_MAX]
Array to store the fault instances.
Definition: hal.c:79
#define HAL_SYSTEM_FREQ_MHZ
Defines the system clock frequency, MHz.
Definition: hal.h:64
HAL_ADC_VREF
Definition: hal.h:190
Index associated to output GPIO PIN 2.
Definition: hal.h:129
Index associated to chip select 0.
Definition: hal.h:184
uint16_t HAL_readSPI16(HAL_SPI_CHAN chan, HAL_SPI_CS cs)
Read data from spi.
Definition: hal.c:287
struct HAL_ADC_instance_ HAL_ADC_instance
Defines a ADC instance.
HAL_CAPTURE_TIMER
Definition: hal.h:150
Index associated to fault 1.
Definition: hal.h:162
ADC12 interrupt index for MEMRESx result higher than window comparator high threshold.
Definition: hal.h:220
Index associated to ADC Channel 1.
Definition: hal.h:93
GPTIMER_Regs * gptimer
Timer Register.
Definition: hal.h:317
HAL_GPIO_OUT
Definition: hal.h:124
uint32_t HAL_getCaptureFrequency(HAL_CAPTURE_TIMER capture)
Calculates the capture frequency.
Definition: hal.c:493
bool HAL_readGPIOPin(HAL_GPIO_IN pin)
Reads a GPIOpin.
Definition: hal.c:211
Index associated to input GPIO PIN 1.
Definition: hal.h:112
Defines a GPIO instance.
Definition: hal.h:273
uint32_t pin
GPIO pin.
Definition: hal.h:321
__STATIC_INLINE void HAL_PWMOutputHigh(const HAL_PWM gndPhase_1, const HAL_PWM gndPhase_2, const HAL_PWM gndPhase_3)
Set complementary PWM outputs high.
Definition: hal.h:560
ADC Internal Reference.
Definition: hal.h:195
ADC12 interrupt index for MEM6 result loaded interrupt.
Definition: hal.h:254
__STATIC_INLINE void HAL_updatePWM(const HAL_PWM posPhase, const HAL_PWM gndPhase, const HAL_PWM opnPhase, const uint16_t PWMDuty)
Writes the pwm to the pinouts.
Definition: hal.h:500
struct HAL_Timer_Instance_ HAL_Timer_Instance
Defines a timer instance.
Index associated to PWM channel 3.
Definition: hal.h:144
GPIO set to high.
Definition: hal.h:84
ADC12 interrupt index for MEM9 result loaded interrupt.
Definition: hal.h:263
HAL_FAULT_INPUT
Definition: hal.h:159
ADC12 interrupt index for MEM5 result loaded interrupt.
Definition: hal.h:251
HAL_GPIO_STATE
Definition: hal.h:79
HAL_SPI_CS
Definition: hal.h:176
ADC12_Regs * inst
ADC register.
Definition: hal.h:289
IRQn_Type IRQn
GPIO IRQN.
Definition: hal.h:282
IRQn_Type IRQn
ADC IRQN.
Definition: hal.h:293
void HAL_ADCVRefSel(HAL_ADC_VREF adcRef, HAL_ADC_CHAN chan, HAL_ADC_INT_VREF internalVRef, uint16_t externalVRef)
updates the adc voltage reference
Definition: hal.c:527
_iq20 HAL_getIQ20VoltageFromADC(HAL_ADC_CHAN chan)
Get volts from ADC in _IQ20.
Definition: hal.c:325
ADC Internal Reference 1.4V.
Definition: hal.h:206
ADC12 interrupt index for MEMRESX underflow.
Definition: hal.h:233
Index associated to ADC Channel 6.
Definition: hal.h:103
Total number of ADC channels.
Definition: hal.h:105
Index associated to ADC Channel 2.
Definition: hal.h:95
void HAL_setPWMFreq(HAL_PWM pwm, uint32_t PWMFreq)
Sets PWMfreq for all timers.
Definition: hal.c:255
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale