Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#
OneWireMaster Class Reference
1-Wire master interface. More...
#include <OneWireMaster.hpp>
Inherited by OneWireMasterDecorator, DS2465, DS2480B, and DS2482_DS2484.
Data Structures | |
| struct | TripletData |
| Result of the 1-Wire triplet command. More... | |
Public Types | |
| enum | Speed |
Speed of the 1-Wire bus. More... | |
| enum | Level |
Level of the 1-Wire bus. More... | |
| enum | ErrorValue { NoSlaveError = 1 } |
Result of all 1-Wire commands. More... | |
Public Member Functions | |
| virtual Result< void > | reset ()=0 |
| Reset all of the devices on the 1-Wire bus and check for a presence pulse. | |
| virtual Result< bool > | touchBitSetLevel (bool sendBit, Level afterLevel)=0 |
| Send and receive one bit of communication and set a new level on the 1-Wire bus. | |
| virtual MaximInterfaceCore_EXPORT Result< void > | writeByteSetLevel (uint_least8_t sendByte, Level afterLevel) |
| Send one byte of communication and set a new level on the 1-Wire bus. | |
| virtual MaximInterfaceCore_EXPORT Result< uint_least8_t > | readByteSetLevel (Level afterLevel) |
| Receive one byte of communication and set a new level on the 1-Wire bus. | |
| virtual MaximInterfaceCore_EXPORT Result< void > | writeBlock (span< const uint_least8_t > sendBuf) |
| Send a block of communication on the 1-Wire bus. | |
| virtual MaximInterfaceCore_EXPORT Result< void > | readBlock (span< uint_least8_t > recvBuf) |
| Receive a block of communication on the 1-Wire bus. | |
| virtual Result< void > | setSpeed (Speed newSpeed)=0 |
| Set the 1-Wire bus communication speed. | |
| virtual Result< void > | setLevel (Level newLevel)=0 |
| Set the 1-Wire bus level. | |
| virtual MaximInterfaceCore_EXPORT Result< TripletData > | triplet (bool sendBit) |
| 1-Wire Triplet operation. | |
| Result< void > | writeBitSetLevel (bool sendBit, Level afterLevel) |
| Send one bit of communication and set a new level on the 1-Wire bus. | |
| Result< bool > | readBitSetLevel (Level afterLevel) |
| Receive one bit of communication and set a new level on the 1-Wire bus. | |
Detailed Description
1-Wire master interface.
Definition at line 45 of file OneWireMaster.hpp.
Member Enumeration Documentation
| enum ErrorValue |
Result of all 1-Wire commands.
Reimplemented in DS2465, DS2480B, and DS2482_DS2484.
Definition at line 54 of file OneWireMaster.hpp.
| enum Level |
Level of the 1-Wire bus.
Definition at line 51 of file OneWireMaster.hpp.
| enum Speed |
Speed of the 1-Wire bus.
Definition at line 48 of file OneWireMaster.hpp.
Member Function Documentation
Receive one bit of communication and set a new level on the 1-Wire bus.
- Parameters:
-
afterLevel Level to set the 1-Wire bus to after communication.
- Returns:
- Received data from the 1-Wire bus.
Definition at line 135 of file OneWireMaster.hpp.
| Result< void > readBlock | ( | span< uint_least8_t > | recvBuf ) | [virtual] |
Receive a block of communication on the 1-Wire bus.
- Parameters:
-
[out] recvBuf Buffer to receive the data from the 1-Wire bus.
Reimplemented in DS2465.
Definition at line 72 of file OneWireMaster.cpp.
Receive one byte of communication and set a new level on the 1-Wire bus.
- Parameters:
-
afterLevel Level to set the 1-Wire bus to after communication.
- Returns:
- Data received from the 1-Wire bus.
Reimplemented in DS2465, DS2480B, and DS2482_DS2484.
Definition at line 52 of file OneWireMaster.cpp.
| virtual Result<void> reset | ( | ) | [pure virtual] |
Reset all of the devices on the 1-Wire bus and check for a presence pulse.
- Returns:
- NoSlaveError if reset was performed but no presence pulse was detected.
Implemented in DS2465, DS2480B, and DS2482_DS2484.
Set the 1-Wire bus level.
Implemented in DS2465, DS2480B, and DS2482_DS2484.
Set the 1-Wire bus communication speed.
Implemented in DS2465, DS2480B, and DS2482_DS2484.
Send and receive one bit of communication and set a new level on the 1-Wire bus.
- Parameters:
-
sendBit Bit to send on the 1-Wire bus. afterLevel Level to set the 1-Wire bus to after communication.
- Returns:
- Bit received from the 1-Wire bus.
Implemented in DS2465, DS2480B, and DS2482_DS2484.
| Result< OneWireMaster::TripletData > triplet | ( | bool | sendBit ) | [virtual] |
1-Wire Triplet operation.
Perform one bit of a 1-Wire search. This command does two read bits and one write bit. The write bit is either the default direction (all devices have same bit) or in case of a discrepancy, the data.writeBit parameter is used.
- Parameters:
-
sendBit Bit to send in case both read bits are zero.
Reimplemented in DS2465, and DS2482_DS2484.
Definition at line 79 of file OneWireMaster.cpp.
Send one bit of communication and set a new level on the 1-Wire bus.
- Parameters:
-
sendBit Bit to send on the 1-Wire bus. afterLevel Level to set the 1-Wire bus to after communication.
Definition at line 126 of file OneWireMaster.hpp.
| Result< void > writeBlock | ( | span< const uint_least8_t > | sendBuf ) | [virtual] |
Send a block of communication on the 1-Wire bus.
- Parameters:
-
[in] sendBuf Buffer to send on the 1-Wire bus.
Reimplemented in DS2465.
Definition at line 65 of file OneWireMaster.cpp.
Send one byte of communication and set a new level on the 1-Wire bus.
- Parameters:
-
sendByte Byte to send on the 1-Wire bus. afterLevel Level to set the 1-Wire bus to after communication.
Reimplemented in DS2465, DS2480B, and DS2482_DS2484.
Definition at line 43 of file OneWireMaster.cpp.
Generated on Tue Jul 12 2022 11:13:19 by
1.7.2