Skip to content

Commit

Permalink
fapi2 i2c dox update
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mklight authored and sgupta2m committed Dec 18, 2018
1 parent bfc895a commit de6a45d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/import/hwpf/fapi2/include/fapi2_i2c_access.H
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit de6a45d

Please sign in to comment.