| 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
Macros | Functions
i2c_sim.h File Reference
`#include "board.h"`

Go to the source code of this file.

## Macros
#define | GPIO_SCL
#define | GPIO_SDA

## Functions
void | i2c_gpio_init (int32_t speed, int32_t slaveaddr)
| Initialization. More...
uint8_t | i2c_gpio_probe (uint8_t addr)
| Probe to see if a chip is present. Probe to see if a chip is present. Also good for checking for the completion of EEPROM writes since the chip stops responding until the write completes (typically 10mSec). More...
uint8_t | i2c_gpio_read (uint8_t chip, uint32_t addr, int32_t alen, uint8_t *buffer, int32_t len)
| Read bytes. More...
uint8_t | i2c_gpio_write (uint8_t chip, uint32_t addr, int32_t alen, uint8_t *buffer, int32_t len)
| Write bytes. More...

## Macro Definition Documentation

#define GPIO_SCL

GPIO SCL

#define GPIO_SDA

GPIO SDA

## Function Documentation

void i2c_gpio_init | ( | int32_t | speed,
|  | int32_t | slaveaddr
| ) |  |

Parameters

  [in] | speed | I2C speed.
  [in] | slaveaddr | Slave device address.

uint8_t i2c_gpio_probe | ( | uint8_t | addr | ) |

Parameters

  [in] | addr | I2C slave device address.

Returns
  Probe successful or failed.

uint8_t i2c_gpio_read | ( | uint8_t | chip,
|  | uint32_t | addr,
|  | int32_t | alen,
|  | uint8_t * | buffer,
|  | int32_t | len
| ) |  |

This function will read data from i2c slave device.

Parameters

  [in] | chip | Chip number.
  [in] | addr | Address in I2C slave device.
  [in] | alen | Address len.
  [in] | buffer | Buffer address that will be read to.
  [in] | len | Len of data that will be read.

Returns
  Read successful or not.

uint8_t i2c_gpio_write | ( | uint8_t | chip,
|  | uint32_t | addr,
|  | int32_t | alen,
|  | uint8_t * | buffer,
|  | int32_t | len
| ) |  |

This function will write data to i2c slave device.

Parameters

  [in] | chip | Chip address.
  [in] | addr | Address in I2C slave device.
  [in] | alen | Address len.
  [in] | buffer | Buffer address that will be write.
  [in] | len | Len of data that will be write.

Returns
  Write failed times.