beautypg.com

4 gpio code example, 11 .4 gpio code example -8, 4gpiocodeexample – Maxim Integrated MAX31782 User Manual

Page 102

background image

MaximIntegrated 11-8

MAX31782 User’s Guide

Revision 0; 8/11

11.4GPIOCodeExample

//set pin 6.4 as a high output
PD6 |= 0x10;

//set direction PD6.4 to 1 for an output

PO6 |= 0x10;

//set the output PO6.4 high

//set pin 6.4 as a high-impedance input
PD6 &= ~0x10;

//set direction PD6.4 to 0 for input

PO6 &= ~0x10;

//set PO6.4 low to disable weak pullup

//enable the pin 6.4 weak pullup
PD6 &= ~0x10;

//set direction PD6.4 to 0 for input

PO6 |= 0x10;

//set PO6.4 high to enable weak pullup