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