Skip to content

Commit 8e40032

Browse files
authored
Merge pull request #47 from ryankurte/remove-build-deps
Remove build.rs and skeptic from build-deps
2 parents d75f4f4 + 266a505 commit 8e40032

File tree

5 files changed

+30
-59
lines changed

5 files changed

+30
-59
lines changed

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22

33
name = "i2cdev"
4-
build = "build.rs"
54
version = "0.4.0"
65
authors = ["Paul Osborne <[email protected]>"]
76
license = "MIT/Apache-2.0"
@@ -22,7 +21,4 @@ nix = "0.11"
2221

2322
[dev-dependencies]
2423
docopt = "0.8"
25-
skeptic = "0.13"
2624

27-
[build-dependencies]
28-
skeptic = "0.13"

README.md

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,7 @@ The source includes an example of using the library to talk to a Wii
2727
Nunchuck (which has an i2c interface).
2828
[Go View the Example](https://github.com/rust-embedded/rust-i2cdev/blob/master/examples/nunchuck.rs).
2929

30-
Here's a real quick example showing the guts of how you create
31-
device and start talking to it...
32-
33-
```rust,no_run,skeptic-template
34-
extern crate i2cdev;
35-
36-
use std::thread;
37-
use std::time::Duration;
38-
39-
use i2cdev::core::*;
40-
use i2cdev::linux::{LinuxI2CDevice, LinuxI2CError};
41-
42-
const NUNCHUCK_SLAVE_ADDR: u16 = 0x52;
43-
44-
// real code should probably not use unwrap()
45-
fn i2cfun() -> Result<(), LinuxI2CError> {
46-
let mut dev = LinuxI2CDevice::new("/dev/i2c-1", NUNCHUCK_SLAVE_ADDR)?;
47-
48-
// init sequence
49-
dev.smbus_write_byte_data(0xF0, 0x55)?;
50-
dev.smbus_write_byte_data(0xFB, 0x00)?;
51-
thread::sleep(Duration::from_millis(100));
52-
53-
loop {
54-
let mut buf: [u8; 6] = [0; 6];
55-
dev.smbus_write_byte(0x00).unwrap();
56-
thread::sleep(Duration::from_millis(10));
57-
dev.read(&mut buf).unwrap();
58-
println!("Reading: {:?}", buf);
59-
}
60-
}
61-
```
30+
The [Documentation](https://docs.rs/i2cdev) contains a quick overview of how to get started with an i2c device.
6231

6332
In addition to the Read/Write traits, the following methods are
6433
available via the [I2CDevice trait](https://rust-embedded.github.io/rust-i2cdev/i2cdev/core/trait.I2CDevice.html).

build.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/lib.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@
1212
//! with i2c devices under Linux. The API wraps the Linux
1313
//! kernel interface for interacting with i2c in userspace:
1414
//! https://www.kernel.org/doc/Documentation/i2c/dev-interface
15+
//! ```rust,no_run
16+
//! extern crate i2cdev;
17+
//!
18+
//! use std::thread;
19+
//! use std::time::Duration;
20+
//!
21+
//! use i2cdev::core::*;
22+
//! use i2cdev::linux::{LinuxI2CDevice, LinuxI2CError};
23+
//!
24+
//! const NUNCHUCK_SLAVE_ADDR: u16 = 0x52;
25+
//!
26+
//! // real code should probably not use unwrap()
27+
//! fn i2cfun() -> Result<(), LinuxI2CError> {
28+
//! let mut dev = LinuxI2CDevice::new("/dev/i2c-1", NUNCHUCK_SLAVE_ADDR)?;
29+
//!
30+
//! // init sequence
31+
//! dev.smbus_write_byte_data(0xF0, 0x55)?;
32+
//! dev.smbus_write_byte_data(0xFB, 0x00)?;
33+
//! thread::sleep(Duration::from_millis(100));
34+
//!
35+
//! loop {
36+
//! let mut buf: [u8; 6] = [0; 6];
37+
//! dev.smbus_write_byte(0x00).unwrap();
38+
//! thread::sleep(Duration::from_millis(10));
39+
//! dev.read(&mut buf).unwrap();
40+
//! println!("Reading: {:?}", buf);
41+
//! }
42+
//! }
43+
//! ```
1544
1645
#![crate_name = "i2cdev"]
1746
#![crate_type = "lib"]

tests/skeptic.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)