i2cm_comboWrite vs. cfa_bsc_OpExtended

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

cross mob
StSm_298421
Level 3
Level 3
10 replies posted 5 replies posted 10 questions asked

In SDK 2.0.1, the i2c_temperature_sensor sample using cfa_bsc_OpExtended within its temperature_sensor_write_16_bit_register function.

1. if I right-click the function call cfa_bsc_OpExtended and select "Declarations", I don't find any. By searching these forums I found that this is declared in cfa/cfa.h.

2. in the API documentation, "cfa" isn't mentioned, but I2C is. And there's a i2cm_comboWrite function which would appear to do thse same thing as cfa_bsc_OpExtended.

Is cfa_bsc_OpExtended older API, and the sample hasn't been updated?

Is i2cm_comboWrite to be preferred?

Are there situations where one has to use cfa_bsc_whatever?

Why doesn't a search for "Declarations" on cfa_bsc_OpExtended turn up any results?

thanks.

0 Likes
1 Solution
Anonymous
Not applicable

Hello Stuart,

We just released our latest SDK 2.1.0: WICED Smart Documents & Downloads

Let us know if you find these same issues and I will let the Developers

Thanks

JT

View solution in original post

4 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

The WICED SMART HW Interfaces Guide here: WICED™ Smart Hardware Interfaces

States that the description of the I2C API is available in WICED-Smart-SDK/Wiced-Smart/cfa/cfa.h

//------------------------------------------------------------------------------
// 10.9.2       Interface Functions
//------------------------------------------------------------------------------

void cfa_bsc_Configure(UINT8 newConfig);
// To configure the I2C serial interface. The configuration values include:
//          - Clock Rate
//          - Clock divider
//          - Delay disable
//          - Deglitch disable


CFA_BSC_STATUS cfa_bsc_OpExtended(UINT8* buf,
                         UINT16 bufCount,
                         UINT8* addr,
                         UINT8 addrCount,
                         UINT8 slaveAdr,
                         UINT8 operation);
//      This function performs blocking read/writes, both addressed and unaddressed
//      The amount of data read/written can exceed 8. The address is assumed to be in
//      big endian format.
//  Input:
//      - Pointer to data buffer. For reads, this is where data will be read into
//        For writes, data will be written from here.
//      - Number of bytes to read/write from the buffer.
//      - Pointer to address. Only valid if address count is non-zero; if address count is
//        zero, it must be set to 0. This is the address that is sent to the device
//        before the operation. In the case of a read, the address is written followed
//        by a read. For a write, the address is written, followed by the data.
//        The address is assumed to be in big endian format. This is pertinent only
//        if the operation requires multiple hardware operations to complete; otherwise
//        it is of no significance. The maximum number of bytes that can be read
//        in a single hardware transaction is 8 and the maximum that can be written
//        is 8 - address size. Note that the address will be modified
//      - Number of address bytes. If this is zero, no address is written before the
//        operation. If non-zero, the address is written before the read/write. In
//        case of a write, the size of the address plus the size of the data must be <= 8
//      - Slave address
//      - Operation (read/write)
#endif

0 Likes
Anonymous
Not applicable

Hello Stuart

Does this answer your question?

Thanks

JT

0 Likes

JT,

thanks for the pointer to the documentation for cfa_bsc_OpExtended. Perhaps my statement

in the API documentation, "cfa" isn't mentioned


was confusing. The "API documentation" I was referring to there was the HTML documentation at Components/Peripheral Drivers/I2C, which documents routines i2cm_*, which nobody appears to use, and don't seem to work.

But no, it really doesn't answer the four questions I posed.

0 Likes
Anonymous
Not applicable

Hello Stuart,

We just released our latest SDK 2.1.0: WICED Smart Documents &amp; Downloads

Let us know if you find these same issues and I will let the Developers

Thanks

JT