TI-RTOS Drivers  tidrivers_tivac_2_16_00_08
Data Structures | Macros | Typedefs | Enumerations | Variables
I2CTiva.h File Reference

Detailed Description

I2C driver implementation for a Tiva I2C controller.

============================================================================

The I2C header file should be included in an application as follows:

Refer to I2C.h for a complete description of APIs & example of use.


#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/I2C.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/family/arm/m3/Hwi.h>
Include dependency graph for I2CTiva.h:

Go to the source code of this file.

Data Structures

struct  I2CTiva_HWAttrs
 I2CTiva Hardware attributes. More...
 
struct  I2CTiva_Object
 I2CTiva Object. More...
 

Macros

#define ti_sysbios_family_arm_m3_Hwi__nolocalnames
 

Typedefs

typedef enum I2CTiva_Mode I2CTiva_Mode
 I2CTiva mode. More...
 
typedef struct I2CTiva_HWAttrs I2CTiva_HWAttrs
 I2CTiva Hardware attributes. More...
 
typedef struct I2CTiva_Object I2CTiva_Object
 I2CTiva Object. More...
 

Enumerations

enum  I2CTiva_Mode {
  I2CTiva_IDLE_MODE = 0,
  I2CTiva_WRITE_MODE,
  I2CTiva_READ_MODE,
  I2CTiva_ERROR = 0xFF
}
 I2CTiva mode. More...
 

Variables

const I2C_FxnTable I2CTiva_fxnTable
 

Macro Definition Documentation

#define ti_sysbios_family_arm_m3_Hwi__nolocalnames

Typedef Documentation

typedef enum I2CTiva_Mode I2CTiva_Mode

I2CTiva mode.

This enum defines the state of the I2C driver's state-machine. Do not modify.

I2CTiva Hardware attributes.

The baseAddr and intNum fields are used by driverlib APIs and therefore must be populated by driverlib macro definitions. For TivaWare these definitions are found in:

  • inc/hw_memmap.h
  • inc/hw_ints.h

intPriority is the I2C peripheral's interrupt priority, as defined by the underlying OS. It is passed unmodified to the underlying OS's interrupt handler creation code, so you need to refer to the OS documentation for usage. For example, for SYS/BIOS applications, refer to the ti.sysbios.family.arm.m3.Hwi documentation for SYS/BIOS usage of interrupt priorities. If the driver uses the ti.drivers.ports interface instead of making OS calls directly, then the HwiP port handles the interrupt priority in an OS specific way. In the case of the SYS/BIOS port, intPriority is passed unmodified to Hwi_create().

A sample structure is shown below:

1 const I2CTiva_HWAttrs i2cTivaHWAttrs[] = {
2  {
3  .baseAddr = I2C1_BASE,
4  .intNum = INT_I2C1,
5  .intPriority = (~0)
6  },
7  {
8  .baseAddr = I2C3_BASE,
9  .intNum = INT_I2C3,
10  .intPriority = (~0)
11  },
12 };

I2CTiva Object.

The application must not access any member variables of this structure!

Enumeration Type Documentation

I2CTiva mode.

This enum defines the state of the I2C driver's state-machine. Do not modify.

Enumerator
I2CTiva_IDLE_MODE 
I2CTiva_WRITE_MODE 
I2CTiva_READ_MODE 
I2CTiva_ERROR 

Variable Documentation

const I2C_FxnTable I2CTiva_fxnTable
Copyright 2016, Texas Instruments Incorporated