Skip to content

Commit

Permalink
docs(v0.0.11): clarify data buffer explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
zpg6 committed Jul 6, 2024
1 parent bc24bef commit c6289dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mcp2003a"
version = "0.0.10"
version = "0.0.11"
description = "Rust no_std LIN Bus communication using the MCP2003A LIN transceiver."
edition = "2021"
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion examples/mcp2003a-esp-rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ fn main() {

// Read the feedback / diagnostic frame 0x01 from the LIN bus:
// - LIN Id: 0x01 --> PID: 0xC1
// - Data: We provide an 8-byte buffer to store the data
// - Data: We provide an 11-byte buffer which includes
// [sync, id, ...up to 8 bytes of data..., checksum]
let mut data = [0u8; 11];
match mcp2003a.read_frame(0xC1, &mut data) {
Ok(len) => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
//! - [MCP2003A Datasheet](https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20002230G.pdf)
//!
//! # Usage
//! ```rust
//! ```no_run
//! let mut mcp2003a = Mcp2003a::new(uart2_driver, break_pin_driver, delay, lin_bus_config);
//! ```
//!
//! Then you can use the `mcp2003a` instance to send and receive LIN frames.
//!
//! ```rust
//! ```no_run
//! mcp2003a.send_wakeup();
//!
//! mc2003a.send_frame(0x01, &[0x02, 0x03], 0x05).unwrap();
Expand Down

0 comments on commit c6289dd

Please sign in to comment.