Skip to content

schphil/sx150x-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SX150x 4/8/16 Channel Low Voltage GPIO driver

A no_std driver for the SX150x family of I²C GPIO expanders, providing both synchronous and asynchronous APIs. Built with type-safe register definitions using the device-driver crate and full compatibility with [embedded-hal] traits.

Usage

Blocking:

use sx150x::{Sx1503, Input, Pull};
use embedded_hal_async::i2c::I2c;

let mut i2c = I2c::new(..);
let pins =  Sx1503::take_pins().unwrap();
let mut input = Input::new(pins.pin0, i2c, Pull::Up).unwrap();
let is_high = input.is_high()?;

Async:

use sx150x::{Sx1503, OutputAsync, Level};
use embedded_hal_async::i2c::I2c;

let mut i2c = I2c::new(..);
let pins =  Sx1503::take_pins().unwrap();
let mut output = OutputAsync::new(pins.pin8, i2c, Level::Low).await.unwrap();
output.set_high().await?;

License

Licensed under either of

at your option.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages