| 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 |  | 
|  | 10 | ReturnCode registerRead( void * i_chip, void * o_buffer, size_t & io_bufSize, | 
|  | 11 | uint64_t i_regType, uint64_t i_address ) | 
|  | 12 | { | 
|  | 13 | ReturnCode rc; | 
|  | 14 |  | 
|  | 15 | HEI_ASSERT( nullptr != i_chip ); | 
|  | 16 | HEI_ASSERT( nullptr != o_buffer ); | 
|  | 17 | HEI_ASSERT( 0 != io_bufSize ); | 
|  | 18 |  | 
|  | 19 | switch ( i_regType ) | 
|  | 20 | { | 
|  | 21 | default: | 
|  | 22 | rc = RC_REG_ACCESS_FAILURE; | 
|  | 23 | HEI_ERR( "registerRead(%p,%p,%lx,%lx,%lx)", i_chip, o_buffer, | 
|  | 24 | io_bufSize, i_regType, i_address ); | 
|  | 25 | } | 
|  | 26 |  | 
|  | 27 | return rc; | 
|  | 28 | } | 
|  | 29 |  | 
|  | 30 | //------------------------------------------------------------------------------ | 
|  | 31 |  | 
|  | 32 | #ifndef __HEI_READ_ONLY | 
|  | 33 |  | 
|  | 34 | ReturnCode registerWrite( void * i_chip, void * i_buffer, size_t & io_bufSize, | 
|  | 35 | uint64_t i_regType, uint64_t i_address ) | 
|  | 36 | { | 
|  | 37 | ReturnCode rc; | 
|  | 38 |  | 
|  | 39 | HEI_ASSERT( nullptr != i_chip ); | 
|  | 40 | HEI_ASSERT( nullptr != i_buffer ); | 
|  | 41 | HEI_ASSERT( 0 != io_bufSize ); | 
|  | 42 |  | 
|  | 43 | switch ( i_regType ) | 
|  | 44 | { | 
|  | 45 | default: | 
|  | 46 | rc = RC_REG_ACCESS_FAILURE; | 
|  | 47 | HEI_ERR( "registerWrite(%p,%p,%lx,%lx,%lx)", i_chip, i_buffer, | 
|  | 48 | io_bufSize, i_regType, i_address ); | 
|  | 49 | } | 
|  | 50 |  | 
|  | 51 | return rc; | 
|  | 52 | } | 
|  | 53 |  | 
|  | 54 | #endif | 
|  | 55 |  | 
|  | 56 | //------------------------------------------------------------------------------ | 
|  | 57 |  | 
|  | 58 | } // end namespace libhei | 
|  | 59 |  |