1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.

Dependents:   MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more

Superseded by MaximInterface.

Committer:
IanBenzMaxim
Date:
Mon Mar 21 14:12:28 2016 -0500
Revision:
21:00c94aeb533e
Child:
33:a4c015046956
Added class for DS2465. Added a ReadBytePower operation to OneWireMaster since this is required by the authenticators including the DS28E15. Tweaked member data of OneWireMaster. Added path to header file includes to reduce compiler setup required.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IanBenzMaxim 21:00c94aeb533e 1 #ifndef ISHA256MACCOPROCESSOR_H
IanBenzMaxim 21:00c94aeb533e 2 #define ISHA256MACCOPROCESSOR_H
IanBenzMaxim 21:00c94aeb533e 3
IanBenzMaxim 21:00c94aeb533e 4 #include <cstddef>
IanBenzMaxim 21:00c94aeb533e 5 #include <cstdint>
IanBenzMaxim 21:00c94aeb533e 6
IanBenzMaxim 21:00c94aeb533e 7 class ISha256MacCoprocessor
IanBenzMaxim 21:00c94aeb533e 8 {
IanBenzMaxim 21:00c94aeb533e 9 public:
IanBenzMaxim 21:00c94aeb533e 10 enum CmdResult
IanBenzMaxim 21:00c94aeb533e 11 {
IanBenzMaxim 21:00c94aeb533e 12 Success,
IanBenzMaxim 21:00c94aeb533e 13 OperationFailure
IanBenzMaxim 21:00c94aeb533e 14 };
IanBenzMaxim 21:00c94aeb533e 15
IanBenzMaxim 21:00c94aeb533e 16 static const std::size_t devicePage_len = 32;
IanBenzMaxim 21:00c94aeb533e 17 static const std::size_t deviceScratchpad_len = 32;
IanBenzMaxim 21:00c94aeb533e 18 static const std::size_t secret_len = 32;
IanBenzMaxim 21:00c94aeb533e 19
IanBenzMaxim 21:00c94aeb533e 20 static const std::size_t mac_len = 32;
IanBenzMaxim 21:00c94aeb533e 21
IanBenzMaxim 21:00c94aeb533e 22 static const std::size_t WriteMAC_data_len = 20;
IanBenzMaxim 21:00c94aeb533e 23 static const std::size_t AuthMAC_data_len = 12;
IanBenzMaxim 21:00c94aeb533e 24 static const std::size_t SSecret_data_len = 12;
IanBenzMaxim 21:00c94aeb533e 25
IanBenzMaxim 21:00c94aeb533e 26 virtual CmdResult setMasterSecret(const std::uint8_t (&secret)[secret_len]) = 0;
IanBenzMaxim 21:00c94aeb533e 27
IanBenzMaxim 21:00c94aeb533e 28 virtual CmdResult ComputeAndRead_WriteMAC(const std::uint8_t (&WriteMAC_data)[WriteMAC_data_len], std::uint8_t (&mac)[mac_len]) const = 0;
IanBenzMaxim 21:00c94aeb533e 29 virtual CmdResult ComputeAndRead_AuthMAC(const std::uint8_t (&devicePage)[devicePage_len], const std::uint8_t (&challenge)[deviceScratchpad_len],
IanBenzMaxim 21:00c94aeb533e 30 const std::uint8_t (&AuthMAC_data)[AuthMAC_data_len], std::uint8_t (&mac)[mac_len]) const = 0;
IanBenzMaxim 21:00c94aeb533e 31 virtual CmdResult Compute_SSecret(const std::uint8_t (&devicePage)[devicePage_len],
IanBenzMaxim 21:00c94aeb533e 32 const std::uint8_t (&deviceScratchpad)[deviceScratchpad_len], const std::uint8_t (&SSecret_data)[SSecret_data_len]) = 0;
IanBenzMaxim 21:00c94aeb533e 33 };
IanBenzMaxim 21:00c94aeb533e 34
IanBenzMaxim 21:00c94aeb533e 35 #endif