blob: 29c0f931990e8a536115723f476e93f0dcd37622 [file] [log] [blame]
Ben Tyner92e39fd2020-02-05 18:11:02 -06001/**
2 * @file These are implementations of the user interfaces declared in
3 * hei_user_interface.hpp
4 */
5
Zane Shelleyb78dd0c2020-05-08 14:35:15 -05006#include <stdarg.h>
7#include <stdio.h>
8
Ben Tyner92e39fd2020-02-05 18:11:02 -06009#include <hei_user_interface.hpp>
10
11namespace libhei
12{
13
14//------------------------------------------------------------------------------
15
Zane Shelleyb78dd0c2020-05-08 14:35:15 -050016bool registerRead(const Chip& i_chip, void* o_buffer, size_t& io_bufSize,
17 uint64_t i_regType, uint64_t i_address)
Ben Tyner92e39fd2020-02-05 18:11:02 -060018{
Zane Shelleyb78dd0c2020-05-08 14:35:15 -050019 bool accessFailure = false;
Ben Tyner92e39fd2020-02-05 18:11:02 -060020
21 // HEI_INF("registerRead(%p,%p,%lx,%lx,%lx)", i_chip.getChip(),
22 // o_buffer, io_bufSize, i_regType, i_address);
23
Zane Shelleyb78dd0c2020-05-08 14:35:15 -050024 return accessFailure;
Ben Tyner92e39fd2020-02-05 18:11:02 -060025}
26
27//------------------------------------------------------------------------------
28
29#ifndef __HEI_READ_ONLY
30
Zane Shelleyb78dd0c2020-05-08 14:35:15 -050031bool registerWrite(const Chip& i_chip, void* i_buffer, size_t& io_bufSize,
32 uint64_t i_regType, uint64_t i_address)
Ben Tyner92e39fd2020-02-05 18:11:02 -060033{
Zane Shelleyb78dd0c2020-05-08 14:35:15 -050034 bool accessFailure = false;
Ben Tyner92e39fd2020-02-05 18:11:02 -060035
36 // HEI_INF("registerWrite(%p,%p,%lx,%lx,%lx)", i_chip.getChip(),
37 // i_buffer, io_bufSize, i_regType, i_address);
38
Zane Shelleyb78dd0c2020-05-08 14:35:15 -050039 return accessFailure;
Ben Tyner92e39fd2020-02-05 18:11:02 -060040}
41
42#endif
43
44//------------------------------------------------------------------------------
45
Zane Shelleyb78dd0c2020-05-08 14:35:15 -050046// prints a single line to stdout
47void hei_inf(char* format, ...)
48{
49 va_list args;
50 fprintf(stdout, "I> ");
51 va_start(args, format);
52 vfprintf(stdout, format, args);
53 va_end(args);
54 fprintf(stdout, "\n");
55}
56
57//------------------------------------------------------------------------------
58
59// prints a single line to stderr
60void hei_err(char* format, ...)
61{
62 va_list args;
63 fprintf(stderr, "E> ");
64 va_start(args, format);
65 vfprintf(stderr, format, args);
66 va_end(args);
67 fprintf(stderr, "\n");
68}
69
Ben Tyner92e39fd2020-02-05 18:11:02 -060070} // namespace libhei