Extended MaximInterface

Dependents:   mbed_DS28EC20_GPIO

Embed: (wiki syntax)

« Back to documentation index

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:
pageNumPage number to use for the computation.
anonTrue to compute in anonymous mode where ROM ID is not used.
[out]macThe 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:
pageNumPage number to use as the binding data.
lockPrevent 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]rdbufBuffer 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]dataBuffer 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]newDataNew data to write to the segment.
[in]macWrite 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]dataData 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:
lockPrevent 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]protectionReceives 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:
blockNumBlock number to to read status of.
[out]protectionReceives 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:
pageNumPage number for write operation.
[out]rdbufBuffer 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]personalityReceives 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]dataBuffer 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:
pageNumPage number for read operation.
segmentNumSegment number within page for read operation.
[out]dataBuffer 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:
newProtectionNew protection status to write.
[in]macWrite 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:
pageNumPage number for write operation.
segmentNumSegment number within page for write operation.
[in]newDataNew data to write to the segment.
[in]macWrite 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:
protectionDesired 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]dataData 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:
pageNumPage number for write operation.
segmentNumSegment number within page for write operation.
[in]dataData 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.