| Kinetis SDK v.2.0 API Reference Manual Rev. 0 Freescale Semiconductor, Inc.

- Main Page
- Related Pages
- API Reference

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Files | Data Structures | Typedefs
I2C eDMA Driver
I2C: Inter-Integrated Circuit Driver

## Overview

## Files
file | fsl_i2c_edma.h

## Data Structures
struct | i2c_master_edma_handle_t
| I2C master edma transfer structure. More...

## Typedefs
typedef void(* | i2c_master_edma_transfer_callback_t )(I2C_Type *base, i2c_master_edma_handle_t *handle, status_t status, void *userData)
| I2C master edma transfer callback typedef. More...

## I2C Block EDMA Transfer Operation
void | I2C_MasterCreateEDMAHandle (I2C_Type *base, i2c_master_edma_handle_t *handle, i2c_master_edma_transfer_callback_t callback, void *userData, edma_handle_t *edmaHandle)
| Init the I2C handle which is used in transcational functions. More...
status_t | I2C_MasterTransferEDMA (I2C_Type *base, i2c_master_edma_handle_t *handle, i2c_master_transfer_t *xfer)
| Performs a master edma non-blocking transfer on the I2C bus. More...
status_t | I2C_MasterTransferGetCountEDMA (I2C_Type *base, i2c_master_edma_handle_t *handle, size_t *count)
| Get master transfer status during a edma non-blocking transfer. More...
void | I2C_MasterTransferAbortEDMA (I2C_Type *base, i2c_master_edma_handle_t *handle)
| Abort a master edma non-blocking transfer in a early time. More...

## Data Structure Documentation

struct _i2c_master_edma_handle

I2C master edma handle typedef.

### Data Fields
i2c_master_transfer_t | transfer
| I2C master transfer struct. More...
size_t | transferSize
| Total bytes to be transferred. More...
uint8_t | state
| I2C master transfer status. More...
edma_handle_t * | dmaHandle
| The eDMA handler used. More...
i2c_master_edma_transfer_callback_t | completionCallback
| Callback function called after edma transfer finished. More...
void * | userData
| Callback parameter passed to callback function. More...

#### Field Documentation

i2c_master_transfer_t i2c_master_edma_handle_t::transfer

size_t i2c_master_edma_handle_t::transferSize

uint8_t i2c_master_edma_handle_t::state

edma_handle_t* i2c_master_edma_handle_t::dmaHandle

i2c_master_edma_transfer_callback_t i2c_master_edma_handle_t::completionCallback

void* i2c_master_edma_handle_t::userData

## Typedef Documentation

typedef void(* i2c_master_edma_transfer_callback_t)(I2C_Type *base, i2c_master_edma_handle_t *handle, status_t status, void *userData)

## Function Documentation

void I2C_MasterCreateEDMAHandle | ( | I2C_Type * | base,
|  | i2c_master_edma_handle_t * | handle,
|  | i2c_master_edma_transfer_callback_t | callback,
|  | void * | userData,
|  | edma_handle_t * | edmaHandle
| ) |  |

Parameters

  base | I2C peripheral base address.
  handle | pointer to i2c_master_edma_handle_t structure.
  callback | pointer to user callback function.
  userData | user param passed to the callback function.
  edmaHandle | EDMA handle pointer.

status_t I2C_MasterTransferEDMA | ( | I2C_Type * | base,
|  | i2c_master_edma_handle_t * | handle,
|  | i2c_master_transfer_t * | xfer
| ) |  |

Parameters

  base | I2C peripheral base address.
  handle | pointer to i2c_master_edma_handle_t structure.
  xfer | pointer to transfer structure of i2c_master_transfer_t.

Return values

  kStatus_Success | Sucessully complete the data transmission.
  kStatus_I2C_Busy | Previous transmission still not finished.
  kStatus_I2C_Timeout | Transfer error, wait signal timeout.
  kStatus_I2C_ArbitrationLost | Transfer error, arbitration lost.
  kStataus_I2C_Nak | Transfer error, receive Nak during transfer.

status_t I2C_MasterTransferGetCountEDMA | ( | I2C_Type * | base,
|  | i2c_master_edma_handle_t * | handle,
|  | size_t * | count
| ) |  |

Parameters

  base | I2C peripheral base address.
  handle | pointer to i2c_master_edma_handle_t structure.
  count | Number of bytes transferred so far by the non-blocking transaction.

void I2C_MasterTransferAbortEDMA | ( | I2C_Type * | base,
|  | i2c_master_edma_handle_t * | handle
| ) |  |

Parameters

  base | I2C peripheral base address.
  handle | pointer to i2c_master_edma_handle_t structure.