Device interface library for multiple platforms including Mbed.
Dependents: DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#
DS28E15 Class Reference
Interface to the DS28E15 authenticator. More...
#include <DS28E15_22_25.hpp>
Inherits MaximInterfaceDevices::DS28EL15.
Public Types | |
typedef Core::array_span < uint_least8_t, 4 > | Segment |
Holds the contents of a device memory segment. | |
typedef Core::array_span < uint_least8_t, 32 > | Page |
Holds the contents of a device memory page. | |
Public Member Functions | |
MaximInterfaceDevices_EXPORT Core::Result< void > | loadSecret (bool lock) |
Perform Load and Lock Secret command on the device. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | computeSecret (int pageNum, bool lock) |
Perform a Compute and Lock Secret command on the device. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | writeScratchpad (Page::const_span data) |
Perform Write Scratchpad operation on the device. | |
MaximInterfaceDevices_EXPORT Core::Result< Page::array > | readScratchpad () const |
Perform a Read Scratchpad operation on the device. | |
MaximInterfaceDevices_EXPORT Core::Result< BlockProtection > | readBlockProtection (int blockNum) const |
Read the status of a memory protection block using the Read Status command. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | writeAuthSegment (int pageNum, int segmentNum, Segment::const_span newData, Page::const_span mac) |
Write memory segment using the Authenticated Write Memory command. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | continueWriteAuthSegment (Segment::const_span newData, Page::const_span mac) |
Continue an in-progress Authenticated Write Memory command. | |
MaximInterfaceDevices_EXPORT Core::Result< Core::array < BlockProtection, protectionBlocks > > | readAllBlockProtection () const |
Read the status of all memory protection blocks using the Read Status command. | |
MaximInterfaceDevices_EXPORT Core::Result< Segment::array > | readSegment (int pageNum, int segmentNum) const |
Read memory segment using the Read Memory command on the device. | |
MaximInterfaceDevices_EXPORT Core::Result< Segment::array > | continueReadSegment () const |
Continue an in-progress readSegment operation. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | writeSegment (int pageNum, int segmentNum, Segment::const_span data) |
Write memory segment using the Write Memory command. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | continueWriteSegment (Segment::const_span data) |
Continue an in-progress Write Memory command. | |
MaximInterfaceDevices_EXPORT Core::Result< Page::array > | readPage (int pageNum) const |
Read memory page using the Read Memory command on the device. | |
MaximInterfaceDevices_EXPORT Core::Result< Page::array > | continueReadPage () const |
Continue an in-progress readPageOperation. | |
MaximInterfaceDevices_EXPORT Core::Result< Page::array > | computeReadPageMac (int pageNum, bool anon) const |
Perform a Compute Page MAC command on the device. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | writeBlockProtection (BlockProtection protection) |
Update the status of a memory protection block using the Write Page Protection command. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | writeAuthBlockProtection (BlockProtection newProtection, Page::const_span mac) |
Update the status of a memory protection block using the Authenticated Write Page Protection command. | |
MaximInterfaceDevices_EXPORT Core::Result< Personality > | readPersonality () const |
Read the personality bytes using the Read Status command. | |
Static Public Attributes | |
static const int | segmentsPerPage = Page::size / Segment::size |
Number of segments per page. |
Detailed Description
Interface to the DS28E15 authenticator.
Definition at line 306 of file DS28E15_22_25.hpp.
Member Typedef Documentation
typedef Core::array_span<uint_least8_t, 32> Page [inherited] |
Holds the contents of a device memory page.
Definition at line 62 of file DS28E15_22_25.hpp.
typedef Core::array_span<uint_least8_t, 4> Segment [inherited] |
Holds the contents of a device memory segment.
Definition at line 59 of file DS28E15_22_25.hpp.
Member Function Documentation
Result< DS28E15_22_25::Page::array > computeReadPageMac | ( | int | pageNum, |
bool | anon | ||
) | const [inherited] |
Perform a Compute Page MAC command on the device.
Read back the MAC and verify the CRC16.
- Parameters:
-
pageNum Page number to use for the computation. anon True to compute in anonymous mode where ROM ID is not used.
- Returns:
- The device computed MAC.
Definition at line 262 of file DS28E15_22_25.cpp.
Result< void > computeSecret | ( | int | pageNum, |
bool | lock | ||
) |
Perform a Compute and Lock Secret command on the device.
- Parameters:
-
pageNum Page number to use as the binding data. lock Prevent further changes to the secret on the device after computing.
Reimplemented from DS28E15_22_25.
Definition at line 581 of file DS28E15_22_25.cpp.
Result< DS28E15_22_25::Page::array > continueReadPage | ( | ) | const [inherited] |
Continue an in-progress readPageOperation.
- Returns:
- Buffer to read data from the page into.
Definition at line 355 of file DS28E15_22_25.cpp.
Result< DS28E15_22_25::Segment::array > continueReadSegment | ( | ) | const [inherited] |
Continue an in-progress readSegment operation.
- Note:
- A CRC16 will encountered after reading the last segment of a page.
- Returns:
- Buffer to read data from the segment into.
Definition at line 426 of file DS28E15_22_25.cpp.
Result< void > continueWriteAuthSegment | ( | Segment::const_span | newData, |
Page::const_span | mac | ||
) | [inherited] |
Continue an in-progress Authenticated Write Memory command.
- Parameters:
-
[in] newData New data to write to the segment. [in] mac Write MAC computed for this operation.
Definition at line 565 of file DS28E15_22_25.cpp.
Result< void > continueWriteSegment | ( | Segment::const_span | data ) | [inherited] |
Continue an in-progress Write Memory command.
- Parameters:
-
[in] data Data to write to the memory segment.
Definition at line 443 of file DS28E15_22_25.cpp.
Result< void > loadSecret | ( | bool | lock ) |
Perform Load and Lock Secret command on the device.
- Note:
- The secret should already be stored in the scratchpad on the device.
- Parameters:
-
lock Prevent further changes to the secret on the device after loading.
Reimplemented from DS28E15_22_25.
Definition at line 577 of file DS28E15_22_25.cpp.
Result< array< DS28E15_22_25::BlockProtection, DS28E15::protectionBlocks > > readAllBlockProtection | ( | ) | const [inherited] |
Read the status of all memory protection blocks using the Read Status command.
- Returns:
- Receives protection statuses read from device.
Definition at line 571 of file DS28E15_22_25.cpp.
Result< DS28E15_22_25::BlockProtection > readBlockProtection | ( | int | blockNum ) | const [inherited] |
Read the status of a memory protection block using the Read Status command.
- Parameters:
-
blockNum Block number to to read status of.
- Returns:
- Receives protection status read from device.
Definition at line 555 of file DS28E15_22_25.cpp.
Result< DS28E15_22_25::Page::array > readPage | ( | int | pageNum ) | const [inherited] |
Read memory page using the Read Memory command on the device.
- Parameters:
-
pageNum Page number for write operation.
- Returns:
- Buffer to read data from the page into.
Definition at line 346 of file DS28E15_22_25.cpp.
Result< DS28E15_22_25::Personality > readPersonality | ( | ) | const [inherited] |
Read the personality bytes using the Read Status command.
- Returns:
- Receives personality read from device.
Definition at line 523 of file DS28E15_22_25.cpp.
Result< DS28E15_22_25::Page::array > readScratchpad | ( | ) | const [inherited] |
Perform a Read Scratchpad operation on the device.
- Returns:
- Buffer to read data from the scratchpad into.
Definition at line 550 of file DS28E15_22_25.cpp.
Result< DS28E15_22_25::Segment::array > readSegment | ( | int | pageNum, |
int | segmentNum | ||
) | const [inherited] |
Read memory segment using the Read Memory command on the device.
- Parameters:
-
pageNum Page number for read operation. segmentNum Segment number within page for read operation.
- Returns:
- Buffer to read data from the segment into.
Definition at line 416 of file DS28E15_22_25.cpp.
Result< void > writeAuthBlockProtection | ( | BlockProtection | newProtection, |
Page::const_span | mac | ||
) | [inherited] |
Update the status of a memory protection block using the Authenticated Write Page Protection command.
- Parameters:
-
newProtection New protection status to write. [in] mac Write MAC computed for this operation.
Definition at line 210 of file DS28E15_22_25.cpp.
Result< void > writeAuthSegment | ( | int | pageNum, |
int | segmentNum, | ||
Segment::const_span | newData, | ||
Page::const_span | mac | ||
) | [inherited] |
Write memory segment using the Authenticated Write Memory command.
- Parameters:
-
pageNum Page number for write operation. segmentNum Segment number within page for write operation. [in] newData New data to write to the segment. [in] mac Write MAC computed for this operation.
Definition at line 559 of file DS28E15_22_25.cpp.
Result< void > writeBlockProtection | ( | BlockProtection | protection ) | [inherited] |
Update the status of a memory protection block using the Write Page Protection command.
- Parameters:
-
protection Desired protection status for the block. It is not possible to disable existing protections.
Definition at line 239 of file DS28E15_22_25.cpp.
Result< void > writeScratchpad | ( | Page::const_span | data ) | [inherited] |
Perform Write Scratchpad operation on the device.
- Parameters:
-
[in] data Data to write to the scratchpad.
Definition at line 546 of file DS28E15_22_25.cpp.
Result< void > writeSegment | ( | int | pageNum, |
int | segmentNum, | ||
Segment::const_span | data | ||
) | [inherited] |
Write memory segment using the Write Memory command.
- Note:
- 1-Wire ROM selection should have already occurred.
- Parameters:
-
pageNum Page number for write operation. segmentNum Segment number within page for write operation. [in] data Data to write to the memory segment.
Definition at line 432 of file DS28E15_22_25.cpp.
Field Documentation
const int segmentsPerPage = Page::size / Segment::size [static, inherited] |
Number of segments per page.
Definition at line 65 of file DS28E15_22_25.hpp.
Generated on Tue Jul 12 2022 11:13:23 by 1.7.2