Synergy Software Package User's Manual

#include <sf_i2c_api.h>

Data Fields

ssp_err_t(* open )(sf_i2c_ctrl_t *p_ctrl, sf_i2c_cfg_t const *const p_cfg)
 Open a designated I2C device on a bus. More...
 
ssp_err_t(* read )(sf_i2c_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes, bool const restart, uint32_t const timeout)
 Receive data from I2C device. More...
 
ssp_err_t(* write )(sf_i2c_ctrl_t *const p_ctrl, uint8_t *const p_src, uint32_t const bytes, bool const restart, uint32_t const timeout)
 Transmit data to I2C device. More...
 
ssp_err_t(* reset )(sf_i2c_ctrl_t *const p_ctrl, uint32_t const timeout)
 Abort any in-progress transfer and force the I2C peripheral into a ready state. More...
 
ssp_err_t(* close )(sf_i2c_ctrl_t *const p_ctrl)
 Disable the I2C device designated by the control handle. Close the RTOS services used by the bus if no devices are connected to the bus. More...
 
ssp_err_t(* lock )(sf_i2c_ctrl_t *const p_ctrl)
 Lock the bus for a device. Locking allows devices to reserve a bus to themselves for a given period of time (i.e. between lock and unlock). This allows devices to complete several reads and writes on the bus without interrupt, which is required in some instances. More...
 
ssp_err_t(* unlock )(sf_i2c_ctrl_t *const p_ctrl)
 Unlock the bus from a particular device and make it available for other devices. This allows other devices to use bus for reads and writes on the bus. More...
 
ssp_err_t(* version )(ssp_version_t *const p_version)
 Get I2C framework version. More...
 
ssp_err_t(* lockWait )(sf_i2c_ctrl_t *const p_ctrl, uint32_t const timeout)
 Lock the I2C bus for a device. Locking reserves exclusive access to the I2C driver. Here a wait option is provided to the user. This allows devices to complete several reads and writes on the bus without interrupt, which is required in some instances. More...
 

Detailed Description

Shared Interface definition for I2C Framework

Field Documentation

◆ close

ssp_err_t(* sf_i2c_api_t::close) (sf_i2c_ctrl_t *const p_ctrl)

Disable the I2C device designated by the control handle. Close the RTOS services used by the bus if no devices are connected to the bus.

Implemented as
Parameters
[in]p_ctrlControl handle for I2C framework driver context for a device

◆ lock

ssp_err_t(* sf_i2c_api_t::lock) (sf_i2c_ctrl_t *const p_ctrl)

Lock the bus for a device. Locking allows devices to reserve a bus to themselves for a given period of time (i.e. between lock and unlock). This allows devices to complete several reads and writes on the bus without interrupt, which is required in some instances.

Implemented as
Parameters
[in]p_ctrlControl handle for I2C framework driver context for a device

◆ lockWait

ssp_err_t(* sf_i2c_api_t::lockWait) (sf_i2c_ctrl_t *const p_ctrl, uint32_t const timeout)

Lock the I2C bus for a device. Locking reserves exclusive access to the I2C driver. Here a wait option is provided to the user. This allows devices to complete several reads and writes on the bus without interrupt, which is required in some instances.

Implemented as
Parameters
[in]p_ctrlControl handle for I2C framework driver context for a device
[in]timeoutThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts.

◆ open

ssp_err_t(* sf_i2c_api_t::open) (sf_i2c_ctrl_t *p_ctrl, sf_i2c_cfg_t const *const p_cfg)

Open a designated I2C device on a bus.

Implemented as
Parameters
[out]p_ctrlControl handle for I2C framework driver context for a device (Value returns from this function). This value must be cleared by user.
[in]p_cfgI2C configuration includes I2C bus and low level configuration

◆ read

ssp_err_t(* sf_i2c_api_t::read) (sf_i2c_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes, bool const restart, uint32_t const timeout)

Receive data from I2C device.

Implemented as
Parameters
[in]p_ctrlPointer to previously opened I2C SF control structure.
[in]p_destPointer to location to store read data.
[in]bytesNumber of bytes to read.
[in]restartIndicates whether the restart condition should be issued after reading.
[in]timeoutThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts.

◆ reset

ssp_err_t(* sf_i2c_api_t::reset) (sf_i2c_ctrl_t *const p_ctrl, uint32_t const timeout)

Abort any in-progress transfer and force the I2C peripheral into a ready state.

Implemented as

This function safely terminates any in-progress I2C transfer with the device. If a transfer is aborted, the user is be notified via callback with an abort event. Since the callback is optional, this function also returns a specific error code in this situation.

Parameters
[in]p_ctrlPointer to device control block initialized in Open call for I2C driver.
[in]timeoutThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts.

◆ unlock

ssp_err_t(* sf_i2c_api_t::unlock) (sf_i2c_ctrl_t *const p_ctrl)

Unlock the bus from a particular device and make it available for other devices. This allows other devices to use bus for reads and writes on the bus.

Implemented as
Parameters
[in]p_ctrlControl handle for I2C framework driver context for a device

◆ version

ssp_err_t(* sf_i2c_api_t::version) (ssp_version_t *const p_version)

Get I2C framework version.

Implemented as
Parameters
[in]p_ctrlHandle for I2C framework control block for a device

◆ write

ssp_err_t(* sf_i2c_api_t::write) (sf_i2c_ctrl_t *const p_ctrl, uint8_t *const p_src, uint32_t const bytes, bool const restart, uint32_t const timeout)

Transmit data to I2C device.

Implemented as
Parameters
[in]p_ctrlPointer to previously opened I2C control structure.
[in]p_srcPointer to location to get write data.
[in]bytesNumber of bytes to write.
[in]restartIndicates whether the restart condition should be issued after writing.
[in]timeoutThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts.

The documentation for this struct was generated from the following file: