mcp2003a
Rust crate for basic no_std LIN Bus communications with MCP2003A LIN Transceiver. Uses embedded-hal and embedded-io traits.
⚠️ WORK IN PROGRESS
Full Documentation: https://docs.rs/mcp2003a/latest/mcp2003a/
References
Usage
use ;
let uart = // Your embedded-hal UART driver
let break_pin = // Your embedded-hal GPIO output pin driver
let delay_ns = // Your embedded-hal delay driver
// Configure the LIN Bus with the following parameters:
let lin_bus_config = LinBusConfig ;
// Now control the MCP2003A LIN Transceiver with LIN configuration and driver
let mut mcp2003a = new;
// Read the feedback / diagnostic frame with Id 0x01:
// - Id: 0x01
// - Data: We provide an 8-byte buffer to store the data
let mut data = ;
match mcp2003a.read_frame
// Send a frame on the LIN bus to a device with Command frame of 0x00:
// - Id: 0x00
// - Data: [0x02, 0x03]
// - Checksum: 0x04
match mcp2003a.send_frame