17#ifndef MBED_I2C_SLAVE_H
18#define MBED_I2C_SLAVE_H
20#include "platform/platform.h"
22#if DEVICE_I2CSLAVE || defined(DOXYGEN_ONLY)
24#include "hal/i2c_api.h"
178 int read(
char *data,
int length);
199 int write(
const char *data,
int length);
225#if !defined(DOXYGEN_ONLY)
An I2C Slave, used for communicating with an I2C Master device.
I2CSlave(const i2c_pinmap_t &static_pinmap)
Create an I2C Slave interface, connected to the specified pins.
int write(int data)
Write a single byte to an I2C master.
int receive(void)
Check if this I2C Slave has been addressed.
int read(char *data, int length)
Read bytes transmitted to this MCU from an I2C master.
I2CSlave(PinName sda, PinName scl)
Create an I2C Slave interface, connected to the specified pins.
void address(int address)
Set the I2C slave address.
void stop(void)
Reset the I2C slave back into the known ready receiving state.
void frequency(int hz)
Set the frequency of the I2C interface.
int write(const char *data, int length)
Write to an I2C master which is addressing this slave device.
int read(void)
Read a single byte from an I2C master.
Asynch I2C HAL structure.