![]() |
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... | |
Shared Interface definition for I2C Framework
| 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.
| [in] | p_ctrl | Control handle for I2C framework driver context for a device |
| 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.
| [in] | p_ctrl | Control handle for I2C framework driver context for a device |
| 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.
| [in] | p_ctrl | Control handle for I2C framework driver context for a device |
| [in] | timeout | ThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts. |
| 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.
| [out] | p_ctrl | Control handle for I2C framework driver context for a device (Value returns from this function). This value must be cleared by user. |
| [in] | p_cfg | I2C configuration includes I2C bus and low level configuration |
| 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.
| [in] | p_ctrl | Pointer to previously opened I2C SF control structure. |
| [in] | p_dest | Pointer to location to store read data. |
| [in] | bytes | Number of bytes to read. |
| [in] | restart | Indicates whether the restart condition should be issued after reading. |
| [in] | timeout | ThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts. |
| 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.
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.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for I2C driver. |
| [in] | timeout | ThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts. |
| 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.
| [in] | p_ctrl | Control handle for I2C framework driver context for a device |
| ssp_err_t(* sf_i2c_api_t::version) (ssp_version_t *const p_version) |
Get I2C framework version.
| [in] | p_ctrl | Handle for I2C framework control block for a device |
| 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.
| [in] | p_ctrl | Pointer to previously opened I2C control structure. |
| [in] | p_src | Pointer to location to get write data. |
| [in] | bytes | Number of bytes to write. |
| [in] | restart | Indicates whether the restart condition should be issued after writing. |
| [in] | timeout | ThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts. |