Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 1 | #include <hei_includes.hpp> |
Zane Shelley | ca9f625 | 2019-10-25 21:17:30 -0500 | [diff] [blame^] | 2 | #include <hei_user_interface.hpp> |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 3 | |
| 4 | namespace libhei |
| 5 | { |
| 6 | |
| 7 | //------------------------------------------------------------------------------ |
| 8 | |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 9 | ReturnCode registerRead(void * i_chip, void * o_buffer, size_t & io_bufSize, |
| 10 | uint64_t i_regType, uint64_t i_address) |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 11 | { |
| 12 | ReturnCode rc; |
| 13 | |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 14 | HEI_ASSERT(nullptr != i_chip); |
| 15 | HEI_ASSERT(nullptr != o_buffer); |
| 16 | HEI_ASSERT(0 != io_bufSize); |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 17 | |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 18 | switch (i_regType) |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 19 | { |
| 20 | default: |
| 21 | rc = RC_REG_ACCESS_FAILURE; |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 22 | HEI_ERR("registerRead(%p,%p,%lx,%lx,%lx)", i_chip, o_buffer, |
| 23 | io_bufSize, i_regType, i_address); |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | return rc; |
| 27 | } |
| 28 | |
| 29 | //------------------------------------------------------------------------------ |
| 30 | |
| 31 | #ifndef __HEI_READ_ONLY |
| 32 | |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 33 | ReturnCode registerWrite(void * i_chip, void * i_buffer, size_t & io_bufSize, |
| 34 | uint64_t i_regType, uint64_t i_address) |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 35 | { |
| 36 | ReturnCode rc; |
| 37 | |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 38 | HEI_ASSERT(nullptr != i_chip); |
| 39 | HEI_ASSERT(nullptr != i_buffer); |
| 40 | HEI_ASSERT(0 != io_bufSize); |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 41 | |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 42 | switch (i_regType) |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 43 | { |
| 44 | default: |
| 45 | rc = RC_REG_ACCESS_FAILURE; |
Zane Shelley | 83da245 | 2019-10-25 15:45:34 -0500 | [diff] [blame] | 46 | HEI_ERR("registerWrite(%p,%p,%lx,%lx,%lx)", i_chip, i_buffer, |
| 47 | io_bufSize, i_regType, i_address); |
Zane Shelley | ca4b2f4 | 2019-08-30 15:48:40 -0500 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | return rc; |
| 51 | } |
| 52 | |
| 53 | #endif |
| 54 | |
| 55 | //------------------------------------------------------------------------------ |
| 56 | |
| 57 | } // end namespace libhei |