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: Masters/DS248x/DS248x.h
- Revision:
- 139:f0e0a7976846
- Parent:
- 98:c4ac93efc036
--- a/Masters/DS248x/DS248x.h Fri Dec 02 19:21:55 2016 +0000 +++ b/Masters/DS248x/DS248x.h Tue Dec 13 13:31:30 2016 -0800 @@ -34,7 +34,6 @@ #define OneWire_Masters_DS248x #include "Masters/OneWireMaster.h" -#include "PinNames.h" namespace mbed { class I2C; } @@ -95,11 +94,6 @@ bool m_1WS, m_SPU, m_PDN, m_APU; }; - /// Construct to use an existing I2C interface. - /// @param i2c_bus Configured I2C communication interface for DS248x. - /// @param adrs I2C bus address of the DS248x in mbed format. - DS248x(mbed::I2C & i2c_bus, uint8_t adrs); - /// Performs a soft reset on the DS248x. /// @note This is note a 1-Wire Reset. OneWireMaster::CmdResult reset(void); @@ -151,24 +145,30 @@ OwTripletCmd = 0x78 }; - mbed::I2C & m_i2c_bus; - uint8_t m_adrs; - Config m_curConfig; + /// Construct to use an existing I2C interface. + /// @param i2c_bus Configured I2C communication interface for DS248x. + /// @param adrs I2C bus address of the DS248x in mbed format. + DS248x(mbed::I2C & i2c_bus, uint8_t adrs); + + /// @note Allow marking const since not public. + OneWireMaster::CmdResult sendCommand(Command cmd) const; + /// @note Allow marking const since not public. + OneWireMaster::CmdResult sendCommand(Command cmd, uint8_t param) const; + + private: /// Polls the DS248x status waiting for the 1-Wire Busy bit (1WB) to be cleared. - /// @param[out] pStatus Optionally retrive the status byte when 1WB cleared. + /// @param[out] pStatus Optionally retrieve the status byte when 1WB cleared. /// @returns Success or TimeoutError if poll limit reached. OneWireMaster::CmdResult pollBusy(uint8_t * pStatus = NULL); /// Ensure that the desired 1-Wire level is set in the configuration. /// @param level Desired 1-Wire level. OneWireMaster::CmdResult configureLevel(OWLevel level); - - /// @note Allow marking const since not public. - OneWireMaster::CmdResult sendCommand(Command cmd) const; - - /// @note Allow marking const since not public. - OneWireMaster::CmdResult sendCommand(Command cmd, uint8_t param) const; + + mbed::I2C & m_i2c_bus; + uint8_t m_adrs; + Config m_curConfig; }; }