| Kinetis SDK Demo Applications User Guide 1.0.0-beta Freescale Semiconductor, Inc.

- Main Page
- Related Pages
- Demos

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
i2c_dac_slave.c File Reference
`#include "i2c_dac_slave.h"`

## Functions
static i2c_status_t | data_sink (uint8_t rxData)
| Callback used by slave IRQ handler to put byte it received. More...
static i2c_status_t | data_source (uint8_t *txData)
| Callback used by slave IRQ handler to get byte to transmit. More...
static void | on_error (i2c_status_t error)
| Callback used by slave IRQ handler to report an error condition. More...
int | main (void)

## Variables
uint8_t | i2c0_rxData [RX_DEPTH]
static uint8_t | i2c0_txData [1]
static volatile int | rxIndex
static volatile int | txIndex

## Function Documentation

static i2c_status_t data_sink | ( | uint8_t | rxData | ) |
| static

This callback function is used by the I2C slave IRQ handler to deliver the

byte it received to the application. If there is no room in the buffer, the

callback function will report kStatus_OutOfRange.

Parameters

  [in] | rxData | The byte of data from the driver to store in the applications buffer.

Returns
  kStatus_Success or kStatus_OutOfRange

static i2c_status_t data_source | ( | uint8_t * | txData | ) |
| static

This callback function is used by the I2C slave IRQ handler to supply the

byte it transmitted by the application to the I2C driver. If there are no more

bytes in the buffer, the callback function will report kStatus_OutOfRange.

Parameters

  [out] | *txData | The byte of data from the applications buffer to

return to the driver.

Returns
  kStatus_Success or kStatus_OutOfRange

int main | ( | void |  | ) |

static void on_error | ( | i2c_status_t | error | ) |
| static

This callback function is used by the I2C slave IRQ handler to report an error

condition. If the error is an OutOfRange error, the appropriate buffer index is

reset.

Parameters

  [in] | error | The error reported by the driver.

Returns
  nothing

## Variable Documentation

uint8_t i2c0_rxData[RX_DEPTH]

uint8_t i2c0_txData[1]
| static

volatile int rxIndex
| static

volatile int txIndex
| static