cands_interface 0.1.20

This is an interface for DigitalServo USB CAN board.
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::device_driver::ftdi::{FtdiDriver, Ft232h};

impl super::TCAN455xTranceiver {
    pub fn new () -> Result<Self, Box<dyn std::error::Error>> {
        const SPI_CLK_FREQ: u32 = 15_000_000;
        const SPI_CLK_POLARITY: u8 = 0;
        let driver: FtdiDriver<Ft232h, _> = FtdiDriver::new(SPI_CLK_FREQ, SPI_CLK_POLARITY)?;
        Ok(Self { driver: Box::new(driver) })
    }
}