![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
Diff: xDotBridge/inc/BaseboardIO.h
- Revision:
- 44:ece6330e9b57
- Parent:
- 40:2ec4be320961
- Child:
- 48:bab9f747d9ed
diff -r 68952678cc91 -r ece6330e9b57 xDotBridge/inc/BaseboardIO.h --- a/xDotBridge/inc/BaseboardIO.h Tue Jan 31 21:02:56 2017 +0000 +++ b/xDotBridge/inc/BaseboardIO.h Wed Feb 01 15:20:45 2017 -0700 @@ -67,7 +67,7 @@ * * @return */ - void regCCInInt(void (*callback) (void)); + void regCCInInt(Callback<void()> func); /** * @brief Register for tamper interrupt @@ -81,7 +81,7 @@ * * @return */ - void regTamperInt(void (*callback) (void)); + void regTamperInt(Callback<void()> func); /** * @brief Register for pair button interrupt @@ -97,7 +97,7 @@ * * @return */ - void regPairBtnInt(void (*callback) (void)); + void regPairBtnInt(Callback<void()> func); /////////// // Input // @@ -301,14 +301,26 @@ CmdResult serialTx(bool enable); private: - void (*mCCInIntCallback) (void); - void (*mTamperIntCallback) (void); - void (*mPairBtnIntCallback) (void); + // Initialized during constructor + OneWire mOWMaster; + InterruptIn mCCIn; + InterruptIn mTamper; + InterruptIn mPairBtn; + DigitalOut mLed; + DigitalOut mSwitchedIOCtrl; - uint8_t portExpanderROM0[8]; - uint8_t portExpanderVal0; - uint8_t portExpanderROM1[8]; - uint8_t portExpanderVal1; + // Initialized during init() +// void (*mCCInIntCallback) (void); +// void (*mTamperIntCallback) (void); +// void (*mPairBtnIntCallback) (void); + + uint8_t mPortExpanderROM0[8]; + uint8_t mPortExpanderVal0; + uint8_t mPortExpanderROM1[8]; + uint8_t mPortExpanderVal1; + + DS2408 *mPortEx0; + DS2408 *mPortEx1; /** * @brief Reads baseboard information from non-volatile memory (NVM) @@ -343,10 +355,30 @@ * @brief Scans OneWire bus for port expanders and attempts to identify each. * * @details For this method to succeed switches must be in factory reset positions. + * Rotary 1 and 2 should be at 0 + * DIP Switches should be fully closed * * @return CmdResult */ CmdResult identifyPortExpanders(); + + /** + * @brief Forces relay to closed state + * + * @details Note coil assertion timing is done here + * + * @return CmdResult + */ + CmdResult closeRelay(); + + /** + * @brief Forces relay to open state + * + * @details Note coil assertion timing is done here + * + * @return CmdResult + */ + CmdResult openRelay(); }; #endif /* BASEBOARDIO_BASEBOARDIO_H_ */