MSPM0G1X0X_G3X0X TI-Driver Library  2.01.00.03
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
I2C.h File Reference

Detailed Description

I2C Driver.


This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  I2C_Transaction
 Defines a transaction to be used with I2C_transfer() or I2C_transferTimeout(). More...
 
struct  I2C_Params
 I2C parameters used with I2C_open(). More...
 
struct  I2C_Config_
 I2C driver's configuration structure. More...
 

Macros

#define I2C_STATUS_QUEUED   (1)
 I2C transaction is queued but has not started.
 
#define I2C_STATUS_SUCCESS   (0)
 Successful status code returned by I2C API.
 
#define I2C_STATUS_ERROR   (-1)
 Generic error status code returned by I2C API.
 
#define I2C_STATUS_UNDEFINEDCMD   (-2)
 An error status code returned by I2C_control() for undefined command codes.
 
#define I2C_STATUS_TIMEOUT   (-3)
 I2C operation timed-out.
 
#define I2C_STATUS_CLOCK_TIMEOUT   (-4)
 I2C serial clock line timeout.
 
#define I2C_STATUS_ADDR_NACK   (-5)
 I2C target address not acknowledged.
 
#define I2C_STATUS_DATA_NACK   (-6)
 I2C data byte not acknowledged.
 
#define I2C_STATUS_ARB_LOST   (-7)
 I2C multi-controller arbitration lost.
 
#define I2C_STATUS_INCOMPLETE   (-8)
 I2C transaction is in progress or returned without completing.
 
#define I2C_STATUS_BUS_BUSY   (-9)
 I2C bus already in use by another controller. The I2C transaction. was therefore unable to start.
 
#define I2C_STATUS_CANCEL   (-10)
 I2C transaction canceled by I2C_cancel().
 
#define I2C_STATUS_INVALID_TRANS   (-11)
 I2C transaction is invalid. More...
 
#define I2C_WAIT_FOREVER   (~(0U))
 Wait forever define used to specify timeouts.
 

Typedefs

typedef struct I2C_Config_I2C_Handle
 A handle that is returned from an I2C_open() call.
 
typedef void(* I2C_CallbackFxn) (I2C_Handle handle, I2C_Transaction *transaction, bool transferStatus)
 The definition of a callback function. More...
 
typedef struct I2C_Config_ I2C_Config
 I2C driver's configuration structure. More...
 

Enumerations

enum  I2C_TransferMode {
  I2C_MODE_BLOCKING,
  I2C_MODE_CALLBACK
}
 Return behavior of I2C_Transfer() specified in the I2C_Params. More...
 
enum  I2C_BitRate {
  I2C_100kHz = 0,
  I2C_400kHz = 1,
  I2C_1000kHz = 2
}
 Bit rate for an I2C driver instance specified in the I2C_Params. More...
 

Functions

void I2C_cancel (I2C_Handle handle)
 Cancels all I2C transfers. More...
 
void I2C_close (I2C_Handle handle)
 Function to close an I2C driver instance. More...
 
int_fast16_t I2C_control (I2C_Handle handle, uint_fast16_t cmd, void *controlArg)
 Function performs implementation specific features on a driver instance. More...
 
void I2C_init (void)
 Function to initialize the I2C driver. More...
 
I2C_Handle I2C_open (uint_least8_t index, I2C_Params *params)
 Open an I2C driver instance. More...
 
void I2C_Params_init (I2C_Params *params)
 Initialize an I2C_Params structure to its default values. More...
 
int_fast16_t I2C_setClockTimeout (I2C_Handle handle, uint32_t timeout)
 Set the I2C SCL clock timeout. More...
 
bool I2C_transfer (I2C_Handle handle, I2C_Transaction *transaction)
 Perform an I2C transaction with an I2C target peripheral. More...
 
int_fast16_t I2C_transferTimeout (I2C_Handle handle, I2C_Transaction *transaction, uint32_t timeout)
 Perform an I2C transaction with an I2C target peripheral. More...
 

Variables

const I2C_Config I2C_config []
 Instance of I2C driver's configuration structure.
 
const uint_least8_t I2C_count
 Count of I2C instance.
 
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale