Skip to content
ESP32-compatible C library for the SMBus protocol
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Add travis config file. Oct 22, 2017
include
.travis.yml
LICENSE Import from DavidAntliff/esp32-tsl2561-example. Oct 22, 2017
README.md
component.mk
smbus.c

README.md

esp32-smbus

Introduction

This component provides a subset of the System Management Bus (SMBus) version 3.0 protocol, used to communicate with SMBus-compatible devices over a 2-wire I2C bus. Only 7-bit I2C addresses are currently supported. SMBus PEC is not supported.

It is written and tested for the ESP-IDF environment, version 2.1, using the xtensa-esp32-elf toolchain (gcc version 5.2.0).

Example

An example of this component in use can be found at DavidAntliff/esp32-tsl2561-example

Features

Supports the following SMBus and I2C operations:

  • Quick Command - send the R/W bit to the slave.
  • Send Byte - send a single byte value to the slave.
  • Receive Byte - receive a single byte value from the slave.
  • Write Byte - send a command code and byte to the slave.
  • Read Byte - receive a byte from the slave in response to a command code.
  • Write Word - send a command code and word (two bytes) to the slave.
  • Read Word - receive a word (two bytes) from the slave in response to a command code. A byte count is transferred.
  • SMBus Write Block - send a command code followed by a block of bytes to the slave. A byte count is transferred
  • SMBus Read Block - receive a block of bytes from the slave in response to a command code. No byte count is used.
  • I2C Write Block - send a command code followed by a block of bytes to the slave. No byte count is used.

In addition, the I2C timeout can be configured.

Documentation

Automatically generated API documentation (doxygen) is available here.

Source Code

The source is available from GitHub.

License

The code in this project is licensed under the MIT license - see LICENSE for details.

Links

Acknowledgements

  • "I2C" is a registered trademark of Phillips Corporation.
  • "SMBus" is a trademark of Intel Corporation.

Roadmap

The following features are anticipated but not yet implemented:

  • 10-bit I2C addresses.
  • SMBus Packet Error Checking (PEC).
  • Support for Process Calls.
  • Support for Block-Write-Read Process Calls.
You can’t perform that action at this time.