diff options
author | Matt K. Light <mklight@us.ibm.com> | 2018-07-13 11:17:29 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2018-12-17 21:17:22 -0600 |
commit | de6a45dcdabee5bdab79324b8e592c8bfeba7fc6 (patch) | |
tree | 5398b2da14431828c966abcabe9c7a439d57b2c6 /src/import/hwpf | |
parent | bfc895ae5d9e9d8dc168773666efbb85fa4c6000 (diff) | |
download | talos-sbe-de6a45dcdabee5bdab79324b8e592c8bfeba7fc6.tar.gz talos-sbe-de6a45dcdabee5bdab79324b8e592c8bfeba7fc6.zip |
fapi2 i2c dox update
Change-Id: I9383a13e9a6b19dd30a423877c11c6aed95da5f4
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/62411
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69601
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/hwpf')
-rw-r--r-- | src/import/hwpf/fapi2/include/fapi2_i2c_access.H | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/import/hwpf/fapi2/include/fapi2_i2c_access.H b/src/import/hwpf/fapi2/include/fapi2_i2c_access.H index 4b88d75d..1dfeee7a 100644 --- a/src/import/hwpf/fapi2/include/fapi2_i2c_access.H +++ b/src/import/hwpf/fapi2/include/fapi2_i2c_access.H @@ -41,6 +41,22 @@ namespace fapi2 { /// @brief Reads data via i2c from the target +/// +/// Example use (seeprom read 8 bytes w/ 2-byte address: 0x01B0): +/// std::vector<uint8_t> addr = {0x01, 0xB0}; +/// std::vector<uint8_t> data; +/// size_t len = 8; +/// FAPI_TRY(getI2c(target, len, addr, data)); +/// data should contain the 8 bytes starting at address 0x01B0 +/// +/// Example use (smbus read 5 bytes w/ 1-byte command: 0x02): +/// std::vector<uint8_t> command = {0x02}; +/// std::vector<uint8_t> data; +/// size_t len = 5; +/// FAPI_TRY(getI2c(target, len, command, data)); +/// data should contain 5 bytes, first byte with the data length(4) +/// remaining four bytes will be the data requested from the command +/// /// @tparam K the type (Kind) of target, from i_target /// @tparam V the type of the target's Value, from i_target /// @param[in] i_target HW target to operate on. @@ -57,6 +73,15 @@ inline ReturnCode getI2c(const Target<K, V>& i_target, std::vector<uint8_t>& o_data); /// @brief Writes data via i2c to the target. +/// +/// Example use (seeprom write 4 bytes of zeros w/ 2-byte address: 0x0208): +/// std::vector<uint8_t> addr_data = {0x02, 0x08, 0x00, 0x00, 0x00, 0x00}; +/// FAPI_TRY(getI2c(target, addr_data)); +/// +/// Example use (smbus write 1 data length byte + 4 bytes of zeros w/ 1-byte command: 0x01): +/// std::vector<uint8_t> command_data = {0x01, 0x04, 0x00, 0x00, 0x00, 0x00}; +/// FAPI_TRY(getI2c(target, command_data)); +/// /// @tparam K the type (Kind) of target, from i_target /// @tparam V the type of the target's Value, from i_target /// @param[in] i_target HW target to operate on. |