Extended MaximInterface
Dependents: mbed_DS28EC20_GPIO
DS28EL25 Class Reference
Interface to the DS28EL25 (low power) authenticator. More...
#include <DS28E15_22_25.hpp>
Inherits MaximInterface::DS28E15_22_25.
Inherited by DS28E25.
Public Types | |
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. | |
typedef array_span < uint_least8_t, 32 > | Scratchpad |
Holds the contents of the device scratchpad. | |
Public Member Functions | |
MaximInterface_EXPORT error_code | writeScratchpad (Scratchpad::const_span data) |
Perform Write Scratchpad operation on the device. | |
MaximInterface_EXPORT error_code | readScratchpad (Scratchpad::span data) const |
Perform a Read Scratchpad operation on the device. | |
MaximInterface_EXPORT error_code | readBlockProtection (int blockNum, BlockProtection &protection) const |
Read the status of a memory protection block using the Read Status command. | |
MaximInterface_EXPORT error_code | writeAuthSegment (int pageNum, int segmentNum, Segment::const_span newData, Sha256::Hash::const_span mac) |
Write memory segment using the Authenticated Write Memory command. | |
MaximInterface_EXPORT error_code | continueWriteAuthSegment (Segment::const_span newData, Sha256::Hash::const_span mac) |
Continue an in-progress Authenticated Write Memory command. | |
MaximInterface_EXPORT error_code | readAllBlockProtection (span< BlockProtection, protectionBlocks > protection) const |
Read the status of all memory protection blocks using the Read Status command. | |
MaximInterface_EXPORT error_code | readSegment (int pageNum, int segmentNum, Segment::span data) const |
Read memory segment using the Read Memory command on the device. | |
MaximInterface_EXPORT error_code | continueReadSegment (Segment::span data) const |
Continue an in-progress readSegment operation. | |
MaximInterface_EXPORT error_code | writeSegment (int pageNum, int segmentNum, Segment::const_span data) |
Write memory segment using the Write Memory command. | |
MaximInterface_EXPORT error_code | continueWriteSegment (Segment::const_span data) |
Continue an in-progress Write Memory command. | |
MaximInterface_EXPORT error_code | readPage (int pageNum, Page::span rdbuf) const |
Read memory page using the Read Memory command on the device. | |
MaximInterface_EXPORT error_code | continueReadPage (Page::span rdbuf) const |
Continue an in-progress readPageOperation. | |
MaximInterface_EXPORT error_code | computeReadPageMac (int pageNum, bool anon, Sha256::Hash::span mac) const |
Perform a Compute Page MAC command on the device. | |
MaximInterface_EXPORT error_code | writeBlockProtection (BlockProtection protection) |
Update the status of a memory protection block using the Write Page Protection command. | |
MaximInterface_EXPORT error_code | writeAuthBlockProtection (BlockProtection newProtection, Sha256::Hash::const_span mac) |
Update the status of a memory protection block using the Authenticated Write Page Protection command. | |
MaximInterface_EXPORT error_code | loadSecret (bool lock) |
Perform Load and Lock Secret command on the device. | |
MaximInterface_EXPORT error_code | computeSecret (int pageNum, bool lock) |
Perform a Compute and Lock Secret command on the device. | |
MaximInterface_EXPORT error_code | readPersonality (Personality &personality) 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 DS28EL25 (low power) authenticator.
Definition at line 375 of file DS28E15_22_25.hpp.
Member Typedef Documentation
typedef array_span<uint_least8_t, 32> Page [inherited] |
Holds the contents of a device memory page.
Definition at line 58 of file DS28E15_22_25.hpp.
typedef array_span<uint_least8_t, 32> Scratchpad [inherited] |
Holds the contents of the device scratchpad.
Definition at line 64 of file DS28E15_22_25.hpp.
typedef array_span<uint_least8_t, 4> Segment [inherited] |
Holds the contents of a device memory segment.
Definition at line 55 of file DS28E15_22_25.hpp.
Member Function Documentation
error_code computeReadPageMac | ( | int | pageNum, |
bool | anon, | ||
Sha256::Hash::span | mac | ||
) | 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. [out] mac The device computed MAC.
Definition at line 276 of file DS28E15_22_25.cpp.
error_code computeSecret | ( | int | pageNum, |
bool | lock | ||
) | [inherited] |
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 in DS28E15, DS28E22, and DS28E25.
Definition at line 519 of file DS28E15_22_25.cpp.
error_code continueReadPage | ( | Page::span | rdbuf ) | const [inherited] |
Continue an in-progress readPageOperation.
- Parameters:
-
[out] rdbuf Buffer to read data from the page into.
Definition at line 361 of file DS28E15_22_25.cpp.
error_code continueReadSegment | ( | Segment::span | data ) | const [inherited] |
Continue an in-progress readSegment operation.
- Note:
- A CRC16 will encountered after reading the last segment of a page.
- Parameters:
-
[out] data Buffer to read data from the segment into.
Definition at line 429 of file DS28E15_22_25.cpp.
error_code continueWriteAuthSegment | ( | Segment::const_span | newData, |
Sha256::Hash::const_span | mac | ||
) |
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 637 of file DS28E15_22_25.cpp.
error_code 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 444 of file DS28E15_22_25.cpp.
error_code loadSecret | ( | bool | lock ) | [inherited] |
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 in DS28E15, DS28E22, and DS28E25.
Definition at line 514 of file DS28E15_22_25.cpp.
error_code readAllBlockProtection | ( | span< BlockProtection, protectionBlocks > | protection ) | const |
Read the status of all memory protection blocks using the Read Status command.
- Parameters:
-
[out] protection Receives protection statuses read from device.
Definition at line 642 of file DS28E15_22_25.cpp.
error_code readBlockProtection | ( | int | blockNum, |
BlockProtection & | protection | ||
) | const |
Read the status of a memory protection block using the Read Status command.
- Parameters:
-
blockNum Block number to to read status of. [out] protection Receives protection status read from device.
Definition at line 626 of file DS28E15_22_25.cpp.
error_code readPage | ( | int | pageNum, |
Page::span | rdbuf | ||
) | const [inherited] |
Read memory page using the Read Memory command on the device.
- Parameters:
-
pageNum Page number for write operation. [out] rdbuf Buffer to read data from the page into.
Definition at line 351 of file DS28E15_22_25.cpp.
error_code readPersonality | ( | Personality & | personality ) | const [inherited] |
Read the personality bytes using the Read Status command.
- Parameters:
-
[out] personality Receives personality read from device.
Definition at line 524 of file DS28E15_22_25.cpp.
error_code readScratchpad | ( | Scratchpad::span | data ) | const |
Perform a Read Scratchpad operation on the device.
- Parameters:
-
[out] data Buffer to read data from the scratchpad into.
Definition at line 622 of file DS28E15_22_25.cpp.
error_code readSegment | ( | int | pageNum, |
int | segmentNum, | ||
Segment::span | data | ||
) | 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. [out] data Buffer to read data from the segment into.
Definition at line 418 of file DS28E15_22_25.cpp.
error_code writeAuthBlockProtection | ( | BlockProtection | newProtection, |
Sha256::Hash::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 219 of file DS28E15_22_25.cpp.
error_code writeAuthSegment | ( | int | pageNum, |
int | segmentNum, | ||
Segment::const_span | newData, | ||
Sha256::Hash::const_span | mac | ||
) |
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 631 of file DS28E15_22_25.cpp.
error_code 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 248 of file DS28E15_22_25.cpp.
error_code writeScratchpad | ( | Scratchpad::const_span | data ) |
Perform Write Scratchpad operation on the device.
- Parameters:
-
[in] data Data to write to the scratchpad.
Definition at line 618 of file DS28E15_22_25.cpp.
error_code 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 433 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 61 of file DS28E15_22_25.hpp.
Generated on Tue Jul 12 2022 23:29:45 by 1.7.2