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: mbed_DS28EC20_GPIO
DS2465 Class Reference
Interface to the DS2465 1-Wire master and SHA-256 coprocessor. More...
#include <DS2465.hpp>
Inherits MaximInterface::OneWireMaster.
Data Structures | |
| class | Config |
| Represents a DS2465 configuration. More... | |
Public Types | |
| enum | ErrorValue |
Result of all 1-Wire commands. More... | |
| enum | PortParameter |
1-Wire port adjustment parameters. More... | |
| enum | PageRegion |
Page region to use for swapping. More... | |
| typedef array_span < uint_least8_t, 4 > | Segment |
| Holds the contents of a device memory segment. | |
| typedef array_span < uint_least8_t, 32 > | Page |
| Holds the contents of a device memory page. | |
| enum | Speed |
Speed of the 1-Wire bus. More... | |
| enum | Level |
Level of the 1-Wire bus. More... | |
Public Member Functions | |
| MaximInterface_EXPORT error_code | initialize (Config config=Config()) |
| Initialize hardware for use. | |
| MaximInterface_EXPORT error_code | writeConfig (Config config) |
| Write a new configuration to the DS2465. | |
| MaximInterface_EXPORT error_code | writePortParameter (PortParameter param, int val) |
| Write a new port configuration parameter to the DS2465. | |
| virtual MaximInterface_EXPORT error_code | reset () |
| Reset all of the devices on the 1-Wire bus and check for a presence pulse. | |
| virtual MaximInterface_EXPORT error_code | touchBitSetLevel (bool &sendRecvBit, Level afterLevel) |
| Send and receive one bit of communication and set a new level on the 1-Wire bus. | |
| virtual MaximInterface_EXPORT error_code | readByteSetLevel (uint_least8_t &recvByte, Level afterLevel) |
| Receive one byte of communication and set a new level on the 1-Wire bus. | |
| virtual MaximInterface_EXPORT error_code | writeByteSetLevel (uint_least8_t sendByte, Level afterLevel) |
| Send one byte of communication and set a new level on the 1-Wire bus. | |
| virtual MaximInterface_EXPORT error_code | readBlock (span< uint_least8_t > recvBuf) |
| Receive a block of communication on the 1-Wire bus. | |
| virtual MaximInterface_EXPORT error_code | writeBlock (span< const uint_least8_t > sendBuf) |
| Send a block of communication on the 1-Wire bus. | |
| virtual MaximInterface_EXPORT error_code | setSpeed (Speed newSpeed) |
| Set the 1-Wire bus communication speed. | |
| virtual MaximInterface_EXPORT error_code | setLevel (Level newLevel) |
| virtual MaximInterface_EXPORT error_code | triplet (TripletData &data) |
| 1-Wire Triplet operation. | |
| MaximInterface_EXPORT error_code | readPage (int pageNum, Page::span data) const |
| Read data from an EEPROM memory page. | |
| MaximInterface_EXPORT error_code | writePage (int pageNum, Page::const_span data) |
| Write data to an EEPROM memory page. | |
| MaximInterface_EXPORT error_code | writeSegment (int pageNum, int segmentNum, Segment::const_span data) |
| Write data to an EEPROM memory segment. | |
| MaximInterface_EXPORT error_code | writeMasterSecret (Sha256::Hash::const_span masterSecret) |
| Write data to the secret EEPROM memory page. | |
| MaximInterface_EXPORT error_code | computeNextMasterSecret (Sha256::AuthenticationData::const_span data) |
| Compute Next Master Secret. | |
| MaximInterface_EXPORT error_code | computeNextMasterSecretWithSwap (Sha256::AuthenticationData::const_span data, int pageNum, PageRegion region) |
| Compute Next Master Secret with page swapping. | |
| MaximInterface_EXPORT error_code | computeWriteMac (Sha256::WriteMacData::const_span data, Sha256::Hash::span mac) const |
| Compute Write MAC. | |
| MaximInterface_EXPORT error_code | computeAndTransmitWriteMac (Sha256::WriteMacData::const_span data) const |
| Compute Write MAC. | |
| MaximInterface_EXPORT error_code | computeWriteMacWithSwap (Sha256::WriteMacData::const_span data, int pageNum, int segmentNum, Sha256::Hash::span mac) const |
| Compute Write MAC with page swapping. | |
| MaximInterface_EXPORT error_code | computeAndTransmitWriteMacWithSwap (Sha256::WriteMacData::const_span data, int pageNum, int segmentNum) const |
| Compute Write MAC with page swapping. | |
| MaximInterface_EXPORT error_code | computeSlaveSecret (Sha256::AuthenticationData::const_span data) |
| Compute Slave Secret (S-Secret). | |
| MaximInterface_EXPORT error_code | computeSlaveSecretWithSwap (Sha256::AuthenticationData::const_span data, int pageNum, PageRegion region) |
| Compute Slave Secret (S-Secret) with page swapping. | |
| MaximInterface_EXPORT error_code | computeAuthMac (Sha256::AuthenticationData::const_span data, Sha256::Hash::span mac) const |
| Compute Authentication MAC. | |
| MaximInterface_EXPORT error_code | computeAndTransmitAuthMac (Sha256::AuthenticationData::const_span data) const |
| Compute Authentication MAC. | |
| MaximInterface_EXPORT error_code | computeAuthMacWithSwap (Sha256::AuthenticationData::const_span data, int pageNum, PageRegion region, Sha256::Hash::span mac) const |
| Compute Authentication MAC with page swapping. | |
| MaximInterface_EXPORT error_code | computeAndTransmitAuthMacWithSwap (Sha256::AuthenticationData::const_span data, int pageNum, PageRegion region) const |
| Compute Authentication MAC with page swapping. | |
| error_code | writeBitSetLevel (bool sendBit, Level afterLevel) |
| Send one bit of communication and set a new level on the 1-Wire bus. | |
| error_code | readBitSetLevel (bool &recvBit, Level afterLevel) |
| Receive one bit of communication and set a new level on the 1-Wire bus. | |
Detailed Description
Interface to the DS2465 1-Wire master and SHA-256 coprocessor.
Definition at line 46 of file DS2465.hpp.
Member Typedef Documentation
| typedef array_span<uint_least8_t, 32> Page |
Holds the contents of a device memory page.
Definition at line 71 of file DS2465.hpp.
| typedef array_span<uint_least8_t, 4> Segment |
Holds the contents of a device memory segment.
Definition at line 68 of file DS2465.hpp.
Member Enumeration Documentation
| enum ErrorValue |
Result of all 1-Wire commands.
Reimplemented from OneWireMaster.
Definition at line 48 of file DS2465.hpp.
enum Level [inherited] |
Level of the 1-Wire bus.
Definition at line 50 of file OneWireMaster.hpp.
| enum PageRegion |
Page region to use for swapping.
Definition at line 65 of file DS2465.hpp.
| enum PortParameter |
1-Wire port adjustment parameters.
- Note:
- See datasheet page 13.
Definition at line 52 of file DS2465.hpp.
enum Speed [inherited] |
Speed of the 1-Wire bus.
Definition at line 47 of file OneWireMaster.hpp.
Member Function Documentation
| error_code computeAndTransmitAuthMac | ( | Sha256::AuthenticationData::const_span | data ) | const |
Compute Authentication MAC.
- Parameters:
-
data Combined data fields for computation.
Definition at line 724 of file DS2465.cpp.
| error_code computeAndTransmitAuthMacWithSwap | ( | Sha256::AuthenticationData::const_span | data, |
| int | pageNum, | ||
| PageRegion | region | ||
| ) | const |
Compute Authentication MAC with page swapping.
- Parameters:
-
data Combined data fields for computation. pageNum Page number to swap in. region Region of the page to swap in.
Definition at line 752 of file DS2465.cpp.
| error_code computeAndTransmitWriteMac | ( | Sha256::WriteMacData::const_span | data ) | const |
Compute Write MAC.
- Parameters:
-
data Combined data fields for computation.
Definition at line 651 of file DS2465.cpp.
| error_code computeAndTransmitWriteMacWithSwap | ( | Sha256::WriteMacData::const_span | data, |
| int | pageNum, | ||
| int | segmentNum | ||
| ) | const |
Compute Write MAC with page swapping.
- Parameters:
-
data Combined data fields for computation. pageNum Page number to swap in. segmentNum Segment number to swap in.
Definition at line 679 of file DS2465.cpp.
| error_code computeAuthMac | ( | Sha256::AuthenticationData::const_span | data, |
| Sha256::Hash::span | mac | ||
| ) | const |
Compute Authentication MAC.
- Parameters:
-
data Combined data fields for computation. [out] mac Computed Auth MAC.
Definition at line 714 of file DS2465.cpp.
| error_code computeAuthMacWithSwap | ( | Sha256::AuthenticationData::const_span | data, |
| int | pageNum, | ||
| PageRegion | region, | ||
| Sha256::Hash::span | mac | ||
| ) | const |
Compute Authentication MAC with page swapping.
- Parameters:
-
data Combined data fields for computation. pageNum Page number to swap in. region Region of the page to swap in. [out] mac Computed Auth MAC.
Definition at line 742 of file DS2465.cpp.
| error_code computeNextMasterSecret | ( | Sha256::AuthenticationData::const_span | data ) |
Compute Next Master Secret.
- Parameters:
-
data Combined data fields for computation.
Definition at line 615 of file DS2465.cpp.
| error_code computeNextMasterSecretWithSwap | ( | Sha256::AuthenticationData::const_span | data, |
| int | pageNum, | ||
| PageRegion | region | ||
| ) |
Compute Next Master Secret with page swapping.
- Parameters:
-
data Combined data fields for computation. pageNum Page number to swap in. region Region of the page to swap in.
Definition at line 624 of file DS2465.cpp.
| error_code computeSlaveSecret | ( | Sha256::AuthenticationData::const_span | data ) |
Compute Slave Secret (S-Secret).
- Parameters:
-
data Combined data fields for computation.
Definition at line 688 of file DS2465.cpp.
| error_code computeSlaveSecretWithSwap | ( | Sha256::AuthenticationData::const_span | data, |
| int | pageNum, | ||
| PageRegion | region | ||
| ) |
Compute Slave Secret (S-Secret) with page swapping.
- Parameters:
-
data Combined data fields for computation. pageNum Page number to swap in. region Region of the page to swap in.
Definition at line 697 of file DS2465.cpp.
| error_code computeWriteMac | ( | Sha256::WriteMacData::const_span | data, |
| Sha256::Hash::span | mac | ||
| ) | const |
Compute Write MAC.
- Parameters:
-
data Combined data fields for computation. [out] mac Computed Write MAC.
Definition at line 641 of file DS2465.cpp.
| error_code computeWriteMacWithSwap | ( | Sha256::WriteMacData::const_span | data, |
| int | pageNum, | ||
| int | segmentNum, | ||
| Sha256::Hash::span | mac | ||
| ) | const |
Compute Write MAC with page swapping.
- Parameters:
-
data Combined data fields for computation. pageNum Page number to swap in. segmentNum Segment number to swap in. [out] mac Computed Write MAC.
Definition at line 668 of file DS2465.cpp.
Initialize hardware for use.
Definition at line 69 of file DS2465.cpp.
| error_code readBitSetLevel | ( | bool & | recvBit, |
| Level | afterLevel | ||
| ) | [inherited] |
Receive one bit of communication and set a new level on the 1-Wire bus.
- Parameters:
-
[out] recvBit Received data from the 1-Wire bus. afterLevel Level to set the 1-Wire bus to after communication.
Definition at line 134 of file OneWireMaster.hpp.
| error_code 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 from OneWireMaster.
Definition at line 257 of file DS2465.cpp.
| error_code readByteSetLevel | ( | uint_least8_t & | recvByte, |
| Level | afterLevel | ||
| ) | [virtual] |
Receive one byte of communication and set a new level on the 1-Wire bus.
- Parameters:
-
recvByte Buffer to receive the data from the 1-Wire bus. afterLevel Level to set the 1-Wire bus to after communication.
Reimplemented from OneWireMaster.
Definition at line 323 of file DS2465.cpp.
| error_code readPage | ( | int | pageNum, |
| Page::span | data | ||
| ) | const |
Read data from an EEPROM memory page.
- Parameters:
-
pageNum Page number to read from. [out] data Data that was read.
Definition at line 136 of file DS2465.cpp.
| error_code reset | ( | ) | [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.
Implements OneWireMaster.
Definition at line 563 of file DS2465.cpp.
| error_code setLevel | ( | Level | newLevel ) | [virtual] |
Set the 1-Wire bus level.
- Note:
- The DS2465 only supports enabling strong pullup following a 1-Wire read or write operation.
Implements OneWireMaster.
Definition at line 212 of file DS2465.cpp.
| error_code setSpeed | ( | Speed | newSpeed ) | [virtual] |
Set the 1-Wire bus communication speed.
Implements OneWireMaster.
Definition at line 220 of file DS2465.cpp.
| error_code touchBitSetLevel | ( | bool & | sendRecvBit, |
| Level | afterLevel | ||
| ) | [virtual] |
Send and receive one bit of communication and set a new level on the 1-Wire bus.
- Parameters:
-
[in,out] sendRecvBit Input containing the bit to send and output containing the received bit. afterLevel Level to set the 1-Wire bus to after communication.
Implements OneWireMaster.
Definition at line 378 of file DS2465.cpp.
| error_code triplet | ( | TripletData & | data ) | [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:
-
[in,out] data Input with desired writeBit in case both read bits are zero. Output with all data fields set.
Reimplemented from OneWireMaster.
Definition at line 233 of file DS2465.cpp.
| error_code writeBitSetLevel | ( | bool | sendBit, |
| Level | afterLevel | ||
| ) | [inherited] |
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.
| error_code 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 from OneWireMaster.
Definition at line 282 of file DS2465.cpp.
| error_code writeByteSetLevel | ( | uint_least8_t | sendByte, |
| Level | afterLevel | ||
| ) | [virtual] |
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 from OneWireMaster.
Definition at line 354 of file DS2465.cpp.
| error_code writeConfig | ( | Config | config ) |
Write a new configuration to the DS2465.
- Parameters:
-
[in] config New configuration to write.
Definition at line 475 of file DS2465.cpp.
| error_code writeMasterSecret | ( | Sha256::Hash::const_span | masterSecret ) |
Write data to the secret EEPROM memory page.
Definition at line 174 of file DS2465.cpp.
| error_code writePage | ( | int | pageNum, |
| Page::const_span | data | ||
| ) |
Write data to an EEPROM memory page.
- Parameters:
-
pageNum Page number to copy to. data Data to write.
Definition at line 151 of file DS2465.cpp.
| error_code writePortParameter | ( | PortParameter | param, |
| int | val | ||
| ) |
Write a new port configuration parameter to the DS2465.
- Parameters:
-
[in] param Parameter to adjust. [in] val New parameter value to set. Consult datasheet for value mappings.
Definition at line 493 of file DS2465.cpp.
| error_code writeSegment | ( | int | pageNum, |
| int | segmentNum, | ||
| Segment::const_span | data | ||
| ) |
Write data to an EEPROM memory segment.
- Parameters:
-
pageNum Page number to copy to. segmentNum Segment number to copy to. data Data to write.
Definition at line 162 of file DS2465.cpp.
Generated on Tue Jul 12 2022 23:29:45 by
1.7.2