blob: ad27981d0d6e8400499ac464941b10b6a69eafba [file] [log] [blame]
Zane Shelleyca4b2f42019-08-30 15:48:40 -05001#include <hei_includes.hpp>
Zane Shelleyca9f6252019-10-25 21:17:30 -05002#include <hei_user_interface.hpp>
Zane Shelleyca4b2f42019-08-30 15:48:40 -05003
4namespace libhei
5{
6
7//------------------------------------------------------------------------------
8
Zane Shelley83da2452019-10-25 15:45:34 -05009ReturnCode registerRead(void * i_chip, void * o_buffer, size_t & io_bufSize,
10 uint64_t i_regType, uint64_t i_address)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050011{
12 ReturnCode rc;
13
Zane Shelley83da2452019-10-25 15:45:34 -050014 HEI_ASSERT(nullptr != i_chip);
15 HEI_ASSERT(nullptr != o_buffer);
16 HEI_ASSERT(0 != io_bufSize);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050017
Zane Shelley83da2452019-10-25 15:45:34 -050018 switch (i_regType)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050019 {
20 default:
21 rc = RC_REG_ACCESS_FAILURE;
Zane Shelley83da2452019-10-25 15:45:34 -050022 HEI_ERR("registerRead(%p,%p,%lx,%lx,%lx)", i_chip, o_buffer,
23 io_bufSize, i_regType, i_address);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050024 }
25
26 return rc;
27}
28
29//------------------------------------------------------------------------------
30
31#ifndef __HEI_READ_ONLY
32
Zane Shelley83da2452019-10-25 15:45:34 -050033ReturnCode registerWrite(void * i_chip, void * i_buffer, size_t & io_bufSize,
34 uint64_t i_regType, uint64_t i_address)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050035{
36 ReturnCode rc;
37
Zane Shelley83da2452019-10-25 15:45:34 -050038 HEI_ASSERT(nullptr != i_chip);
39 HEI_ASSERT(nullptr != i_buffer);
40 HEI_ASSERT(0 != io_bufSize);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050041
Zane Shelley83da2452019-10-25 15:45:34 -050042 switch (i_regType)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050043 {
44 default:
45 rc = RC_REG_ACCESS_FAILURE;
Zane Shelley83da2452019-10-25 15:45:34 -050046 HEI_ERR("registerWrite(%p,%p,%lx,%lx,%lx)", i_chip, i_buffer,
47 io_bufSize, i_regType, i_address);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050048 }
49
50 return rc;
51}
52
53#endif
54
55//------------------------------------------------------------------------------
56
57} // end namespace libhei