![]() |
ISF
2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
|
Data Structures | |
| struct | I2CDeviceInfo |
| Information necessary to communicate with an I2C slave device. More... | |
| struct | sync_object_t |
| Type for an synchronization object. More... | |
| struct | I2CMasterState |
| Internal driver state information. More... | |
Macros | |
| #define | I2C_PEX_WRITE_EVENT_SUCCESS (1) |
| #define | I2C_PEX_WRITE_EVENT_ERROR (I2C_PEX_WRITE_EVENT_SUCCESS << 1) |
| #define | I2C_PEX_READ_EVENT_SUCCESS (I2C_PEX_WRITE_EVENT_ERROR << 1) |
| #define | I2C_PEX_READ_EVENT_ERROR (I2C_PEX_READ_EVENT_SUCCESS << 1) |
Typedefs | |
| typedef struct I2CDeviceInfo | i2c_device_t |
| Information necessary to communicate with an I2C slave device. More... | |
| typedef enum I2CDirection | i2c_direction_t |
| Constants for the direction of an I2C transfer. More... | |
| typedef struct I2CMasterState | i2c_master_t |
| Internal driver state information. More... | |
Enumerations | |
| enum | I2CDirection { kI2CRead = 1, kI2CWrite = 0 } |
| Constants for the direction of an I2C transfer. More... | |
| enum | _i2c_transfer_flags { kI2CNoStart = 1 << 1, kI2CNoStop = 1 << 2 } |
| Optional flags to control a transfer. More... | |
Functions | |
| void | i2c_master_init (uint32_t instance, i2c_master_t *master) |
| Initialize the I2C master mode driver. More... | |
| void | i2c_master_shutdown (i2c_master_t *master) |
| Shut down the driver. More... | |
| i2c_status_t | i2c_master_configure_bus (i2c_master_t *master, const i2c_device_t *device) |
| Configure the I2C bus to access a device. More... | |
| i2c_status_t | i2c_master_transfer (i2c_master_t *master, const i2c_device_t *device, i2c_direction_t direction, bool stopAfterTransfer, uint32_t subaddress, size_t subaddressLength, uint8_t *data, size_t dataLength, size_t *actualLengthTransferred, uint32_t timeout_ms) |
| Perform a blocking read or write transaction on the I2C bus. More... | |
| #define I2C_PEX_READ_EVENT_ERROR (I2C_PEX_READ_EVENT_SUCCESS << 1) |
Definition at line 78 of file fsl_i2c_master_driver.h.
| #define I2C_PEX_READ_EVENT_SUCCESS (I2C_PEX_WRITE_EVENT_ERROR << 1) |
Definition at line 77 of file fsl_i2c_master_driver.h.
Referenced by I2CBUS1_OnMasterBlockReceived().
| #define I2C_PEX_WRITE_EVENT_ERROR (I2C_PEX_WRITE_EVENT_SUCCESS << 1) |
Definition at line 76 of file fsl_i2c_master_driver.h.
| #define I2C_PEX_WRITE_EVENT_SUCCESS (1) |
Definition at line 75 of file fsl_i2c_master_driver.h.
Referenced by I2CBUS1_OnMasterBlockSent().
| typedef struct I2CDeviceInfo i2c_device_t |
Information necessary to communicate with an I2C slave device.
| typedef enum I2CDirection i2c_direction_t |
Constants for the direction of an I2C transfer.
| typedef struct I2CMasterState i2c_master_t |
Internal driver state information.
| enum _i2c_transfer_flags |
Optional flags to control a transfer.
| Enumerator | |
|---|---|
| kI2CNoStart |
Set this flag to prevent sending a START signal. |
| kI2CNoStop |
Set this flag to prevent sending a STOP signal. |
Definition at line 45 of file fsl_i2c_master_driver.h.
| enum I2CDirection |
Constants for the direction of an I2C transfer.
| Enumerator | |
|---|---|
| kI2CRead |
Read from slave device. |
| kI2CWrite |
Write to slave device. |
Definition at line 38 of file fsl_i2c_master_driver.h.
| i2c_status_t i2c_master_configure_bus | ( | i2c_master_t * | master, |
| const i2c_device_t * | device | ||
| ) |
Configure the I2C bus to access a device.
| master | The pointer to the I2C master driver state structure. |
| device | The pointer to the I2C device information struct. |
Definition at line 87 of file fsl_i2c_master_driver.c.
References kStatus_I2C_Success.
Referenced by i2c_master_adapter_configure().

| void i2c_master_init | ( | uint32_t | instance, |
| i2c_master_t * | master | ||
| ) |
Initialize the I2C master mode driver.
| instance | The I2C peripheral instance number. |
| master | The pointer to the I2C master driver state structure. |
Definition at line 53 of file fsl_i2c_master_driver.c.
References i2c_instance_PEx::fnI2CLLDInit, gSys_NumI2cBuses, I2CMasterState::i2cEventHandler, I2CMasterState::instance, and I2CMasterState::pDeviceHandle.
Referenced by i2c_master_adapter_init().

| void i2c_master_shutdown | ( | i2c_master_t * | master | ) |
Shut down the driver.
| master | The pointer to the I2C master driver state structure. |
Definition at line 73 of file fsl_i2c_master_driver.c.
References i2c_instance_PEx::fnI2CLLDDeint, gSys_NumI2cBuses, I2CMasterState::instance, and I2CMasterState::pUserData.
| i2c_status_t i2c_master_transfer | ( | i2c_master_t * | master, |
| const i2c_device_t * | device, | ||
| i2c_direction_t | direction, | ||
| bool | stopAfterTransfer, | ||
| uint32_t | subaddress, | ||
| size_t | subaddressLength, | ||
| uint8_t * | data, | ||
| size_t | dataLength, | ||
| size_t * | actualLengthTransferred, | ||
| uint32_t | timeout_ms | ||
| ) |
Perform a blocking read or write transaction on the I2C bus.
| master | The pointer to the I2C master driver state structure. |
| device | The pointer to the I2C device information struct. |
| direction | The direction of an I2C transfer. |
| stopAfterTransfer | Send STOP signal after this transfer or not. |
| subaddress | The subaddress for a device if it has. |
| subaddressLength | The length of the subaddress. |
| data | The pointer to the data to be transfered. |
| dataLength | The length in bytes of the data to be transfered. |
| actualLengthTransferred | The length in bytes of the data thansfered. |
| timeout_ms | A timeout for the transfer in microseconds. |
Definition at line 102 of file fsl_i2c_master_driver.c.
References I2CDeviceInfo::address, I2CDeviceInfo::addrType, i2c_instance_PEx::fnI2CLLDDeviceSelect, gSys_NumI2cBuses, I2CMasterState::instance, kStatus_I2C_Fail, kStatus_I2C_InvalidArgument, and I2CMasterState::pDeviceHandle.
Referenced by i2c_master_adapter_get_endpoint(), i2c_master_adapter_read(), and i2c_master_adapter_write().
