tree: c6e22c9e2da24aeb5cdc98d531c6b7f5faf7e7e2
  1. api/
  2. backend-aspeed/
  3. client/
  4. docs/
  5. server/
  6. README.md
services/i2c/README.md

I2C Service

IPC-based I2C service for the Pigweed kernel, modeled after the crypto service.

Architecture

┌────────────────────┐
│   I2C Client       │  (userspace task)
│   (tests, apps)    │
└────────┬───────────┘
         │ IPC (channel)
         ▼
┌────────────────────┐
│   I2C Server       │  (userspace task)
│   services/i2c/    │
│   server/          │
└────────┬───────────┘
         │ calls
         ▼
┌────────────────────┐
│   I2C Backend      │  (library)
│   backend-aspeed/  │
└────────┬───────────┘
         │ uses
         ▼
┌────────────────────┐
│ aspeed-ddk i2c_core│  (portable driver)
│   @oot_crates_no_  │
│   std//aspeed-ddk  │
└────────────────────┘

Components

  • api/ - Shared protocol definitions (op codes, error codes, wire format)
  • backend-aspeed/ - AST1060-specific backend using aspeed-ddk::i2c_core
  • client/ - IPC client library for userspace tasks
  • server/ - I2C server process handling IPC requests
  • tests/ - Integration tests

Build

# Build the i2c_core dependency check
bazel build --config=k_qemu_ast1060 //services/i2c/backend-aspeed:i2c_backend_aspeed

# Build and run tests
bazel test --config=k_qemu_ast1060 //target/ast1060/i2c:i2c_test --test_output=all

Operations

Op CodeOperationDescription
0x01WriteMaster write to device
0x02ReadMaster read from device
0x03WriteReadCombined write-then-read
0x10ConfigureSet I2C speed, mode

Status

  • [ ] API protocol definitions
  • [ ] Backend wrapper for aspeed-ddk::i2c_core
  • [ ] Server implementation
  • [ ] Client library
  • [ ] QEMU tests