MSPM0G1507HallSensoredTrapMotorControlLibrary  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__MSPM0G1507_HAL MSPM0G1507 - \
37  * Hardware Abstraction Layer (HAL)
38  *
39  *
40  * @anchor hall_sensored_trap_lp_mpsm0g1507_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 {
99 
101 typedef enum
102 {
115 }HAL_GPIO_IN;
116 
118 typedef enum
119 {
128 }HAL_GPIO_OUT;
129 
131 typedef enum
132 {
141 }HAL_PWM;
142 
144 typedef enum
145 {
151 
153 typedef enum
154 {
160 
162 typedef enum {
167 } HAL_SPI_CHAN;
168 
170 typedef enum {
181 } HAL_SPI_CS;
182 
184 typedef enum
185 {
192 }HAL_ADC_VREF;
193 
195 typedef enum
196 {
198  HAL_ADC_INT_VREF_2P5V = DL_VREF_BUFCONFIG_OUTPUT_2_5V,
200  HAL_ADC_INT_VREF_1P4V = DL_VREF_BUFCONFIG_OUTPUT_1_4V
202 
204 typedef enum
205 {
207  HAL_ADC_IIDX_OVERFLOW = DL_ADC12_IIDX_OVERFLOW,
208 
210  HAL_ADC_IIDX_TRIG_OVERFLOW = DL_ADC12_IIDX_TRIG_OVERFLOW,
211 
214  HAL_ADC_IIDX_WINDOW_COMP_HIGH = DL_ADC12_IIDX_WINDOW_COMP_HIGH,
215 
218  HAL_ADC_IIDX_WINDOW_COMP_LOW = DL_ADC12_IIDX_WINDOW_COMP_LOW,
219 
221  HAL_ADC_IIDX_INIFG = DL_ADC12_IIDX_INIFG,
222 
224  HAL_ADC_IIDX_DMA_DONE = DL_ADC12_IIDX_DMA_DONE,
225 
227  HAL_ADC_IIDX_UNDERFLOW = DL_ADC12_IIDX_UNDERFLOW,
228 
230  HAL_ADC_IIDX_MEM0_RESULT_LOADED = DL_ADC12_IIDX_MEM0_RESULT_LOADED,
231 
233  HAL_ADC_IIDX_MEM1_RESULT_LOADED = DL_ADC12_IIDX_MEM1_RESULT_LOADED,
234 
236  HAL_ADC_IIDX_MEM2_RESULT_LOADED = DL_ADC12_IIDX_MEM2_RESULT_LOADED,
237 
239  HAL_ADC_IIDX_MEM3_RESULT_LOADED = DL_ADC12_IIDX_MEM3_RESULT_LOADED,
240 
242  HAL_ADC_IIDX_MEM4_RESULT_LOADED = DL_ADC12_IIDX_MEM4_RESULT_LOADED,
243 
245  HAL_ADC_IIDX_MEM5_RESULT_LOADED = DL_ADC12_IIDX_MEM5_RESULT_LOADED,
246 
248  HAL_ADC_IIDX_MEM6_RESULT_LOADED = DL_ADC12_IIDX_MEM6_RESULT_LOADED,
249 
251  HAL_ADC_IIDX_MEM7_RESULT_LOADED = DL_ADC12_IIDX_MEM7_RESULT_LOADED,
252 
254  HAL_ADC_IIDX_MEM8_RESULT_LOADED = DL_ADC12_IIDX_MEM8_RESULT_LOADED,
255 
257  HAL_ADC_IIDX_MEM9_RESULT_LOADED = DL_ADC12_IIDX_MEM9_RESULT_LOADED,
258 
260  HAL_ADC_IIDX_MEM10_RESULT_LOADED = DL_ADC12_IIDX_MEM10_RESULT_LOADED,
261 
263  HAL_ADC_IIDX_MEM11_RESULT_LOADED = DL_ADC12_IIDX_MEM11_RESULT_LOADED,
264 }HAL_ADC_IIDX;
265 
267 typedef struct HAL_GPIO_Instance_
268 {
270  IOMUX_PINCM iomux;
272  GPIO_Regs * port;
274  uint32_t pin;
276  IRQn_Type IRQn;
278 
280 typedef struct HAL_ADC_instance_
281 {
283  ADC12_Regs * inst;
285  HAL_ADC_IIDX endOfSeq;
287  IRQn_Type IRQn;
289  uint16_t value;
291  uint16_t refVoltagemV;
293  DL_ADC12_MEM_IDX memIdx;
295 
297 typedef struct HAL_Timer_Instance_
298 {
300  GPTIMER_Regs *gptimer;
302  DL_TIMER_CC_INDEX ccIndex;
304  IRQn_Type IRQn;
306 
308 typedef struct HAL_fault_instance
309 {
311  GPTIMER_Regs *gptimer;
313  GPIO_Regs * port;
315  uint32_t pin;
317 
319 
321 
323 
325 
327 
331 void HAL_init();
332 
338 bool HAL_readGPIOPin(HAL_GPIO_IN pin);
339 
345 void HAL_writeGPIOPin(HAL_GPIO_OUT pin, HAL_GPIO_STATE value);
346 
352 void HAL_setDeadband(HAL_PWM pwm, uint16_t deadband);
353 
359 void HAL_setPWMFreq(HAL_PWM pwm, uint32_t PWMFreq);
360 
367 void HAL_writeSPI16(HAL_SPI_CHAN chan, HAL_SPI_CS cs, uint16_t data);
368 
375 uint16_t HAL_readSPI16(HAL_SPI_CHAN chan, HAL_SPI_CS cs);
376 
382 void HAL_setADCRefVoltage(HAL_ADC_CHAN chan, uint16_t voltage_mV);
383 
389 uint32_t HAL_getmvFromADC(HAL_ADC_CHAN chan);
390 
396 _iq20 HAL_getIQ20VoltageFromADC(HAL_ADC_CHAN chan);
397 
403 HAL_ADC_IIDX HAL_processADCIRQ(ADC12_Regs *adcInst);
404 
409 void HAL_enableADCInterrupt(HAL_ADC_CHAN chan);
410 
415 void HAL_enableGPIOInterrupt(HAL_GPIO_IN pin);
416 
421 void HAL_enablePWMInterrupt(HAL_PWM PWM);
422 
427 void HAL_enableCaptureInterrupt(HAL_CAPTURE_TIMER capture);
428 
433 void HAL_setADCVRefVDDA(HAL_ADC_CHAN chan);
434 
440 void HAL_setADCVRefInternal(HAL_ADC_CHAN chan, HAL_ADC_INT_VREF internalVRef);
441 
447 void HAL_setADCVRefExternal(HAL_ADC_CHAN chan, uint16_t externalVRef);
448 
453 void HAL_clearTimerFault(HAL_FAULT_INPUT fault);
454 
460 bool HAL_getTimerFaultStatus(HAL_FAULT_INPUT fault);
461 
467 uint32_t HAL_getCaptureFrequency(HAL_CAPTURE_TIMER capture);
468 
476 void HAL_ADCVRefSel(HAL_ADC_VREF adcRef, HAL_ADC_CHAN chan,
477  HAL_ADC_INT_VREF internalVRef, uint16_t externalVRef);
478 
484 uint32_t HAL_getGPIOEnabledInterruptStatus(HAL_GPIO_IN pin);
485 
490 __STATIC_INLINE void HAL_delayMicroSeconds(uint32_t microSeconds)
491 {
492  delay_cycles(HAL_SYSTEM_FREQ_MHZ * microSeconds);
493  return;
494 }
495 
503 __STATIC_INLINE void HAL_updatePWM(const HAL_PWM posPhase,
504  const HAL_PWM gndPhase,
505  const HAL_PWM opnPhase,
506  const uint16_t PWMDuty)
507 {
508  HAL_Timer_Instance *positivePhase = &PWMBase[posPhase];
509  HAL_Timer_Instance *groundPhase = &PWMBase[gndPhase];
510  HAL_Timer_Instance *openPhase = &PWMBase[opnPhase];
511 
512  /* get the timer load value */
513  uint16_t PWMPeriod = DL_TimerA_getLoadValue(positivePhase->gptimer);
514  /* Calculate the capture compare value */
515  uint16_t posPhase_cmpValue = PWMPeriod - (PWMPeriod * PWMDuty)/100;
516 
517  /* Set the capture compare value to positive phase */
518  DL_TimerA_setCaptureCompareValue(positivePhase->gptimer,
519  posPhase_cmpValue,
520  positivePhase->ccIndex);
521 
522  DL_Timer_overrideCCPOut(positivePhase->gptimer, DL_TIMER_FORCE_OUT_DISABLED,
523  DL_TIMER_FORCE_CMPL_OUT_DISABLED, positivePhase->ccIndex);
524 
525  DL_Timer_overrideCCPOut(groundPhase->gptimer, DL_TIMER_FORCE_OUT_LOW,
526  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase->ccIndex);
527 
528  DL_Timer_overrideCCPOut(openPhase->gptimer, DL_TIMER_FORCE_OUT_LOW,
529  DL_TIMER_FORCE_CMPL_OUT_LOW, openPhase->ccIndex);
530 }
531 
532 
539 __STATIC_INLINE void HAL_PWMOutputLow(const HAL_PWM gndPhase_1,
540  const HAL_PWM gndPhase_2,
541  const HAL_PWM gndPhase_3)
542 {
543  HAL_Timer_Instance *groundPhase01 = &PWMBase[gndPhase_1];
544  HAL_Timer_Instance *groundPhase02 = &PWMBase[gndPhase_2];
545  HAL_Timer_Instance *groundPhase03 = &PWMBase[gndPhase_3];
546 
547  DL_Timer_overrideCCPOut(groundPhase01->gptimer, DL_TIMER_FORCE_OUT_LOW,
548  DL_TIMER_FORCE_CMPL_OUT_LOW, groundPhase01->ccIndex);
549 
550  DL_Timer_overrideCCPOut(groundPhase02->gptimer, DL_TIMER_FORCE_OUT_LOW,
551  DL_TIMER_FORCE_CMPL_OUT_LOW, groundPhase02->ccIndex);
552 
553  DL_Timer_overrideCCPOut(groundPhase03->gptimer, DL_TIMER_FORCE_OUT_LOW,
554  DL_TIMER_FORCE_CMPL_OUT_LOW, groundPhase03->ccIndex);
555 }
556 
563 __STATIC_INLINE void HAL_PWMOutputHigh(const HAL_PWM gndPhase_1,
564  const HAL_PWM gndPhase_2,
565  const HAL_PWM gndPhase_3)
566 {
567  HAL_Timer_Instance *groundPhase01 = &PWMBase[gndPhase_1];
568  HAL_Timer_Instance *groundPhase02 = &PWMBase[gndPhase_2];
569  HAL_Timer_Instance *groundPhase03 = &PWMBase[gndPhase_3];
570 
571  DL_Timer_overrideCCPOut(groundPhase01->gptimer, DL_TIMER_FORCE_OUT_LOW,
572  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase01->ccIndex);
573 
574  DL_Timer_overrideCCPOut(groundPhase02->gptimer, DL_TIMER_FORCE_OUT_LOW,
575  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase02->ccIndex);
576 
577  DL_Timer_overrideCCPOut(groundPhase03->gptimer, DL_TIMER_FORCE_OUT_LOW,
578  DL_TIMER_FORCE_CMPL_OUT_HIGH, groundPhase03->ccIndex);
579 }
580 
581 #ifdef __cplusplus
582 }
583 #endif
584 #endif /* HAL_H */
585 
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:127
GPIO_Regs * port
GPIO port.
Definition: hal.h:272
DL_ADC12_MEM_IDX memIdx
ADC memory IDX.
Definition: hal.h:293
ADC12 interrupt index for MEMRESx result lower than window comparator low threshold.
Definition: hal.h:218
GPTIMER_Regs * gptimer
Timer Register.
Definition: hal.h:300
Index associated to PWM channel 2.
Definition: hal.h:136
ADC12 interrupt index for MEM3 result loaded interrupt.
Definition: hal.h:239
GPIO_Regs * port
GPIO port.
Definition: hal.h:313
void HAL_enableGPIOInterrupt(HAL_GPIO_IN pin)
Enables GPIO interrupts.
Definition: hal.c:375
DL_TIMER_CC_INDEX ccIndex
Timer ccIndex.
Definition: hal.h:302
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:198
Index associated to output GPIO PIN 1.
Definition: hal.h:121
HAL_ADC_CHAN
Definition: hal.h:88
Index associated to chip select 0.
Definition: hal.h:172
HAL_GPIO_IN
Definition: hal.h:101
ADC12 interrupt index for MEM8 result loaded interrupt.
Definition: hal.h:254
ADC12 interrupt index for MEMRESX overflow.
Definition: hal.h:207
void HAL_setADCVRefInternal(HAL_ADC_CHAN chan, HAL_ADC_INT_VREF internalVRef)
Set ADC voltage reference to internal reference.
Definition: hal.c:422
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
HAL_GPIO_Instance gpioInputPin[HAL_GPIO_IN_MAX]
Array for storing the input GPIO pin instances.
Definition: hal.c:49
Index associated to input GPIO PIN 4.
Definition: hal.h:110
Index associated to input GPIO PIN 3.
Definition: hal.h:108
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:230
IRQn_Type IRQn
Timer IRQN.
Definition: hal.h:304
Index associated to PWM channel 1.
Definition: hal.h:134
HAL_ADC_INT_VREF
Definition: hal.h:195
ADC12 interrupt index for sequence conversion trigger overflow.
Definition: hal.h:210
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:260
Total number of input captures.
Definition: hal.h:149
Defines a fault instance.
Definition: hal.h:308
uint32_t pin
GPIO pin.
Definition: hal.h:274
ADC12 interrupt index for MEM4 result loaded interrupt.
Definition: hal.h:242
uint16_t value
ADC result.
Definition: hal.h:289
uint32_t HAL_getGPIOEnabledInterruptStatus(HAL_GPIO_IN pin)
gets GPIO enabled interrupt status
Definition: hal.c:552
HAL_PWM
Definition: hal.h:131
IOMUX_PINCM iomux
IOMUX.
Definition: hal.h:270
void HAL_setDeadband(HAL_PWM pwm, uint16_t deadband)
Sets deadband for timer.
Definition: hal.c:242
HAL_SPI_CHAN
Definition: hal.h:162
Total number of input GPIO pins.
Definition: hal.h:114
__STATIC_INLINE void HAL_delayMicroSeconds(uint32_t microSeconds)
Delays for specific time in microseconds.
Definition: hal.h:490
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:221
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:191
Total number of PWM channels.
Definition: hal.h:140
Index associated to output GPIO PIN 3.
Definition: hal.h:125
uint16_t refVoltagemV
ADC reference voltage.
Definition: hal.h:291
void HAL_enableCaptureInterrupt(HAL_CAPTURE_TIMER capture)
Enables capture interrupts.
Definition: hal.c:395
ADC12 interrupt index for DMA done.
Definition: hal.h:224
Defines a timer instance.
Definition: hal.h:297
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:539
struct HAL_fault_instance HAL_fault_instance
Defines a fault instance.
Total number of faults.
Definition: hal.h:158
Index associated to SPI channel 0.
Definition: hal.h:164
void HAL_setADCVRefVDDA(HAL_ADC_CHAN chan)
Set ADC voltage reference to VDDA.
Definition: hal.c:405
HAL_ADC_IIDX
Definition: hal.h:204
void HAL_init()
Initializes the hal object.
Definition: hal.c:84
Index associated to input GPIO PIN 2.
Definition: hal.h:106
Index associated to chip select 0.
Definition: hal.h:176
Total number of chip select pins.
Definition: hal.h:180
ADC12 interrupt index for MEM7 result loaded interrupt.
Definition: hal.h:251
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:174
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:147
Index associated to ADC Channel 0.
Definition: hal.h:91
Total number of SPI channels.
Definition: hal.h:166
ADC Reference VDDA.
Definition: hal.h:187
Defines a ADC instance.
Definition: hal.h:280
ADC12 interrupt index for MEM10 result loaded interrupt.
Definition: hal.h:263
ADC12 interrupt index for MEM2 result loaded interrupt.
Definition: hal.h:236
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:233
HAL_ADC_IIDX endOfSeq
ADC end of sequence.
Definition: hal.h:285
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:184
Index associated to output GPIO PIN 2.
Definition: hal.h:123
Index associated to chip select 0.
Definition: hal.h:178
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:144
Index associated to fault 1.
Definition: hal.h:156
ADC12 interrupt index for MEMRESx result higher than window comparator high threshold.
Definition: hal.h:214
Index associated to ADC Channel 1.
Definition: hal.h:93
GPTIMER_Regs * gptimer
Timer Register.
Definition: hal.h:311
HAL_GPIO_OUT
Definition: hal.h:118
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:104
Defines a GPIO instance.
Definition: hal.h:267
uint32_t pin
GPIO pin.
Definition: hal.h:315
__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:563
ADC Internal Reference.
Definition: hal.h:189
ADC12 interrupt index for MEM6 result loaded interrupt.
Definition: hal.h:248
__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:503
struct HAL_Timer_Instance_ HAL_Timer_Instance
Defines a timer instance.
Index associated to PWM channel 3.
Definition: hal.h:138
GPIO set to high.
Definition: hal.h:84
ADC12 interrupt index for MEM9 result loaded interrupt.
Definition: hal.h:257
HAL_FAULT_INPUT
Definition: hal.h:153
ADC12 interrupt index for MEM5 result loaded interrupt.
Definition: hal.h:245
HAL_GPIO_STATE
Definition: hal.h:79
HAL_SPI_CS
Definition: hal.h:170
ADC12_Regs * inst
ADC register.
Definition: hal.h:283
IRQn_Type IRQn
GPIO IRQN.
Definition: hal.h:276
IRQn_Type IRQn
ADC IRQN.
Definition: hal.h:287
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:200
ADC12 interrupt index for MEMRESX underflow.
Definition: hal.h:227
Total number of ADC channels.
Definition: hal.h:97
Index associated to ADC Channel 2.
Definition: hal.h:95
Index associated to input GPIO PIN 5.
Definition: hal.h:112
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