1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.
Dependents: MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more
Superseded by MaximInterface.
Diff: OneWire_Masters/DS2465/DS2465.hpp
- Revision:
- 69:f915c4c59a69
- Parent:
- 49:36954b62f503
- Child:
- 71:562f5c702094
--- a/OneWire_Masters/DS2465/DS2465.hpp Fri Apr 22 10:36:53 2016 -0500 +++ b/OneWire_Masters/DS2465/DS2465.hpp Mon May 09 08:29:49 2016 -0500 @@ -46,10 +46,33 @@ }; /// Represents a DS2465 configuration. - struct Config - { - bool c1WS, cSPU, cPDN, cAPU; + class Config + { + public: + /// @{ + /// 1-Wire Speed + bool c1WS() const { return m_c1WS; } + void setC1WS(bool c1WS) { m_c1WS = c1WS; } + /// @} + /// @{ + /// Strong Pullup + bool cSPU() const { return m_cSPU; } + void setCSPU(bool cSPU) { m_cSPU = cSPU; } + /// @} + + /// @{ + /// 1-Wire Power Down + bool cPDN() const { return m_cPDN; } + void setCPDN(bool cPDN) { m_cPDN = cPDN; } + /// @} + + /// @{ + /// Active Pullup + bool cAPU() const { return m_cAPU; } + void setCAPU(bool cAPU) { m_cAPU = cAPU; } + /// @} + /// Byte representation that is read from the DS2465. std::uint8_t readByte() const; /// Byte respresentation that is written to the DS2465. @@ -58,6 +81,9 @@ /// Reset to the power-on default config. void reset(); Config() { reset(); } + + private: + bool m_c1WS, m_cSPU, m_cPDN, m_cAPU; }; /// @param I2C_interface Configured I2C communication interface for DS2465. @@ -77,7 +103,7 @@ /// Read the current DS2465 configuration. /// @returns The cached current configuration. - Config currentConfig() const; + Config currentConfig() const { return m_curConfig; } // DS2465 Memory Commands