EZI2C write index byte for SCB_EzI2CSetBuffer1 API

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

When writing to EZI2C SCB_EzI2CSetBuffer1 API from Bridge Panel Control, there is an IndexByte after the slave address.

pastedImage_0.png

Is it possible to know the value of this IndexByte in the user program(main.c)?

We want to know the first value of locByte or locIndex in EZI2C_EZI2C_INT.c from main.c.

pastedImage_1.png

Best regards,

Yocchi

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Yocchi,

You can make use of the EZI2C_EZI2C_GET_OFFSET macro. In the component code the EZI2C_EZI2C_GET_OFFSET is defined as equal to EZI2C_offsetBuf1 which is  Current offset within EZI2C buffer.

In case you want to know the Current index within the EZI2C buffer use the EZI2C_indexBuf1 variable.

The difference of EZI2C_indexBuf1 and EZI2C_offsetBuf1 will give you the number of bytes transferred in a particular transfer.

Best Regards

Ekta

View solution in original post

0 Likes
2 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Yocchi,

You can make use of the EZI2C_EZI2C_GET_OFFSET macro. In the component code the EZI2C_EZI2C_GET_OFFSET is defined as equal to EZI2C_offsetBuf1 which is  Current offset within EZI2C buffer.

In case you want to know the Current index within the EZI2C buffer use the EZI2C_indexBuf1 variable.

The difference of EZI2C_indexBuf1 and EZI2C_offsetBuf1 will give you the number of bytes transferred in a particular transfer.

Best Regards

Ekta

0 Likes

Hello Ekta-san,

Thank you very much for your good help.

I understood the offset position where I started writing and the pointer position after writing.

[offset position]

#define EZI2C_EZI2C_GET_OFFSET(activeAddress) ((uint32) (EZI2C_offsetBuf1))

[pointer position]

#define EZI2C_EZI2C_GET_INDEX(activeAddress)  ((uint32) (EZI2C_indexBuf1))

Best regards,

Yocchi

0 Likes