XBee and XBee-PRO ZigBee RF modules provide cost-effective wireless connectivity to electronic devices. They are interoperable with other ZigBee PRO feature set devices, including devices from other vendors.
Device/Pin.cpp
- Committer:
- yangcq88517
- Date:
- 2015-11-14
- Revision:
- 6:5f31ddc17239
- Parent:
- 4:a0f1fba6c2fb
File content as of revision 6:5f31ddc17239:
#include "Pin.h" unsigned char Pin::bitfield[2] = {0,0}; Pin::Pin(unsigned char number) { num = number; } Pin::Pin(unsigned char number, unsigned char msbCom, unsigned char lsbCom, unsigned char msbIODet, unsigned char lsbIODet) { num = number; com[0] = msbCom; com[1] = lsbCom; IODet[0] = msbIODet; IODet[1] = lsbIODet; } unsigned char Pin::getNumber() { return num; } char * Pin::getCommand() { return com; } unsigned char * Pin::IOChangeDetectionConfiguration(Pin ** pins, unsigned char size) { Pin::bitfield[0] = 0; Pin::bitfield[1] = 0; for (int i = 0; i < size; i++) { Pin::bitfield[0] |= pins[i]->IODet[0]; Pin::bitfield[1] |= pins[i]->IODet[1]; } return Pin::bitfield; } unsigned char * Pin::getIODetection() { return IODet; } bool operator ==(const Pin &a,const Pin &b) { return a.num == b.num; }