Interaction with Multiple Pins
345
SNIU028A – February 2016 – Revised April 2016
Copyright © 2016, Texas Instruments Incorporated
Advanced Power Management Control Functions
9.11 Interaction with Multiple Pins
Even though single bits in Global I/O registers can be accessed sequentially in order to interact with
multiple I/O pins, the following suggested alternative way can save some code and execution time.
The file Global_IO.h contains several constants (masks) to accommodate interaction with Global I/O bits.
Examples:
// Configure the ADC_EXT_TRIG, TMR_PWM1, FAULT2, FAULT3 and SYNC pins as GPIO pins
MiscAnalogRegs.GLBIOEN.all |= ADC_EXT_TRIG_GLBIO_BIT_MASK | TMR_PWM1
| FAULT2_GLBIO_BIT_MASK | FAULT3_GLBIO_BIT_MASK | SYNC_GLBIO_BIT_MASK;
// Set Both FAULT2 and FAULT3 pins high
MiscAnalogRegs.GLBIOOE.all |= FAULT2_GLBIO_BIT_MASK
| FAULT3_GLBIO_BIT_MASK;
// Clear Both FAULT2 and FAULT3 pins (set to low)
MiscAnalogRegs.GLBIOOE.all &= (FAULT2_GLBIO_BIT_MASK
| FAULT3_GLBIO_BIT_MASK);
// Connect pull-up FETs to both ADC_EXT_TRIG and SYNC pins
MiscAnalogRegs.GLBIOOD.all |= ADC_EXT_TRIG_GLBIO_BIT_MASK
| SYNC_GLBIO_BIT_MASK;
// check whether the ADC_EXT_TRIG pin or the SYNC pin are pulled high
if( MiscAnalogRegs.GLBIOREAD.all &
(ADC_EXT_TRIG_GLBIO_BIT_MASK | SYNC_GLBIO_BIT_MASK))