From d2e42029ec04c3f224580f8007cdfbbfe0fc47a6 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Fri, 26 May 2017 18:45:56 +0200 Subject: Initial Commit --- ...___i2_c_ga153f7ce3ea500b2f39544e0ccfc86503.html | 246 +++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 ucs2-lib/doc/html/group___g___u_c_s___i2_c_ga153f7ce3ea500b2f39544e0ccfc86503.html (limited to 'ucs2-lib/doc/html/group___g___u_c_s___i2_c_ga153f7ce3ea500b2f39544e0ccfc86503.html') diff --git a/ucs2-lib/doc/html/group___g___u_c_s___i2_c_ga153f7ce3ea500b2f39544e0ccfc86503.html b/ucs2-lib/doc/html/group___g___u_c_s___i2_c_ga153f7ce3ea500b2f39544e0ccfc86503.html new file mode 100644 index 0000000..b830bb9 --- /dev/null +++ b/ucs2-lib/doc/html/group___g___u_c_s___i2_c_ga153f7ce3ea500b2f39544e0ccfc86503.html @@ -0,0 +1,246 @@ + + + + + +UNICENS: Ucs_I2c_ReadPort + + + + + + + + + + + + + + + +
+
+
+ + + + + + + +
Logo +
UNICENS V2.1.0-3491
+
User Manual and API Reference
+ +
+
+ + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ucs_Return_t Ucs_I2c_ReadPort (Ucs_Inst_tself,
uint16_t destination_address,
uint16_t port_handle,
uint8_t slave_address,
uint8_t data_len,
uint16_t timeout,
Ucs_I2c_ReadPortResCb_t result_fptr 
)
+
+ +

Reads a block of bytes from an I2C device at a specified I2C address.

+ + + +
 This function corresponds with the INIC function INIC.I2CPortRead.
+
Parameters
+ + + + + + + + +
selfThe UNICENS instance pointer
destination_addressAddress of the target device. Use the UCS_ADDR_LOCAL_DEV macro to target the local device.
+ The following address ranges are supported:
    +
  • [0x10 ... 0x2FF]
  • +
  • [0x500 ... 0xFEF]
  • +
  • UCS_ADDR_LOCAL_DEV
  • +
+
port_handlePort resource handle. + + +
 I2CPortHandle
+
slave_addressThe 7-bit I2C slave address of the peripheral to be read. + + +
 SlaveAddress
+
data_lenNumber of bytes to be read from the address. + + +
 Length
+
timeoutThe timeout for the I2C Port read. + + +
 Timeout
+
result_fptrRequired result callback function pointer.
+
+
+
Returns
Possible return values are shown in the table below. + + + + + + + + + + + + +
Value Description
UCS_RET_SUCCESS No error
UCS_RET_ERR_PARAM At least one parameter is wrong
UCS_RET_ERR_BUFFER_OVERFLOW No message buffer available
UCS_RET_ERR_API_LOCKED API is currently locked
UCS_RET_ERR_NOT_INITIALIZED UNICENS is not initialized
+
+


+ Example

+
// Main function
+
void main()
+
{
+
Ucs_Return_t result = Ucs_I2c_ReadPort(0x14U, 0x0F00U, 0x20U, 5U, 0x0FU, &App_I2cReadPortResCb);
+
if (result != UCS_RET_SUCCESS)
+
{
+
// Error handling here
+
}
+
}
+
+
// The event handler function
+
// Handle I2cReadPort event
+
static void App_I2cReadPortResCb(uint16_t device_id, uint16_t port_handle, uint8_t slave_address, uint8_t data_len, uint8_t data_ptr[], Ucs_I2c_Result_t result, void * user_ptr)
+
{
+
if (result.code == UCS_I2C_RES_SUCCESS)
+
{
+
// Do what needs to be..
+
}
+
else
+
{
+
// Error handling here
+
}
+
}
+
+
+
+
+
+ + + + + + -- cgit 1.2.3-korg