Extended MaximInterface

Dependents:   mbed_DS28EC20_GPIO

Revision:
6:a8c83a2e6fa4
Parent:
0:f77ad7f72d04
Child:
7:471901a04573
--- a/Utilities/crc.hpp	Fri Jan 19 10:25:02 2018 -0600
+++ b/Utilities/crc.hpp	Wed Jan 23 13:11:04 2019 -0600
@@ -36,6 +36,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <MaximInterface/Utilities/Export.h>
+#include "span.hpp"
 
 namespace MaximInterface {
 
@@ -48,11 +49,9 @@
 
 /// Perform a CRC8 calculation with variable length data.
 /// @param[in] data Data array to pass through the CRC generator.
-/// @param dataLen Length of the data array to process.
 /// @param crc Beginning state of the CRC generator.
 /// @returns The calculated CRC8.
-MaximInterface_EXPORT uint_fast8_t calculateCrc8(const uint_least8_t * data,
-                                                 size_t dataLen,
+MaximInterface_EXPORT uint_fast8_t calculateCrc8(span<const uint_least8_t> data,
                                                  uint_fast8_t crc = 0);
 
 /// Perform a CRC16 calculation.
@@ -64,13 +63,10 @@
 
 /// Perform a CRC16 calculation with variable length data.
 /// @param[in] data Data array to pass through the CRC generator.
-/// @param data_offset Offset of the data array to begin processing.
-/// @param data_len Length of the data array to process.
 /// @param crc Beginning state of the CRC generator.
 /// @returns The calculated CRC16.
-MaximInterface_EXPORT uint_fast16_t calculateCrc16(const uint_least8_t * data,
-                                                   size_t dataLen,
-                                                   uint_fast16_t crc = 0);
+MaximInterface_EXPORT uint_fast16_t
+calculateCrc16(span<const uint_least8_t> data, uint_fast16_t crc = 0);
 
 } // namespace MaximInterface