summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorMatt K. Light <mklight@us.ibm.com>2018-07-13 11:17:29 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2018-09-04 10:44:00 -0500
commit9af02ab015acdf9abf73df357d50bee9703a2aad (patch)
tree055ee1e321e8d41f2bb1ccd2ae2104bf327a4f41 /src/import
parent6c30bcf8975825c394a6eb6f687535a9c52c74e8 (diff)
downloadtalos-hostboot-9af02ab015acdf9abf73df357d50bee9703a2aad.tar.gz
talos-hostboot-9af02ab015acdf9abf73df357d50bee9703a2aad.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/65496 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_i2c_access.H25
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 be6d26f15..b02b5a863 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.
OpenPOWER on IntegriCloud