Interaction With Multiple Pins - Texas Instruments UCD3138 Technical Reference Manual

Digital power supply controller
Hide thumbs Also See for UCD3138:
Table of Contents

Advertisement

www.ti.com

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))
SNIU028A – February 2016 – Revised April 2016
Submit Documentation Feedback
Copyright © 2016, Texas Instruments Incorporated
Interaction with Multiple Pins
Advanced Power Management Control Functions
345

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents