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:
Thu Mar 31 11:56:01 2016 -0500
Revision:
33:a4c015046956
Parent:
21:00c94aeb533e
Child:
48:6f9208ae280e
Created a generic array wrapper class. Updated array types used in ISha256MacCoprocessor and DS28E15_22_25 for clarity.

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 33:a4c015046956 7 #include "array.hpp"
IanBenzMaxim 33:a4c015046956 8
IanBenzMaxim 21:00c94aeb533e 9 class ISha256MacCoprocessor
IanBenzMaxim 21:00c94aeb533e 10 {
IanBenzMaxim 21:00c94aeb533e 11 public:
IanBenzMaxim 21:00c94aeb533e 12 enum CmdResult
IanBenzMaxim 21:00c94aeb533e 13 {
IanBenzMaxim 21:00c94aeb533e 14 Success,
IanBenzMaxim 21:00c94aeb533e 15 OperationFailure
IanBenzMaxim 21:00c94aeb533e 16 };
IanBenzMaxim 21:00c94aeb533e 17
IanBenzMaxim 33:a4c015046956 18 typedef array<std::uint8_t, 32> DevicePage;
IanBenzMaxim 33:a4c015046956 19 typedef array<std::uint8_t, 32> DeviceScratchpad;
IanBenzMaxim 33:a4c015046956 20 typedef array<std::uint8_t, 32> Secret;
IanBenzMaxim 33:a4c015046956 21 typedef array<std::uint8_t, 32> Mac;
IanBenzMaxim 33:a4c015046956 22 typedef array<std::uint8_t, 20> WriteMacData;
IanBenzMaxim 33:a4c015046956 23 typedef array<std::uint8_t, 12> AuthMacData;
IanBenzMaxim 33:a4c015046956 24 typedef array<std::uint8_t, 12> SlaveSecretData;
IanBenzMaxim 21:00c94aeb533e 25
IanBenzMaxim 33:a4c015046956 26 virtual CmdResult setMasterSecret(const Secret & secret) = 0;
IanBenzMaxim 33:a4c015046956 27 virtual CmdResult computeWriteMac(const WriteMacData & writeMacData, Mac & mac) const = 0;
IanBenzMaxim 33:a4c015046956 28 virtual CmdResult computeAuthMac(const DevicePage & devicePage, const DeviceScratchpad & challenge, const AuthMacData & authMacData, Mac & mac) const = 0;
IanBenzMaxim 33:a4c015046956 29 virtual CmdResult computeSlaveSecret(const DevicePage & devicePage, const DeviceScratchpad & deviceScratchpad, const SlaveSecretData & slaveSecretData) = 0;
IanBenzMaxim 21:00c94aeb533e 30 };
IanBenzMaxim 21:00c94aeb533e 31
IanBenzMaxim 21:00c94aeb533e 32 #endif