2020-06-05 16:44:00 +02:00
|
|
|
#ifndef FRAMEWORK_GLOBALFUNCTIONS_ARRAYPRINTER_H_
|
|
|
|
#define FRAMEWORK_GLOBALFUNCTIONS_ARRAYPRINTER_H_
|
2021-01-15 16:32:25 +01:00
|
|
|
|
2020-05-11 12:22:06 +02:00
|
|
|
#include <cstdint>
|
|
|
|
#include <cstddef>
|
|
|
|
|
2020-05-15 18:47:46 +02:00
|
|
|
enum class OutputType {
|
2021-01-15 16:32:25 +01:00
|
|
|
DEC,
|
|
|
|
HEX,
|
|
|
|
BIN
|
2020-05-15 18:47:46 +02:00
|
|
|
};
|
2020-05-11 12:22:06 +02:00
|
|
|
|
2021-01-15 16:32:25 +01:00
|
|
|
//! TODO: Write unit tests for this module.
|
2020-06-05 16:44:00 +02:00
|
|
|
namespace arrayprinter {
|
2021-01-15 16:32:25 +01:00
|
|
|
|
2020-05-19 20:26:12 +02:00
|
|
|
void print(const uint8_t* data, size_t size, OutputType type = OutputType::HEX,
|
2021-01-15 16:32:25 +01:00
|
|
|
bool printInfo = true, size_t maxCharPerLine = 12);
|
2020-05-19 20:26:12 +02:00
|
|
|
void printHex(const uint8_t* data, size_t size, size_t maxCharPerLine = 12);
|
|
|
|
void printDec(const uint8_t* data, size_t size, size_t maxCharPerLine = 12);
|
2020-05-19 23:08:17 +02:00
|
|
|
void printBin(const uint8_t* data, size_t size);
|
2021-01-15 16:32:25 +01:00
|
|
|
|
2020-05-15 18:47:46 +02:00
|
|
|
}
|
2020-05-11 12:22:06 +02:00
|
|
|
|
2020-06-05 16:44:00 +02:00
|
|
|
#endif /* FRAMEWORK_GLOBALFUNCTIONS_ARRAYPRINTER_H_ */
|