mbed libraries for KL25Z

Dependents:   FRDM_RGBLED

Committer:
emilmont
Date:
Fri Nov 09 11:33:53 2012 +0000
Revision:
8:c14af7958ef5
Child:
9:663789d7729f
SPI driver; ADC driver; DAC driver; microlib support; general bugfixing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 8:c14af7958ef5 1 /* mbed Microcontroller Library - i2c_api
emilmont 8:c14af7958ef5 2 * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
emilmont 8:c14af7958ef5 3 */
emilmont 8:c14af7958ef5 4 #ifndef MBED_I2C_API_H
emilmont 8:c14af7958ef5 5 #define MBED_I2C_API_H
emilmont 8:c14af7958ef5 6
emilmont 8:c14af7958ef5 7 #include "device.h"
emilmont 8:c14af7958ef5 8
emilmont 8:c14af7958ef5 9 #if DEVICE_I2C
emilmont 8:c14af7958ef5 10
emilmont 8:c14af7958ef5 11 #ifdef __cplusplus
emilmont 8:c14af7958ef5 12 extern "C" {
emilmont 8:c14af7958ef5 13 #endif
emilmont 8:c14af7958ef5 14
emilmont 8:c14af7958ef5 15 I2CName i2c_init(PinName sda, PinName scl);
emilmont 8:c14af7958ef5 16
emilmont 8:c14af7958ef5 17 void i2c_frequency (I2CName i2c, int hz);
emilmont 8:c14af7958ef5 18 int i2c_start (I2CName i2c);
emilmont 8:c14af7958ef5 19 void i2c_stop (I2CName i2c);
emilmont 8:c14af7958ef5 20 int i2c_read (I2CName i2c, int address, char *data, int length, int stop);
emilmont 8:c14af7958ef5 21 int i2c_write (I2CName i2c, int address, const char *data, int length, int stop);
emilmont 8:c14af7958ef5 22 void i2c_reset (I2CName i2c);
emilmont 8:c14af7958ef5 23 int i2c_byte_read (I2CName i2c, int last);
emilmont 8:c14af7958ef5 24 int i2c_byte_write(I2CName i2c, int data);
emilmont 8:c14af7958ef5 25
emilmont 8:c14af7958ef5 26 #if DEVICE_I2CSLAVE
emilmont 8:c14af7958ef5 27 void i2c_slave_mode (I2CName i2c, int enable_slave);
emilmont 8:c14af7958ef5 28 int i2c_slave_receive(I2CName i2c);
emilmont 8:c14af7958ef5 29 int i2c_slave_read (I2CName i2c, char *data, int length);
emilmont 8:c14af7958ef5 30 int i2c_slave_write (I2CName i2c, const char *data, int length);
emilmont 8:c14af7958ef5 31 void i2c_slave_address(I2CName i2c, int idx, uint32_t address, uint32_t mask);
emilmont 8:c14af7958ef5 32 #endif
emilmont 8:c14af7958ef5 33
emilmont 8:c14af7958ef5 34 #ifdef __cplusplus
emilmont 8:c14af7958ef5 35 }
emilmont 8:c14af7958ef5 36 #endif
emilmont 8:c14af7958ef5 37
emilmont 8:c14af7958ef5 38 #endif
emilmont 8:c14af7958ef5 39
emilmont 8:c14af7958ef5 40 #endif