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.
Diff: Device/Pin.cpp
- Revision:
- 0:837e6c48e90d
- Child:
- 4:a0f1fba6c2fb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Device/Pin.cpp Thu Oct 22 12:28:26 2015 +0000 @@ -0,0 +1,48 @@ +#include "Pin.h" + +char Pin::bitfield[2] = {0,0}; + +Pin::Pin(char number) +{ + num = number; +} + +Pin::Pin(char number, char msbCom, char lsbCom, char msbIODet, char lsbIODet) +{ + num = number; + com[0] = msbCom; + com[1] = lsbCom; + IODet[0] = msbIODet; + IODet[1] = lsbIODet; +} + +char Pin::getNumber() +{ + return num; +} + +char* Pin::getCommand() +{ + return com; +} + +char* Pin::IOChangeDetectionConfiguration(const Pin *Pins, char Length) +{ + Pin::bitfield[0] = 0; + Pin::bitfield[1] = 0; + for (const Pin *i = Pins; i< Pins + Length; i++) { + Pin::bitfield[0] |= i->IODet[0]; + Pin::bitfield[1] |= i->IODet[1]; + } + return Pin::bitfield; +} + +char* Pin::getIODetection() +{ + return IODet; +} + +bool operator <(const Pin &a,const Pin &b) +{ + return a.num < b.num; +} \ No newline at end of file