{"id":22920918,"url":"https://github.com/michaelkamprath/sn3193","last_synced_at":"2026-02-14T23:31:27.875Z","repository":{"id":264430507,"uuid":"893259161","full_name":"michaelkamprath/sn3193","owner":"michaelkamprath","description":"Rust driver for SN3193 LED driver","archived":false,"fork":false,"pushed_at":"2025-02-02T08:20:02.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-23T22:09:02.515Z","etag":null,"topics":["embedded","led-driver","no-std","rust","rust-embedded","sn3193"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelkamprath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-24T00:13:50.000Z","updated_at":"2025-02-02T08:19:27.000Z","dependencies_parsed_at":"2024-11-24T09:18:29.195Z","dependency_job_id":"31fa9165-69b4-469f-984b-9310c7755a85","html_url":"https://github.com/michaelkamprath/sn3193","commit_stats":null,"previous_names":["michaelkamprath/sn3193"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/michaelkamprath/sn3193","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkamprath%2Fsn3193","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkamprath%2Fsn3193/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkamprath%2Fsn3193/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkamprath%2Fsn3193/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelkamprath","download_url":"https://codeload.github.com/michaelkamprath/sn3193/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkamprath%2Fsn3193/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29460681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T22:42:09.113Z","status":"ssl_error","status_checked_at":"2026-02-14T22:42:05.053Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","led-driver","no-std","rust","rust-embedded","sn3193"],"created_at":"2024-12-14T07:17:31.466Z","updated_at":"2026-02-14T23:31:27.861Z","avatar_url":"https://github.com/michaelkamprath.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SN3193 Driver for Rust\n[![crates.io](https://img.shields.io/crates/v/sn3193.svg)](https://crates.io/crates/sn3193)\n\u003c!-- cargo-sync-readme start --\u003e\n\nThis Rust `embedded-hal`-based library is a simple way to control the SN3193 RGB LED driver.\nThe SN3193 is a 3-channel LED driver with PWM control and breathing mode. It can drive up to\n3 LEDs with a maximum current of 42 mA and is controlled via I2C. This driver is designed for the\n`no_std` environment, so it can be used in embedded systems.\n## Usage\nAdd this to your `Cargo.toml`:\n```toml\n[dependencies]\nsn3193 = \"0.1\"\n```\nThen to create a new driver:\n```rust\nuse embedded_hal::delay::DelayMs;\nuse embedded_hal::i2c::I2c;\nuse sn3193::SN3193Driver;\n\n// board setup\nlet i2c = ...; // I2C peripheral\nlet delay = ...; // DelayMs implementation\n\n// It is recommended that the `i2c` object be wrapped in an `embedded_hal_bus::i2c::CriticalSectionDevice` so that it can be shared between\n// multiple peripherals.\n\n// create and initialize the driver\nlet mut driver = SN3193Driver::new(i2c, delay);\nif let Err(e) = driver.init() {\n   panic!(\"Error initializing SN3193 driver: {:?}\", e);\n}\n```\n## Features\n### PWM mode\nThe driver can set the LEDs to PWM mode. This allows you to set the brightness of each LED individually.\n```rust\nif let Err(e) = diver.set_led_mode(LEDModeSettings::PWM) {\n   panic!(\"Error setting LED mode to PWM: {:?}\", e);\n}\n// check your device wiring to know which LED is which\nif let Err(e) = driver.set_pwm_levels(255, 128, 0) {\n  panic!(\"Error setting PWM levels: {:?}\", e);\n}\n```\n### Breathing mode\nThe driver can set the LEDs to breathing mode. This mode allows you to set the time it takes for the LED to\nramp up to full brightness, hold at full brightness, ramp down to off, and hold at off. Each of these times\ncan be set individually for each LED. Furthermore, the PWM levels can be set for each LED.\n```rust\n// set the breathing times the same for all LEDs\nif let Err(e) = driver.set_breathing_times_for_led(\n    LEDId::ALL,\n    BreathingIntroTime::Time1p04s,\n    BreathingRampUpTime::Time4p16s,\n    BreathingHoldHighTime::Time1p04s,\n    BreathingRampDownTime::Time4p16s,\n    BreathingHoldLowTime::Time2p08s,\n) {\n   panic!(\"Error setting breathing times: {:?}\", e);\n}\n// enable breathing mode\nif let Err(e) = driver.set_led_mode(LEDModeSettings::Breathing) {\n  panic!(\"Error setting LED mode to breathing: {:?}\", e);\n}\n```\nThe PWM levels and breathing times can be changed at any time. The driver will update the LEDs with the new settings.\n\n### Function chaining\nThe driver functions return a `Result` that contains the driver reference in the `Ok` value. This\ncan be chained together to make the code more readable.\n```rust\ndriver.set_led_mode(LEDModeSettings::PWM)?\n    .set_current(CurrentSettings::Current17p5mA)?\n    .set_pwm_levels(255, 128, 0)?\n    .enable_leds(true, true, true)?;\n```\n## License\nThis library is licensed under the MIT license.\n\n\u003c!-- cargo-sync-readme end --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelkamprath%2Fsn3193","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelkamprath%2Fsn3193","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelkamprath%2Fsn3193/lists"}