Skip to content

Commit

Permalink
apis: i2c_master_slave: add support
Browse files Browse the repository at this point in the history
Adds support to the i2c master slave sycall api for libtock-rs. The
current implementation implements all the functionality synchronously.

This api was testing using 2 Particle Boron boards (nrf52840 based)
setup as a master and slave device. Additionally, this api was also tested by
communicating with an MCP9808 sensor as an I2C master, again using the
Particle Boron.

Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
  • Loading branch information
twilfredo committed Nov 30, 2023
1 parent a2c6ad8 commit 46da34b
Show file tree
Hide file tree
Showing 4 changed files with 458 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ libtock_buzzer = {path = "apis/buzzer"}
libtock_console = { path = "apis/console" }
libtock_debug_panic = { path = "panic_handlers/debug_panic" }
libtock_gpio = { path = "apis/gpio" }
libtock_i2c_master_slave = { path = "apis/i2c_master_slave" }
libtock_leds = { path = "apis/leds" }
libtock_low_level_debug = { path = "apis/low_level_debug" }
libtock_ninedof = { path = "apis/ninedof" }
Expand Down Expand Up @@ -58,6 +59,7 @@ members = [
"apis/buzzer",
"apis/console",
"apis/gpio",
"apis/i2c_master_slave",
"apis/leds",
"apis/low_level_debug",
"apis/ninedof",
Expand Down
16 changes: 16 additions & 0 deletions apis/i2c_master_slave/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "libtock_i2c_master_slave"
version = "0.1.0"
authors = [
"Tock Project Developers <tock-dev@googlegroups.com>",
"Wilfred Mallawa <wilfred.mallawa@wdc.com>",
]
license = "Apache-2.0 OR MIT"
edition = "2021"
repository = "https://www.github.com/tock/libtock-rs"
rust-version.workspace = true
description = "libtock I2C master-slave driver"

[dependencies]
libtock_platform = { path = "../../platform" }

Loading

0 comments on commit 46da34b

Please sign in to comment.