blob: 073ae22ce01205923cbc66837529d96c9a7b8f12 [file] [log] [blame]
Zane Shelleyca4b2f42019-08-30 15:48:40 -05001#include <hei_user_interface.hpp>
2
3#include <hei_includes.hpp>
4
5namespace libhei
6{
7
8//------------------------------------------------------------------------------
9
Zane Shelley83da2452019-10-25 15:45:34 -050010ReturnCode registerRead(void * i_chip, void * o_buffer, size_t & io_bufSize,
11 uint64_t i_regType, uint64_t i_address)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050012{
13 ReturnCode rc;
14
Zane Shelley83da2452019-10-25 15:45:34 -050015 HEI_ASSERT(nullptr != i_chip);
16 HEI_ASSERT(nullptr != o_buffer);
17 HEI_ASSERT(0 != io_bufSize);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050018
Zane Shelley83da2452019-10-25 15:45:34 -050019 switch (i_regType)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050020 {
21 default:
22 rc = RC_REG_ACCESS_FAILURE;
Zane Shelley83da2452019-10-25 15:45:34 -050023 HEI_ERR("registerRead(%p,%p,%lx,%lx,%lx)", i_chip, o_buffer,
24 io_bufSize, i_regType, i_address);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050025 }
26
27 return rc;
28}
29
30//------------------------------------------------------------------------------
31
32#ifndef __HEI_READ_ONLY
33
Zane Shelley83da2452019-10-25 15:45:34 -050034ReturnCode registerWrite(void * i_chip, void * i_buffer, size_t & io_bufSize,
35 uint64_t i_regType, uint64_t i_address)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050036{
37 ReturnCode rc;
38
Zane Shelley83da2452019-10-25 15:45:34 -050039 HEI_ASSERT(nullptr != i_chip);
40 HEI_ASSERT(nullptr != i_buffer);
41 HEI_ASSERT(0 != io_bufSize);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050042
Zane Shelley83da2452019-10-25 15:45:34 -050043 switch (i_regType)
Zane Shelleyca4b2f42019-08-30 15:48:40 -050044 {
45 default:
46 rc = RC_REG_ACCESS_FAILURE;
Zane Shelley83da2452019-10-25 15:45:34 -050047 HEI_ERR("registerWrite(%p,%p,%lx,%lx,%lx)", i_chip, i_buffer,
48 io_bufSize, i_regType, i_address);
Zane Shelleyca4b2f42019-08-30 15:48:40 -050049 }
50
51 return rc;
52}
53
54#endif
55
56//------------------------------------------------------------------------------
57
58} // end namespace libhei