{"id":30694698,"url":"https://github.com/dempfi/iqs7211e","last_synced_at":"2026-01-20T17:32:28.888Z","repository":{"id":307131807,"uuid":"1028509019","full_name":"dempfi/iqs7211e","owner":"dempfi","description":"Rust implementation of the Azoteq IQS7211e crate","archived":false,"fork":false,"pushed_at":"2025-08-08T12:23:45.000Z","size":2514,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-08T14:29:47.474Z","etag":null,"topics":["embedded-rust","iqs7211e","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dempfi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-29T16:25:18.000Z","updated_at":"2025-07-29T16:45:06.000Z","dependencies_parsed_at":"2025-07-29T17:39:25.199Z","dependency_job_id":"442a52e3-585f-4ccf-9be0-5123d5d91fd0","html_url":"https://github.com/dempfi/iqs7211e","commit_stats":null,"previous_names":["dempfi/iqs7211e"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dempfi/iqs7211e","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fiqs7211e","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fiqs7211e/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fiqs7211e/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fiqs7211e/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dempfi","download_url":"https://codeload.github.com/dempfi/iqs7211e/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fiqs7211e/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244302,"owners_count":25070959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-rust","iqs7211e","rust"],"created_at":"2025-09-02T06:44:02.989Z","updated_at":"2026-01-20T17:32:28.874Z","avatar_url":"https://github.com/dempfi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azoteq IQS7211E driver\n\n`iqs7211e` is a `no_std` async driver for the [Azoteq IQS7211E]\ncapacitive touch and gesture controller. It provides a strongly-typed API\nfor configuring the sensor over I²C, plus an awaited event API that yields\ngestures and one/two-finger snapshots.\n\n## Status\n\n- ✅ Runs on `embedded-hal` and `embedded-hal-async` 1.0\n- ✅ End-to-end configuration routine that mirrors the reference design\n- ✅ Strongly typed configuration helpers (Rx/Tx pin layout, gesture toggles, ATI tuning)\n- ⚠️ Breaking API changes may still occur prior to `1.0`\n\n## Getting started\n\nAdd the crate to your `Cargo.toml`:\n\n```toml\n[dependencies]\niqs7211e = \"0.1.2\"\n```\n\nThen initialise the device with an async I²C peripheral and a ready (RDY)\nGPIO implementing `embedded_hal_async::digital::Wait`.\n\n```rust\nuse embedded_hal_async::digital::Wait;\nuse embedded_hal_async::i2c::I2c;\nuse iqs7211e::{Config, Iqs7211e, Pinout, Pin};\n\nasync fn bring_up\u003cI2C, RDY, E\u003e(i2c: I2C, rdy: RDY) -\u003e Result\u003cIqs7211e\u003cI2C, RDY\u003e, iqs7211e::Error\u003cE\u003e\u003e\nwhere\n    I2C: I2c\u003cembedded_hal_async::i2c::SevenBitAddress, Error = E\u003e,\n    RDY: Wait,\n{\n  let pinout = Pinout::new(\n    [Pin::RxTx0, Pin::RxTx2, Pin::RxTx4],\n    [Pin::Tx8, Pin::Tx9],\n    [Pin::RxTx0],\n    [Pin::Tx8],\n  );\n  let config = Config::default().with_pinout(pinout);\n\n    let mut controller = Iqs7211e::new(i2c, rdy, config);\n    _ = controller.initialize().await?;\n\n    Ok(controller)\n}\n```\n\nRefer to the [API documentation](https://docs.rs/iqs7211e) for the full listing of\ntypes and helpers.\n\n## Listening for touch events\n\nUse `Iqs7211e::next_event()` to await gestures, single-touch, or multi-touch updates.\nSee runnable examples in `examples/`.\n\n## Feature overview\n\n- Full mirror of the Azoteq reference configuration sequence\n- Strongly typed bitfield wrappers for gesture, ATI, and hardware settings\n- Helpers for deriving valid sensing cycles from Rx/Tx pin layouts\n- Manual setup session helper to read the counters documented in Azoteq's GUI workflow\n- Convenience helpers to query firmware info, gesture bitfields, and\n  per-finger touch snapshots\n- No allocation, fits `no_std` targets\n\n## Manual setup workflow\n\nWhen replicating the \"Basic Setup\" procedure from Azoteq's reference\ndocumentation you can let the crate act as a runtime setup assistant.\n\n```rust\nuse embedded_hal_async::digital::Wait;\nuse embedded_hal_async::i2c::I2c;\nuse iqs7211e::{Config, Iqs7211e, SetupSnapshot};\n\nasync fn tune\u003cI2C, RDY, E\u003e(i2c: I2C, rdy: RDY) -\u003e Result\u003c(), iqs7211e::Error\u003cE\u003e\u003e\nwhere\n    I2C: I2c\u003cembedded_hal_async::i2c::SevenBitAddress, Error = E\u003e,\n    RDY: Wait,\n{\n  let config = Config::default(); // set your pin layout, thresholds, etc. before the session starts\n\n    let mut controller = Iqs7211e::new(i2c, rdy, config);\n    let mut session = controller.begin_setup();\n\n    session.initialize().await?;            // mirrors the GUI \"Start streaming\" + \"Write changes\"\n    session.enter_manual_control().await?;  // enables manual control and forces LP1 charge mode\n\n    let snapshot: SetupSnapshot = session.snapshot().await?;\n    let channels = snapshot.rx_count * snapshot.tx_count;\n    let deltas = \u0026snapshot.trackpad_deltas[..channels];\n    let bases = \u0026snapshot.trackpad_base_targets[..channels];\n    // Present the counters however you prefer (defmt logging, rtt, serial, ...)\n    // e.g. `defmt::info!(\"{:?}\", bases);`\n\n    session.finish().await?;                // leaves stream/manual modes in a clean state\n\n    // Apply the captured values to `controller.config`, then run `initialize()` again\n    // or bake them into your production configuration.\n    Ok(())\n}\n```\n\nThe `SetupSnapshot` structure exposes the live counters typically recorded\nduring bring-up:\n\n- `info` mirrors the GUI indicator block (charge mode, ATI status, etc.)\n- `trackpad_deltas` and `trackpad_base_targets` read back addresses `0xE200`\n  and `0xE100` flattened to `rx_count * tx_count` entries\n- `rx_count` / `tx_count` help you reshape the flattened arrays into your\n  physical matrix layout\n- `alp_*` fields expose the ALP channel counts and compensation values\n\nYou can capture multiple snapshots while manual control is active (for example\nafter tweaking thresholds) and feed the numbers into your own logging or GUI.\n\n### Advanced setup workflow\n\nThe Azoteq documentation splits tuning into intermediate and advanced passes\nthat refine ATI, thresholds, and power behaviour. The driver mirrors those\nsteps so you can script the process instead of relying on the GUI.\n\n- For the notes below let `channels = snapshot.rx_count * snapshot.tx_count`.\n\n- **Rx/Tx sanity checks** – While manual control is enabled, lightly touch the\n  corners and inspect `snapshot.info.tp_movement` together with\n  `\u0026snapshot.trackpad_deltas[..channels]`. If the active channels do not match the board layout,\n  revise the pinout configuration and rerun `initialize()`.\n- **ATI iteration** – Use `snapshot.trackpad_base_targets` to determine the\n  base-target counts (doc section 4.2). Adjust the trackpad ATI settings via\n  `config.auto_tune.tune` (adjust `target`, `coarse_divider`, `coarse_multiplier`,\n  `fine_divider`) until the reported counts align with the lookup table. After updating\n  the config values, call `initialize()` again to write them back and trigger a fresh ATI.\n- **Compensation window** – The `alp_comp_*` fields in the snapshot reflect the compensation\n  values. Keep them near the centre of the valid range (typically ~512). If the\n  snapshot shows values drifting to 0 or 1023, adjust\n  `config.auto_tune.tune.compensation_divider` and repeat the ATI step.\n- **Threshold tuning** – Record the per-channel deltas while pressing the\n  corners (`\u0026snapshot.trackpad_deltas[..channels]`) and compute the touch thresholds suggested in\n  doc section 4.3. Apply the resulting multiplier to\n  `config.channel_output.touch` (set/clear multipliers) and reinitialise.\n- **Mode timing** – Once the touch performance is acceptable, restore event\n  mode via `SetupSession::finish()`, then update the report-rate and timeout\n  fields in `config.timing` before the final `initialize()`. The defaults match\n  the reference design, but you can tailor them to your power budget by following\n  section 5 of the guide.\n\nRepeat the capture → adjust → initialise loop until the recorded values match\nyour targets. Because the configuration structure lives in memory, you can\nserialise it (e.g. JSON, TOML, or Rust constants) once the tuning is complete\nand feed the same values into production firmware.\n\ntuneing:\n\n- Set target to 0\n- read base target\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdempfi%2Fiqs7211e","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdempfi%2Fiqs7211e","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdempfi%2Fiqs7211e/lists"}